-
Notifications
You must be signed in to change notification settings - Fork 6.8k
refactor: avoid polluting the user's rxjs setup #2652
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
Conversation
CODING_STANDARDS.md
Outdated
someObservable.map(...).subscribe(...); | ||
|
||
// YES | ||
import {map} from 'rxks/operator/map'; |
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.
typo on rxks
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.
Thanks, fixed it.
f1ebe26
to
5af94df
Compare
Currently, the internal uses of RxJS operators are done via patch imports, which add methods directly to the global `Observable` object. This can be an issue since the user may not know where these methods are coming from and may depend on them. Afterwards, if Material removes a method import, the user's app will break since the methods won't be defined anymore. This PR: * Replaces all of the patch imports with imports of individual operators and fixes any issues that showed up afterwards. * Adds a `FunctionChain` class to help with chaining the individually-imported operators. Fixes angular#2622.
5af94df
to
21ee585
Compare
# Conflicts: # src/lib/autocomplete/autocomplete-trigger.ts # src/lib/dialog/dialog-container.ts
This is still something we need to do, but it's going to get stuck rebasing all the time if we're not ready for it. @crisbeto let's give this another try after beta.3 and ng-conf We should also introduce a lint check at the same time so that we don't keep adding more in the future. |
Is this still scheduled for beta 4, or do you expect it will be bumped? |
We may push it out a bit- we're waiting to see if rxjs will add a more convenient syntax |
Closing in favor of #5314. |
This issue has been automatically locked due to inactivity. Read more about our automatic conversation locking policy. This action has been performed automatically by a bot. |
Currently, the internal uses of RxJS operators are done via patch imports, which add methods directly to the global
Observable
object. This can be an issue since the user may not know where these methods are coming from and may depend on them. Afterwards, if Material removes a method import, the user's app will break since the methods won't be defined anymore. This PR:FunctionChain
class to help with chaining the individually-imported operators.Fixes #2622.