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

Improve bundle size by dropping RxJS and improving build process? #172

Open
markerikson opened this issue Aug 4, 2020 · 0 comments
Open

Comments

@markerikson
Copy link

I hadn't looked at Redux-Logic in a while, but was pointed back to it in a Twitter discussion ( https://twitter.com/matbrowndotdev/status/1290612927536467968 ).

Glancing at the lib again, one of my biggest concerns is the bundle size. Comparing things in Bundlephobia, redux-logic is 20K min+gz, while redux-saga is 5K and redux-observable is 1.5K:

https://bundlephobia.com/result?p=redux-logic@3.0.2

I see that the bulk of that size is from RxJS itself, as well as the core-js lib.

For comparison, Redux Toolkit itself is only 10K min+gz, and that already includes the Redux core and Immer. I can't encourage folks to use a Redux addon lib that's twice as big as RTK, much less even consider whether it might be something that's worth building in by default (per the "declarative side effects" discussion in reduxjs/redux-toolkit#349 ).

I know that there's a bunch of other observable-based libs out there. How feasible would it be to switch to another observable implementation that's smaller, in an effort to shrink the bundle size? How much would switching away from RxJS affect the TS typings? I'm sure it would break things and require a major version, but are different observable libs compatible enough that you could still bring your own RxJS operators if you wanted to and hook in to whichever observable lib gets used here?

Also, could the build process be improved to shrink that core-js output?

Looking at the build output in https://unpkg.com/browse/redux-logic@3.0.2/dist/redux-logic.js , it looks like you're using Webpack for bundling. Have you considered switching to Rollup, and perhaps even rewriting the source in TS and using the tsdx tool like we do with Redux Toolkit?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant