troyanskiy/ngx-resource

import only required parts from rxjs instead of rxjs/Rx

smnbbrv opened this issue · 12 comments

Hi @troyanskiy

is there any intention behind import { Observable } from 'rxjs/Rx'; https://github.com/troyanskiy/ngx-resource/blob/master/src/Resource.ts#L3 instead of import { Observable } from 'rxjs/Observable';? This is of course comfortable because it sets up all the observable operators; however it makes the bundle size bigger.

Do you have plans on changing this?

Hello @smnbbrv
That is true, I will change it in next release.
Thanks a lot.

Hi @troyanskiy

this could be a breaking change for lots of people... Another major version?

Why do you think so?
I will import only needed for the resource lib and if others will need some more from Rx, they should import it on theres project

I did not import any of the operators before and today recognized why it actually was like that (so this is how this issue appeared). If this behavior will change, the library can't be updated safely anymore because there is a high chance that nobody actually imported any operators because they were just available until the update. That's why I think it can be breaking change, although it's fully library consumers' fault and not library's itself

Actually... I've just replaced rxjs/Rx to more precise imports and the final bundle file become even bigger...
Before 131kb after 134kb.

LOL, that can't really be it. Something should be wrong...

could be that some of the rxjs/Rx imports is forgotten...

LOL, Nope, RX is not included into the final bundle...

Check the bundle file.
So I think I will keep the lib as is.

Well... I think I will release that changes and mark as breaking changes.
It's better to precise imports.

I'm a bit confused now, would you release those or not? :)

Yes, I will. :)