Skip to content
This repository has been archived by the owner on Feb 13, 2023. It is now read-only.

Add Tree-shaking and UMD info on Docs #46

Open
AlgusDark opened this issue Jun 13, 2017 · 3 comments
Open

Add Tree-shaking and UMD info on Docs #46

AlgusDark opened this issue Jun 13, 2017 · 3 comments
Assignees
Labels

Comments

@AlgusDark
Copy link
Owner

Bloomer is able to be used with Tree-shaking thanks to bloomer/esm and already has module | jsnext:main in package.json.

Also, you can use it with UMD thanks to www.unpkg.com

@AlgusDark AlgusDark self-assigned this Jun 13, 2017
@AlgusDark
Copy link
Owner Author

Actually, we have this "side effects" on every component since we export default withHelpersModifiers HOC, so... we need to add the annotation /*@__PURE__*/ in function call to let uglify remove it:

const HOC = /*@__PURE__*/withHelpersModifiers(Component)
export default HOC;

@AlgusDark AlgusDark added this to the v1.0.0 milestone Jun 19, 2017
@AlgusDark AlgusDark mentioned this issue Jun 20, 2017
@AlgusDark
Copy link
Owner Author

We need to wait until resolution of microsoft/TypeScript#16727, and/or microsoft/TypeScript#13721 to see how we can implement Tree-Shaking because right now, TSC is removing /*@__PURE__*/ comment.

@AlgusDark AlgusDark added the bug label Jun 24, 2017
@AlgusDark AlgusDark removed this from the v1.0.0 milestone Jun 24, 2017
@dacioromero
Copy link

dacioromero commented Mar 16, 2020

I noticed this was marked as done, but there's still a minor issue with it.

The "browser" field in bloomer's package.json causes webpack to load the non-esm code which results in worse tree-shaking.

"browser": "bundles/bloomer.min.js",

See webpack/webpack#4674

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

No branches or pull requests

2 participants