-
Notifications
You must be signed in to change notification settings - Fork 3k
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
style(Notification): Use enum to safely type the notification kinds #4405
style(Notification): Use enum to safely type the notification kinds #4405
Conversation
The build is failing✨ Good work on this PR so far! ✨ Unfortunately, the Travis CI build is failing as of f7332f5. Here's the output:
|
This is technically breaking changes since string enum only works > 2.4 typescript compiler. |
f7332f5
to
5f962a5
Compare
@kwonoj hmm true, is there a stated minimum supported version of typescript for rxjs? |
we don't explicitly and I feel we may need, but that's also breaking changes 😅 for next major. |
It would be a non-breaking change if export type NotificationKind = 'N' | 'E' | 'C'; And doing so would also make it type safe. |
True, but I would prefer |
5f962a5
to
060d766
Compare
Pull Request Test Coverage Report for Build 7761
💛 - Coveralls |
I think this change looks great. Just need to discuss this with the team, and it'll have to wait for the next minor release (likely soon), since it's a new feature. |
I like this but proposing next major and we explicitly declared supported ts version from next major. |
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.
LGTM.
This is technically breaking changes since string enum only works > 2.4 typescript compiler.
My understanding is that the minimum supported version of TypeScript is 2.8. That's the minimum we test against in CI.
Description:
Rather than using magic strings which are easily use incorrectly, this PR introduces a
enum NotificationKind
.This is not a breaking change as all clients that happen to already test the kind against a string will still have the same behaviour, both at compiletime and runtime, with the exception that if they use a notification kind letter that does not exist, they will get a compile time error.