the-dr-lazy / deox

Functional Type-safe Flux Standard Utilities

Home Page:https://deox.js.org

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Bundle size

eXaminator opened this issue · comments

Hi,

great library, but the bundle footprint seems to be rather large. In fact, in my small app it's the second largest after react-dom, even larger than redux itself.

webpack-bundle-analyzer gives me the following non-gzipped values:
react-dom: 103.89KB
redux: 6.04KB
deox: 40.09KB

I saw issue #42 which was just resolved. Maybe this will fix this issue too, but in general I'm not sure if maybe this library could be optimised some more. Maybe even add better support for tree-shaking. Sadly I'm not an expert on that topic myself.

Hi @eXaminator

Deox internally supports tree-shaking. In the build system of Deox, we create an ESM bundle of Deox that is tree-shakeable. The problem is the browser field in the package.json. Webpack prefers browser field over module and thus follow non-tree-shakeable UMD bundle instead tree-shakable ESM bundle.

To solve the problem we should rename browser field to unpkg.