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

add a jsnext:main so we can distribute ES6 modules #2523

Closed
wants to merge 1 commit into from

Conversation

Whoaa512
Copy link

Also add modules to the distribution files and relevant docs to README and CHANGES.

See https://github.com/rollup/rollup#can-i-distribute-my-package-as-an-es6-module

@taion
Copy link
Contributor

taion commented Nov 11, 2015

I don't think this is a good idea.

  • Our test coverage runs against the Babel transpiled files, so we don't actually verify functionality when using e.g. rollup directly
  • The shipped npm package only includes lib/ and doesn't include modules/ at all
  • The source uses ES7 features like class property initializers and would still need to go through Babel again anyway, so it's not sufficient to just use a ES6-aware bundler
  • rollup has minimal adoption next to e.g. Browserify and webpack and I think pointing to it in our README is just going to confuse users

@taion
Copy link
Contributor

taion commented Nov 11, 2015

We do have to resolve this to let users take full advantage of webpack 2.0, but I'm not sure this PR is a good way forward.

@taion
Copy link
Contributor

taion commented Nov 11, 2015

As it stands, I think if we wanted to do this, we'd have to ship e.g. a es6/ build that transpiles everything except for the module system. It's not a good idea to ship the raw source instead of the transpiled source; packages in general should not make users deal with transpiling their code.

Additionally, I'd much rather point users at webpack v2.0.0-beta rather than rollup, just because webpack has a lot more adoption and people who otherwise haven't already made a choice of package bundler would likely be quite a lot better served by going there, in terms of e.g. their ability to get help or find examples or documentation.

I'm going to close this PR for now and open a new issue for discussion. I like the idea on paper of shipping an ES6 module build that allows users to both import from react-router and not include modules that they don't use, but just exporting our raw source is not the correct way to do this.

@taion taion closed this Nov 11, 2015
@taion taion mentioned this pull request Nov 11, 2015
@taion
Copy link
Contributor

taion commented Nov 11, 2015

We'd appreciate hearing your thoughts on #2524. If we do decide to go with exposing modules/, I'd be happy to re-open this PR, but I think there are better options available toward this end. It'd be good to get some discussion before just adding another build target, though.

@lock lock bot locked as resolved and limited conversation to collaborators Jan 20, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants