-
Notifications
You must be signed in to change notification settings - Fork 3k
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
[PROPOSAL][AWAITING TS 2.1] Use tsc's --importHelpers option to reduce the code size. #2436
Comments
As far as I know this requires consumer to import tslib for their own, isn't it? |
I seem we need to add tslib into our dependencies, but we don't have to require installing tslib for our user. |
In my project when using rollup, I end up with 103 |
@benlesh Is this something that can be considered for v6 with the other large restructuring? With all imports used from As I see it, there are four possible options:
Using |
@csvn, I think most people are using rollup/webpack to combine the files. This had fallen off my radar, and I'm not exactly sure what's best practice here now. Let me confer with a few people. |
I am concerned about making this as dep, as rx uses pinned version of dep it could cause 2 different tslib set (user code have latest tslib version a, while rx still uses old version b). Reason I haven't push forward this in v5. We could make as peerdep and open version instead of pinning, but that opens possibility breaking change in tslib (or incorrect combination between compiler) causes some unexpected behavior. Also curious what's best practices to resolve those cases. If there is, I'd definitely push it for v6. |
I agree that peerDependency is probably better to use than as a dependency. Another reason it might be useful to include |
I implemented this feature in #3416. I did the following three things very intentionally (but I'm open to discussion if someone finds them problematic):
|
…m5 and esm2015 builds (#3416) I intentionally didn't use the flag for cjs builds because that would make cjs builds incompatible with SystemJS without further configuration on the client-side - this would be highly undesirable.
I'd just like to mention, just by upgrading rxja alpha, I got the following saving for my lib: Thanks a lot @IgorMinar and @benlesh! 🎉✨ |
This issue seems safe to close to me. |
Yeah, I think this is done. |
The text was updated successfully, but these errors were encountered: