-
Notifications
You must be signed in to change notification settings - Fork 6
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix exports for ESM NodeNext TypeScript support #29
Conversation
Thanks for your contribution. Could you please split appart the changes you're doing:
|
Yep sure! I'll work on that. |
Hi @nikku! I wanted to check in to see if you and your team had a chance to discuss? |
@benasher44 Thanks for the poke. We're still in discussion what to do with these type definitions, as they will break CJS support. Currently our favorite is to publish an ESM only version of this project moving forward. |
@nikku CJS support should work fine. It's only broken for CJS when the module system is set to NodeNext/Node16, but that was broken already. Maybe you're seeing something I'm not though? Happy to fix |
I'm also supportive of going ESM-only! I don't think that's necessary though, if you all aren't ready for that kind of breaking change. |
Could we at minimum merge #31? That'll fix the local compile errors I'm seeing. This one will further improve the situation, but it's fine to table. |
6e6ce4d
to
e8b8359
Compare
Updated this PR with a simplified version of the export, based on |
Closes #28
After this, here is the result from attw:
I also confirmed that this fixes the local issue I was having.
To fix CJS, you would need a copy of all of the index.d.ts as index.d.cts, which I was not able to to figure out how to do easily with rollup. That said, this PR is a net improvement, and I would argue great support for NodeNext + ESM is better than worrying too much about the NodeNext + CJS case (cjs without nodenext is still fine).
This also switches from bundlesize to bundlemon. I could not
npm i
due to issues with bundlesize, so I switched to bundlemon, which isn't abandoned.