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

Support jsnext:main and module fields #862

Closed
dvdzkwsk opened this issue Nov 15, 2016 · 5 comments
Closed

Support jsnext:main and module fields #862

dvdzkwsk opened this issue Nov 15, 2016 · 5 comments

Comments

@dvdzkwsk
Copy link
Member

This is fairly low on the priority list, especially since v1.0.0 is still looking to be shipped, but I wanted to document it for record keeping.

It would be great for SUIR to provide a bundle that maintains ES6 imports/exports so that bundlers that natively understand ES6 modules (webpack 2, rollup) can tree shake its usage in order to produce smaller bundles. Adding support for babel-plugin-lodash is already a great start, especially for webpack 1.0 and similar; this change would take it a step further by allowing bundlers to perform the same thing natively without the overhead of additional tooling.

Note: it's important that the code still be preprocessed with babel, because we should not assume anything else about the user's environment.

I believe that this is important piece of functionality, especially as the library grows, because it means that users don't have to be as concerned about the library's weight as a whole and can reap the benefits of targeted bundles without additional work on their part, especially as more bundlers implement tree shaking natively.

See:

Steps

  1. Import SUIR in a bundler that understands ES6 modules.
  2. Do not use a plugin to transform imports (such as babel-plugin-lodash)

Expected Result

Unused SUIR code should not be included in the final bundle.

Actual Result

All SUIR code is put into the bundle regardless of whether or not it was used.

Version

all

@levithomason
Copy link
Member

Agreed, this should be pretty easy to setup.

@levithomason
Copy link
Member

Can reference this PR for a roadmap, reduxjs/redux#1369.

@levithomason
Copy link
Member

@davezuko is something you'd want to pick up?

@dvdzkwsk
Copy link
Member Author

I could, but don't want to assign it to myself until I have time to commit to it, especially with the holidays coming up. Will keep it in mind and if I manage to take a crack at it I'll let you know/post a PR and link here.

@levithomason
Copy link
Member

Released in semantic-ui-react@0.64.4.

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

No branches or pull requests

2 participants