Hacker News new | past | comments | ask | show | jobs | submit | jdd's comments login

Node will likely end up with multiple ways to disambiguate modules. Until then, you might dig https://npmjs.com/esm. No .mjs required.


The `esm` loader allows specifying a parse goal pragma as one of several ways to disambiguate source – https://npmjs.com/esm.

Node will likely end up needing more than just an extension to disambiguate as well.


I know styfle is aware, but for others, you can unlock named exports of CJS modules with @std/esm:

https://github.com/standard-things/esm

https://medium.com/web-on-the-edge/es-modules-in-node-today-...


npm5 and 5.1 has improved performance significantly so that it's comparable with yarn.


The TS response makes sense in light of the other issues your desired behavior would cause.


Naw, Lodash is modular. You can cherry-pick its modules. It's less than 716 bytes (with lodash-webpack-plugin).


You might be able to fix that with something like babel-plugin-lodash which can be ran over your code (and deps) to enforce cherry-picking across the board.

https://github.com/lodash/babel-plugin-lodash


Late reply, but, neat! I'll have a look.


Not smell just semver – http://semver.org/


To my mind, the "semver way" would be to make tree-shaking an option on a new minor version. After some number of releases, it might become a default on a new major version, if the maintainers so chose. Splitting the project into multiple codebases is not required by semver.


This! Lodash turns 5 in 4 months :)


I dig Babel 6. I'm glad they took the major bump, which allows breaking changes, to improve things.

The major bump means it's opt-in, so folks can continue to use the older version without breaking their workflow.


Consider applying for YC's Spring batch! Applications are open till Feb 11.

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: