feat: convert package to es module#58
Conversation
|
I appreciate the pull request, but I don't really see the point of doing this now. Keeping it as-is will achieve the same, since it's still using require now. I prefer to wait for import assertions, which will bring JSON support. However, since you already did the work, I'm going to merge and not release this for now. Should be easy to remove |
|
Can you include #59 in this PR? It's related. |
how is this "the same"? with his PR this module is an ES module, not cjs.
it would achieve the same as your other cjs to esm package conversions achieve. you want to move the eco-system as a whole forward. that was at least my impression: https://gist.github.com/sindresorhus/a39789f98801d908bbc7ff3ecc99d99c
the "global" require does not exist in an ES module. the imported
me too, but |
Done |
But you're using |
|
What I'm afraid of is that |
good point. I'll have a look myself with
gotcha, makes sense. 👍
cool, thank you! I'll report back about bundler support as well. thank you for taking the lead in converting your packages to ps: no hard feelings about closing this PR. it was just a drive-by coming from using ink and going through some ink plugins code, ending up here, and being surprised that this module was still |
I'm not going to close it. I just need to decide whether to release it or wait. |
|
alright, here is what I found: createRequire support in bundlers is pretty much non-existent at this point. (there's an issue and an [incomplete?] PR for json import assertions still at stage 3 at ECMA. support has been added to
there is an active PR for assuming you want to support the last supported LTS versions, starting with |
|
Thanks for investigating this. You should definitely comment this on https://gist.github.com/sindresorhus/a39789f98801d908bbc7ff3ecc99d99c |
|
I think it's smart to wait a few months and see how things develop before doing anything more here. |
also bumped all dev dependencies, fixed linting.
small memory improvement (lazy init): https://github.com/sindresorhus/cli-spinners/pull/58/files#diff-e727e4bdf3657fd1d798edcd6b099d6e092f8573cba266154583a746bba0f346R11
depends on: #59