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

RXJS lettable operators #8720

Closed
elvirdolic opened this issue Dec 2, 2017 · 7 comments
Closed

RXJS lettable operators #8720

elvirdolic opened this issue Dec 2, 2017 · 7 comments

Comments

@elvirdolic
Copy link

There are severals discussions around the rxjs imorts.

Does the CLI handle this correctly?

import {map} from 'rxjs/operators/map';

Vs

import {map} from 'rxjs/operators';

In which case does tree shaking work in CLI projects?

@kylecordes
Copy link

Functionally, this works great, my group is using it on multiple projects already.

We have not yet verified whether the tree shakes correctly with CLI; hopefully someone from the team can answer that part. It should do so, but there could be some tweak yet needed. (If you need to deploy shortly in a case where the bundle size is vital, just try it and see if it affects your bundle size.)

@elvirdolic
Copy link
Author

We have changed everything to lettable imports like this: import {map} from 'rxjs/operators';

No change in payload after migration. This is the reason I was asking.

@devoto13
Copy link
Contributor

devoto13 commented Dec 3, 2017

Both ways should support tree shaking. In my case I get a slight bundle size increase when importing from rxjs/operators instead of long import (499K vs 496K), which is probably caused by inclusion of file with re-exports of all operators. In both cases source-map-explorer indicates that no extra operators are included.

@hccampos
Copy link

hccampos commented Dec 3, 2017

Shouldn't matter either way, but the terser version is way easier to maintain and read.

Anyway, in RxJS 6 you'll be able to import everything from 'rxjs' which will be awesome if it can be properly tree shaken.

@deebloo
Copy link
Contributor

deebloo commented Dec 5, 2017

@elvirdolic like @devoto13 said it should work correctly

@Splaktar
Copy link
Member

I also saw my bundle size increase by 10 KB as RxJS increased from 60 KB to 122 KB when using the new lettable operators. I also mentioned this in #8854 (comment). Still looking for the issue that is tracking this bundle increase bug.

@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 7, 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

6 participants