-
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 symbols to work with Babel UMD exporting #2435
Conversation
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.
Give the observable
symbol an alias where it's being used. I think Symbol_observable
because that's what it represents.
src/Rx.ts
Outdated
@@ -171,7 +171,7 @@ import { QueueScheduler } from './scheduler/QueueScheduler'; | |||
import { AnimationFrameScheduler } from './scheduler/AnimationFrameScheduler'; | |||
import { $$rxSubscriber as rxSubscriber } from './symbol/rxSubscriber'; | |||
import { $$iterator as iterator } from './symbol/iterator'; | |||
import { $$observable as observable } from './symbol/observable'; | |||
import { observable } from './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 looks okay, but here (and other places in the codebase where you'd done this in this PR), you should probably do import { observable as Symbol_observable }
or something like that. observable
is just too generic a name, especially for this library.
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.
I can use $$observable
as an alias so only import will change observable as $$observable
@DzmitryShylovich apologies for taking my time to review this. I've had a busy couple of weeks |
@benlesh ok, np, I understand. new workplace etc :) should I change iterator and scheduler symbols in the similar fashion? |
5c868fe
to
da5a95d
Compare
Sure.. We'll just need to rename this PR to something like "Fix symbols to work with Babel UMD exporting". Also: If you can please change the commit messages to be like I'm still not certain how we should announce this change, and (ideally) deprecate the |
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.
- Update the other symbol exports to do the same thing
- Update commit messages to be prefixed with
fix(symbol/observable): words here
Thank you for your help on this @DzmitryShylovich |
da5a95d
to
62e70b6
Compare
62e70b6
to
bc852fa
Compare
@benlesh done. PTAL |
src/Subject.ts
Outdated
@@ -5,7 +5,7 @@ import { Subscriber } from './Subscriber'; | |||
import { ISubscription, Subscription, TeardownLogic } from './Subscription'; | |||
import { ObjectUnsubscribedError } from './util/ObjectUnsubscribedError'; | |||
import { SubjectSubscription } from './SubjectSubscription'; | |||
import { $$rxSubscriber } from './symbol/rxSubscriber'; | |||
import { rxSubscriber as Symbol_rxSubscriber } from './symbol/rxSubscriber'; |
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.
haha... GOTCHA! rxSubscriber
doesn't exist on Symbol
, really... (i.e. Symbol.rxSubscriber
is not at thing)... so you can probably just leave this as rxSubscriber
or as rxSubscriberSymbol
or something)
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.
So close
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.
Symbol.rxSubscriber is not at thing
https://github.com/ReactiveX/rxjs/blob/master/src/Rx.ts#L212 ?
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.
http://plnkr.co/edit/SS0t7wCUh2ANZiVGeTNi?p=preview I can import it. or what do you mean by not a thing
? :)
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.
@DzmitryShylovich oh I meant that Symbol.observable
-> Symbol_observable
, Symbol.iterator
-> Symbol_iterator
... those are polyfills. rxSubscriber
is just an RxJS library-specific symbol. It wouldn't exist on window.Symbol
or the like.
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.
hmm ok I'll just leave it as rxSubscriberSymbol
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.
done
…ort Babel UMD and others To migrate the code follow the example bellow: Before: import { $$observable } from 'rxjs/symbol/observable'; After: import { observable } from 'rxjs/symbol/observable'; Closes ReactiveX#2415
…Babel UMD and others To migrate the code follow the example bellow: Before: import { $$iterator } from 'rxjs/symbol/iterator'; After: import { iterator } from 'rxjs/symbol/iterator';
…support Babel UMD and others To migrate the code follow the example bellow: Before: import { $$rxSubscriber } from 'rxjs/symbol/rxSubscriber'; After: import { rxSubscriber } from 'rxjs/symbol/rxSubscriber';
bc852fa
to
234442e
Compare
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. |
Closes #2415