You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This leads to compatibility issues with legacy browsers that do not yet support ES6 features, i.e. IE11 or Edge 14. Example screenshots taken from IE11 developer tools console debugger, project setup using Babel 6 + Webpack 3:
Console error:
... leads to:
Context
I'm using rambdax v0.7.7 in a project that needs to be transpiled to ES5 to be compatible with IE >= 11 using Babel.
Unfortunately Babel does not support the transpilation of ES6 features within the source code of node_modules, mainly because of build speed reasons. You can read more about the discussion here: facebook/create-react-app#1125
Furthermore the build process will fail when using i.e. the UglifyJS plugin for Webpack. Running:
npm run build
in a given setup leads to
ERROR in bundle.js from UglifyJs Unexpected token: operator (>) [../node_modules/rambda/dist/rambda.esm.js:3,0][bundle.js:1,73120]
Usually you could handle such cases within your own source code too using Babel. But since Babel will not touch the node_modules, what comes in ES6 syntax will remain ES6 in the bundle.
Suggestion
Precompiling the source to ES5 or using an ES5 friendly syntax would enable rambdax to be used in projects suitable for legacy browsers and would also solve build problems.
The text was updated successfully, but these errors were encountered:
@voodoods@selfrefactor i'm having the same problem and can't seem to find a solution. Even my hacky hotfix to compile it myself did not work, as i'm missing all the .babelrc plugins from rambdax.
Thank you @voodoods for bringing this up. I was a bit surprised as I assumed that nobody uses this library and I am glad that I was mistaken.
Anyway, I pushed two new versions - 0.8.0 and 0.8.1
0.8.0 is build against node4.0.0 and it doesn't have arrow functions. This build should work in your case. Let me know if you still face issues.
0.8.1 is build against version 9.2.0
Similar issue is with Rambda - selfrefactor/rambda#52 and there we agreed to wait for the relevant Webpack bug to be fixed. That is why I approached this issue in this manner.
Issue Description
Currently rambdax is using ES6 syntax within its source like i.e. arrow functions, see example: https://github.com/selfrefactor/rambdax/blob/master/dist/rambdax.esm.js#L125
This leads to compatibility issues with legacy browsers that do not yet support ES6 features, i.e. IE11 or Edge 14. Example screenshots taken from IE11 developer tools console debugger, project setup using Babel 6 + Webpack 3:
Console error:
... leads to:
Context
I'm using rambdax v0.7.7 in a project that needs to be transpiled to ES5 to be compatible with IE >= 11 using Babel.
Unfortunately Babel does not support the transpilation of ES6 features within the source code of node_modules, mainly because of build speed reasons. You can read more about the discussion here: facebook/create-react-app#1125
Furthermore the build process will fail when using i.e. the UglifyJS plugin for Webpack. Running:
npm run build
in a given setup leads to
ERROR in bundle.js from UglifyJs Unexpected token: operator (>) [../node_modules/rambda/dist/rambda.esm.js:3,0][bundle.js:1,73120]
Related issue: webpack-contrib/uglifyjs-webpack-plugin#104
Usually you could handle such cases within your own source code too using Babel. But since Babel will not touch the node_modules, what comes in ES6 syntax will remain ES6 in the bundle.
Suggestion
Precompiling the source to ES5 or using an ES5 friendly syntax would enable rambdax to be used in projects suitable for legacy browsers and would also solve build problems.
The text was updated successfully, but these errors were encountered: