Skip to content
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

Merged
merged 3 commits into from
Apr 3, 2017

Conversation

DzmitryShylovich
Copy link
Contributor

@DzmitryShylovich DzmitryShylovich commented Mar 3, 2017

Closes #2415

@coveralls
Copy link

Coverage Status

Coverage increased (+0.0003%) to 97.688% when pulling 5c868fe on DzmitryShylovich:gh/2415 into 7c41c08 on ReactiveX:master.

Copy link
Member

@benlesh benlesh left a 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';
Copy link
Member

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.

Copy link
Contributor Author

@DzmitryShylovich DzmitryShylovich Mar 15, 2017

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

@benlesh
Copy link
Member

benlesh commented Mar 15, 2017

@DzmitryShylovich apologies for taking my time to review this. I've had a busy couple of weeks

@DzmitryShylovich
Copy link
Contributor Author

@benlesh ok, np, I understand. new workplace etc :)

should I change iterator and scheduler symbols in the similar fashion?

@coveralls
Copy link

Coverage Status

Coverage increased (+0.0003%) to 97.688% when pulling da5a95d on DzmitryShylovich:gh/2415 into 69d051b on ReactiveX:master.

@benlesh
Copy link
Member

benlesh commented Mar 15, 2017

should I change iterator and scheduler symbols in the similar fashion?

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 fix(symbol/observable): will be exported as \observable` to better support Babel UMD and others`. That way this will show up in our automated change logs.

I'm still not certain how we should announce this change, and (ideally) deprecate the $$observable-type exports by v7. Maybe @IgorMinar has a recommendation?

Copy link
Member

@benlesh benlesh left a 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

@benlesh
Copy link
Member

benlesh commented Mar 15, 2017

Thank you for your help on this @DzmitryShylovich

@DzmitryShylovich DzmitryShylovich changed the title refactor(Symbol): deprecate $$observable and replace it with observable Fix symbols to work with Babel UMD exporting Mar 15, 2017
@coveralls
Copy link

Coverage Status

Coverage increased (+0.001%) to 97.689% when pulling 62e70b6 on DzmitryShylovich:gh/2415 into e4e7a18 on ReactiveX:master.

@DzmitryShylovich
Copy link
Contributor Author

@benlesh done. PTAL

@coveralls
Copy link

Coverage Status

Coverage increased (+0.001%) to 97.689% when pulling bc852fa on DzmitryShylovich:gh/2415 into e4e7a18 on ReactiveX:master.

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';
Copy link
Member

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)

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

So close

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Contributor Author

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? :)

Copy link
Member

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.

Copy link
Contributor Author

@DzmitryShylovich DzmitryShylovich Mar 16, 2017

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

Copy link
Contributor Author

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';
@coveralls
Copy link

coveralls commented Mar 16, 2017

Coverage Status

Coverage increased (+0.001%) to 97.689% when pulling bc852fa on DzmitryShylovich:gh/2415 into e4e7a18 on ReactiveX:master.

@benlesh benlesh merged commit 747bef6 into ReactiveX:master Apr 3, 2017
@DzmitryShylovich DzmitryShylovich deleted the gh/2415 branch April 3, 2017 19:57
@lock
Copy link

lock bot commented Jun 6, 2018

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.

@lock lock bot locked as resolved and limited conversation to collaborators Jun 6, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants