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

Remove all rxjs/add/... imports from the library code #3716

Closed
IgorMinar opened this issue Mar 22, 2017 · 2 comments
Closed

Remove all rxjs/add/... imports from the library code #3716

IgorMinar opened this issue Mar 22, 2017 · 2 comments

Comments

@IgorMinar
Copy link
Contributor

Bug, feature request, or proposal:

Please remove all imports starting with rxjs/add/... and replace them with the side-effect free version.

This will also mean that you can no longer expect the operators to be monkey-patched on the prototype which makes material code uglier, but the benefit is that the application developers will not hit cases where some operators are available and others aren't where the availability of operators can change via innocent refactoring of internals of Angular Material.

In other words by using rxjs/add imports, every call you make becomes part of your public api and the operator added in this way will have to be retained even when you stop using it because removing it would be a breaking change.

What is the expected behavior?

Proper usage: example from @angular/router https://github.com/angular/angular/blob/5efc86069ff92d980bb460c15deccb1e0fff9363/packages/router/src/apply_redirects.ts#L10-L19

What is the current behavior?

Example code with rxjs/add/... import: https://github.com/angular/material2/blob/c524438b70510af0a27fe4e53c1970b8a42f0705/src/lib/tooltip/tooltip.ts#L33

there are several more importas like this throughout the repo:

aio/node_modules/@angular/material/autocomplete/autocomplete-trigger.js:2
aio/node_modules/@angular/material/bundles/material.umd.js:2
aio/node_modules/@angular/material/core/overlay/scroll/scroll-dispatcher.js:1
aio/node_modules/@angular/material/dialog/dialog-container.js:1
aio/node_modules/@angular/material/icon/icon-registry.js:6
aio/node_modules/@angular/material/select/select.js:1
aio/node_modules/@angular/material/sidenav/sidenav.js:1
aio/node_modules/@angular/material/tabs/tab-body.js:1
aio/node_modules/@angular/material/tabs/tab-group.js:1
aio/node_modules/@angular/material/tabs/tab-header.js:1
aio/node_modules/@angular/material/tooltip/tooltip.js:1

Which versions of Angular, Material, OS, browsers are affected?

2.0.0-beta.2

Is there anything else we should know?

I'm working with @Blesh to fix this using something like a pipe operator: https://twitter.com/IgorMinar/status/844348523869016066

@jelbourn
Copy link
Member

Dupe of #2622

@angular-automatic-lock-bot
Copy link

This issue has been automatically locked due to inactivity.
Please file a new issue if you are encountering a similar or related problem.

Read more about our automatic conversation locking policy.

This action has been performed automatically by a bot.

@angular-automatic-lock-bot angular-automatic-lock-bot bot locked and limited conversation to collaborators Sep 5, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants