-
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
feat(Symbol.observable): is no longer polyfilled #3387
feat(Symbol.observable): is no longer polyfilled #3387
Conversation
Generated by 🚫 dangerJS |
a725e97
to
dc575ba
Compare
dc575ba
to
21c54e1
Compare
src/internal/symbol/observable.ts
Outdated
really *required*, however, they should be warned to give them a | ||
clue as to why they might be seeing errors when trying to convert | ||
ObservableLikes to Observables */ | ||
if (!Symbol || !Symbol.observable) { |
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.
This will need to do typeof Symbol
because otherwise it still will do Symbol is not defined
. See #3394 for reference example
src/internal/symbol/observable.ts
Outdated
*/ | ||
export const $$observable = observable; | ||
export const $$observable = Symbol && Symbol.observable || '@@observable'; |
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.
Same as above, prolly easiest to wrap in a function like done in #3394 so only need to check once. Also will allow you to easily make sure the type is of symbol
instead of any
as it is in this case.
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.
Wrapping it in a function will only make it easier to test. The module body itself should only be called once, no?
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.
@benlesh Partially, though it also makes it easier to only need to do the typeof Symbol
check once.
btw I think these symbols are no longer publicly exported except for in the UMD build. Which one is intended? I'm not entirely sure if we should be exporting any of them. If we did, seems like I can see a possible argument about allowing libraries that use RxJS to add support for |
I don't disagree, @jayphelps, I think we should only be implementing/executing some logic if Symbol.observable is defined... this was just the quickest incremental step. |
BREAKING CHANGE: RxJS will no longer be polyfilling Symbol.observable. That should be done by an actual polyfill library. This is to prevent duplication of code, and also to prevent having modules with side-effects in rxjs.
21c54e1
to
433d774
Compare
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.
looks good now!
This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs. |
BREAKING CHANGE: RxJS will no longer be polyfilling Symbol.observable. That should be done by an actual polyfill library. This is to prevent duplication of code, and also to prevent having modules with side-effects in rxjs.