-
Notifications
You must be signed in to change notification settings - Fork 89
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
Untranspiled es6 distibution is breaking in IE #52
Comments
@selfrefactor Can you transpile es6 modules using babel in |
This is from the changelog:
Which means that you should use version 0.9.8, if you need ES5 comparability. I will create another ES5 version, once there are enough changes made since 0.9.8 The current Rambda version and version 0.9.8 don't have major functional changes, so for now I suggest leave it as it is. There is Typescript issue related to If that doesn't happen, we'll have to wait for few more changes to come, before making es5 compatible build. |
We are using rambda by importing individual modules using
But the modules are in es6. Even 0.9.8, the files inside For eg:
The above is es6 code. Basically what i am saying is, can u publish es5 code in |
Thanks for the merge. Now we can import modules individually without having to include entire rambda file
And on rollup, tree shaking will work as usual with es6 imports |
Rather than release two separate packages, would it be better to have an entry point for the non-transpiled es2015 code and another that works across browsers. https://github.com/rollup/rollup/wiki/pkg.module |
I suppose my point is that as a library consumer I don't want to have to transpile code from an npm module before I can use it. |
There is issue with Webpack https://stackoverflow.com/questions/46642791/webpack-doesnt-respect-module-field-in-package-json that makes your suggestion problematic. Otherwise, I agree with you that you, as a library consumer, don't need to transpile code so you can use it. |
Would it instead be an option to expose a "browser" entry in the package.json and then consumers would have an option when compiling with babel or webpack etc...? |
The bug is exactly that when browser field is set, Webpack don't use esm and therefore treeshaking is useless. New version of Webpack is already in alpha and should be a stable release soon. If the new version overcome the bug, then I would expose browser as you suggest. Otherwise, if the bug stay, then the current solution should also remain(which is to not expose browser field). |
Okay, that makes sense. Thanks for the update. Is it then worth keeping this issue open until the main package is browser safe, or specify in the Docs that there is a browser safe version tag available separately? |
I will do both. Thank for the input. |
When using the latest version of rambda, it breaks in IE as the code is untranspiled es6.
The text was updated successfully, but these errors were encountered: