Refactor non-ISO calendars to use ES6 classes#113
Merged
justingrant merged 3 commits intojs-temporal:mainfrom Jan 13, 2022
Merged
Refactor non-ISO calendars to use ES6 classes#113justingrant merged 3 commits intojs-temporal:mainfrom
justingrant merged 3 commits intojs-temporal:mainfrom
Conversation
edcf8ae to
1e7910d
Compare
28f2a3f to
68d9ccf
Compare
68d9ccf to
71ac874
Compare
71ac874 to
0de68cd
Compare
Contributor
Author
|
Oops, forgot to commit before latest force-push. Reopening! |
Contributor
Author
justingrant
commented
Jan 11, 2022
12wrigja
reviewed
Jan 11, 2022
* removes unnecessary type cast * types the `impl` object more precisely * removes un-needed spread operator * adds more comments
@ptomato spotted some leftover code that wasn't needed anymore
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

The implementation of non-ISO calendars has always been a bit sloppy and confusing since I wrote it as a proof-of-concept a year ago. Now that non-ISO calendar implementations are fully typed in #109, it's easier and safer to refactor them into a more maintainable set of ES6 classes. The inheritance structure is below, with bold classes are actual ICU calendars, the non-bold ones are base classes.
This PR removes a lot of extra TS type code that is not needed using classes where types for inherited methods is implicit.
This is a pretty big PR but I wasn't sure how to split it into multiple commits given that things are pretty intertwined... once I started pulling on the ES6 thread, the whole sweater came with it. 😄