Added babel-cli to distribute ES5 version on npm #114
Conversation
I'd love to see this merged 😄 |
@nickysemenza This is now in review, hope to have this merged soon. |
@@ -1,5 +1,5 @@ | |||
var assert = require('assert') | |||
var ethUtil = require('../index.js') | |||
var ethUtil = require('../dist/index.js') |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
maybe tests can be part of the babel space too for some may write these in ES6?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah, yes, we can think about that, but let's leave this for now.
{ | ||
"presets": [ | ||
[ | ||
"env" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If publisher will build with latest node this will produce not ES5 output, is not it?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could you be a bit more specific, who is the "publisher", the one who publishes this on npm? And what "latest" node do you mean, which version? What changed in that version, do you have some link on that?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sorry, one missed word destroyed my message, I wanted write: If publisher will build with latest node version...
I checked https://www.npmjs.com/package/babel-preset-env
Without any configuration options, babel-preset-env behaves exactly the same as babel-preset-latest (or babel-preset-es2015, babel-preset-es2016, and babel-preset-es2017 together).
Did not knew about this. Sorry for false alarm.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No problem, I am not totally the transpilation/babel expert, so better to double check than one check to few. Sorry also for being a bit unconsistent in what Node version we actually support. I think we still have to fine-tune this a bit. I also didn't know how many people still need some ES5
compatible distribution and for what reasons.
So I think it probably makes sense for the various libraries to -yes- drop Node 4 support for the source version to be able to implement with newer and more elegant techniques, but also provide a transpiled distribution version with lower requirements.
Probably also has to be decided/evolved on a case-by-case (library-by-library) basis, depending on the needs of the users, the scope of the library and the compromises which have to be done in respect to security, speed and build/library size.
Actually this topic gets more and more complex for me the more I read on it. Will try to keep pace! 😄
Is there any chance this will get backport to the |
@gre Hmm, not very probable, sorry, there is so much to do on the various libs, don't think anyone will find the time. Is |
ok thanks @holgerd77 . I've sent a PR for -abi ethereumjs/ethereumjs-abi#59 , i'm going to see which other dependency I have still uses the 4.x. |
Adresses #111 and #92