-
Notifications
You must be signed in to change notification settings - Fork 35
Refactor non-ISO calendars to use ES6 classes #113
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
justingrant
merged 3 commits into
js-temporal:main
from
justingrant:calendar-es6-classes
Jan 13, 2022
Merged
Refactor non-ISO calendars to use ES6 classes #113
justingrant
merged 3 commits into
js-temporal:main
from
justingrant:calendar-es6-classes
Jan 13, 2022
Conversation
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
edcf8ae
to
1e7910d
Compare
28f2a3f
to
68d9ccf
Compare
68d9ccf
to
71ac874
Compare
71ac874
to
0de68cd
Compare
Oops, forgot to commit before latest force-push. Reopening! |
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
approved these changes
Jan 12, 2022
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Big improvement!
@ptomato spotted some leftover code that wasn't needed anymore
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. 😄