-
Notifications
You must be signed in to change notification settings - Fork 17
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
feat!: distribute as ESM #449
Conversation
I'm pretty sure that the error reported in #447 is due to some TypeScript bug - but moving this package to ESM can't hurt, either way. Considering that all supported Node.js versions have support for ESM, I don't think we need to cut a major release for this. |
Co-authored-by: Matt Kane <[email protected]>
This reverts commit 70dd13b.
@@ -13,12 +13,12 @@ jobs: | |||
strategy: | |||
matrix: | |||
os: [ubuntu-latest, macOS-latest, windows-latest] | |||
node-version: [14.0.0, '*'] | |||
node-version: [18.19.0, '*'] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As we still need to support Node 14 in our build shouldn't we keep it that way here as well?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ESM support was still experimental in Node 14: https://nodejs.org/docs/v14.2.0/api/esm.html#esm_enabling
That's why the tests failed before I updated this here: https://github.com/netlify/functions/actions/runs/7113273604/job/19364886077
They became stable in Node 16, so maybe we can set the minimum version to Node 16?
Netlify Build doesn't have a runtime dependency on @netlify/functions, so it should be fine to update this independently. If we're intending to raise the minimum Build version anyway, we might as well start here! Especially since users can choose to stay on the old version of this package, until they upgraded their Node.js to v16+.
@Skn0tt Are you planning on working on this? A PR with such a large diff will go stale very quickly. |
I can work on it in the coming days. What's your feeling towards moving this to ESM in general, do you foresee any problems from that? |
Any CJS functions that use any runtime components of this library (as opposed to just the types) would start failing, right? I think that would be acceptable as long as we cut a major version and make it clear in the release notes that the library is now ESM-only. |
Yes, that's what i'm assuming. So i'll make it a major release then 👍 |
Addresses #447 by moving this package to ESM.
Because Ava doesn't play super nice with ESM, i've swapped it out for Vitest.