-
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
The rxjs
package is bloated
#3753
Comments
I agree. 🤷♂️ IIRC, Most of the bloat is us trying to support everyone's module styles needs without confusing the crap out of users. If we publish I'm open to any and all proposed solutions (especially from people that want to help). I know @kwonoj would kill to get this smaller, because they use it with an Electron app over at SlackHQ, and they're including the whole package. |
just fyi around Electron side, I made decisions around gave up to deal with node_modules size / loading time and moving toward to bundling (even in main nodejs process, yes) to dodge several cases we needed to handcraft some solutions per each cases. |
@benlesh I suggest to set |
FWIW: There's an opportunity to try to change this for v7, as what I'm looking at doing there is currently in our experimental branch |
@csvn's proposal is actually good point, we may able to have as non-breaking changes? |
@csvn want to send PR for those? 📦 |
@kwonoj Sure, I'll send a PR in moment |
Another thing worth noting is all of the files left for v5 compat reasons will go away in the next version. |
|
We can probably figure out a way to strip comments from the |
I think that would be harder than it sounds, |
We might also look into minifying the different module type outputs. Although I'm not sure any one minifier is particularly good at that. |
But you're right about the comments, I thought TS only removed from source code... but setting it for all configs except |
There's really no measure for how much I hate all the different module systems. haha |
This may need some evalutions, especially size of sourcemap to construct mapped stack trace will sacrifice most of size gain. Also, on node side having sourcemap support is somewhat flaky. |
If we can just get Node to modernize and throw CJS out once and for all, we'd solve this whole problem. :D |
I honestly can't remember why we needed both |
as far as I remember esm5 is CJS module only replaces module import to es, while esm2015 compilation target es2015. |
|
Uhm.. the point about custom elements is not really relevant in this project. Ignore that 🙄 |
I tried updating the build in #3760, so comments are preserved in As a side note, removing comments from |
For anyone who doesn't need anything but the CommonJS modules: 7.x branch: react-native-community@65b60e5 You can use a 2 MiB (instead of 20 MiB) version with Yarn with this change in your
7.0.0-alpha.1 works as well if you are on the latest edge. |
I just checked a fresh install of create-react-app. These are the stats of the rxjs package (6.5.5): Looking at the directories, I don't really get why the original TypeScript sources ( The simplest approach to reduce the package size without changing the build process would be an
This should save around 2.5MB. |
Including src is intentional to provide correct code navigations with declarationmap. There are some planned deprecations around esm exports which will cut some of sizes. |
RxJS version: 6.2.0
The package is more than 6 MB. That is a lot for a utility library.
Why is
src
included in the package? Source maps and TS definition files are already included for each JS file, so I don't see the need to include the TS source files too.There's also a lot of bloat related to browser support:
bundles
,_esm5
,_esm2015
(3.8 MB in total). Would you consider publishing a separate package for Node.js usage without all the bloat? For example,rxjs-node
.The text was updated successfully, but these errors were encountered: