Just a thought.
It does seem that the JS ecosystem is moving towards using the class syntax over prototype syntax. React being one example.
As pointed out by @rbndg in https://github.com/bitcoinjs/bitcoinjs-lib/issues/1069#issuecomment-389095993
Prefer the ES6 get/set syntax if possible.
module.exports = class Foo {
constructor () {}
get foo () { return 1 }
set foo () {}
static boo () { return 2 }
}
We don't need to be ubiquitous in this roll-out... and provided the breaking changes are in 4.0.0, I don't mind if we use either syntax before then.
What about ES6 import/exports? How are people going these days with that?
I use babel on my modules so it is ok... But, it was a horror to set up.
It has more traction on the frontend js than Nodejs. I think most node projects are still using require but on the frontend import/export has lots more traction. Especially in React dev.
I think this feature is out until Node supports it (if ever).
We don't want to rollup.
edit: that was RE import/export, not ES6 classes, my bad - reopened
Most helpful comment
It has more traction on the frontend js than Nodejs. I think most node projects are still using
requirebut on the frontend import/export has lots more traction. Especially in React dev.