Closed tinovyatkin closed 4 years ago
Yeah, that was the initial plan – to drop Babel quite some time in a future, when Node will expose and async iterators. But I'm still using it at least for public fields (they sure could be moved to the constructor or accessors, this't not a big deal for me) and to bundle ESM along with the CommonJS distro.
Also, generated .mjs are broken because real ECMAScript imports must include file extensions.
I don't know, the initial support was added here https://github.com/octet-stream/form-data/pull/3 and I'm not actually using these in my projects. And yeah, it doesn't seem to work anymore.
Also, while I expose ESM in the package distro along with CommonJS I want to keep backward capability with the CJS due to https://github.com/octet-stream/form-data/issues/6
Check how it was archived by me at https://github.com/node-fetch/node-fetch/pull/805
Looks nice, but I'm not a huge fan of distributing sources and bundled all-in-one file when I'm making Node.js modules.
Basically all I need is to compile ES modules down to CJS and replace all .js
or .mjs
in paths with .cjs
. I will take a look if I can achieve that and keep the module's structure.
no huge fan of bundling everything either...
Probably I'll just end up removing ESM support and that's that, since the package have only default export. As far as I can tell, you can use CJS packages with ESM modules (am I right?), so having ESM now does not have any sense for me. I will return to ESM support in a future. Also I will drop Babel as you proposed.
Babel has been removed from the project. You can try now https://github.com/octet-stream/form-data/releases/tag/v2.3.0
Much less @babel/runtime included into production dependencies.
Also, generated .mjs are broken because real ECMAScript imports must include file extensions.