-
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
fix(Notification): replace const enum #4556
Conversation
BTW, I attempted to add a |
Pull Request Test Coverage Report for Build 8266
💛 - Coveralls |
This is great, and will allow us to move to v6.4. Are there any concerns about merging this in? |
Unfortunately, this is a breaking change. Anyone using the |
I think if we just leave the enum where it is, and convert everything else to just use We can then |
@benlesh Unfortunately, this has to be a breaking change. It's the export that is the problem - regardless of whether or not
The introduction of the const enum was a breaking change for many people - myself included - so I see no reason the fix cannot also be a breaking change. |
Maybe just |
The enum is kept, but it is no longer a const enum. It cannot be exported as a const enum without effecting an error if isolated modules are used.
@benlesh I've updated the PR to use a literal union in the I've added a deprecation - with a message - to the enum. In the next major version, the enum could be ditched and |
It looks like this is actually passing, the Travis error seems to be unrelated. Any chance we can get this in now? |
* fix(Notification): replace const enum Closes ReactiveX#4538 * chore: use literal union and keep enum The enum is kept, but it is no longer a const enum. It cannot be exported as a const enum without effecting an error if isolated modules are used.
Description:
This PR replaces the
NotiticationKind
const enum that was introduced in 6.4.0 with a string-literal union type. The latter is type-safe and compatible with single-module transpilation. Const enums are not, as the transpiler cannot know what should be used as a replacement for a reference to a const enum without using type information.The
NotiticationKind
const enum is a problem for any projects using the--isolatedModules
flag or for projects using the Babel TypeScript transform - which means any TypeScript projects generated withcreate-react-app
.Related issue (if exists): #4538