the-dr-lazy / deox

Functional Type-safe Flux Standard Utilities
https://deox.js.org
MIT License
206 stars 12 forks source link

Bundle size notes #151

Closed TNikolai closed 3 years ago

TNikolai commented 4 years ago

@the-dr-lazy First of all, thank you for this project, this is what I searched, but every time when I would install any dependency in the project I measure its size in bundlephobia.

redux-actions - 7kB deox - 23kB

Is it expected to have bundle size X3 than the initial redux-actions library, or maybe some build steps and dependencies can be optimized?

the-dr-lazy commented 4 years ago

Thank you for reaching. If I be right, that huge size is due to dependency of configureStore to the redux-starter-kit library. If you don't use it, it will be able to tree shake and you will not gain any size from that.

As you can see in the screenshot, the actual functionality of the library is not that huge.

Screen Shot 2020-09-04 at 11 11 29 PM

TNikolai commented 4 years ago

Yes, as I can see it is used in examples. If it is only the place where configure store is needed, maybe it is an option to have 2 separate build steps one for examples with connfigureStore and another just for the deox lib without additional libs. Probably tsconfig includes line should be updated and one more build step added for package.json scripts.

the-dr-lazy commented 4 years ago

Why we should care about usage of configureStore? If any user of package doesn't use it, it should tree shake. I didn't decided yet but maybe I'll go for a breaking change to remove configureStore. Anyone wants to use it then can simply install redux-starter-kit and go on.

How does includes TSC option affect bundle size? It's strange, did you tested it?

TNikolai commented 4 years ago

--How does includes TSC option affect bundle size? It's strange, did you tested it? No, I didn't test it, I thought TSC.includes an option used for the build but that is wrong it is used only for TS compilation.

DCzajkowski commented 4 years ago

The problem we are having at this point, is that we don't have tree-shaking implemented and it seems like deox is pulling in rxjs and redux-starter-kit. So from my perspective, removing it from the core would be a good choice 😅