-
Notifications
You must be signed in to change notification settings - Fork 16
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
build: pure ESM #106
build: pure ESM #106
Conversation
|
we target node 22, though we make an attempt to support version 20 within reason, and so far there hasn't been any reason not to. node 18 is in maintenance LTS, and will end-of-life in only a couple of months. as for the |
That's completely OK. Then you should make it clear. Placing
Would you make a final decision on whether to adopt it as a new practice? |
those are fair points. would you mind cleaning up this PR to just have the |
OK, removed them. |
thanks! |
Pure ESM
Check this out.
Node version
You should deliberately set the minimum supported node version of the public library.
In the case of
@livekit/agents
, I felt an impression that@types/node=22
was specified without a clear intention of support. Using@types/node=22
means, you only check types against 22, so you may miss chances that older versions of nodejs do not support some APIs. Conventionally, it's likely that a new runtime introduces a few new built-in APIs, but dropping out of old APIs is much less likely, though it happens.It's always OK that you set the latest runtime version as the official minimum guarantee, no matter whether it actually works on older runtimes. But I doubted you set the version number by conventional criteria.
I set the node version from the root level. Of course, you can override it package-wise as well.
I chose 18, as it's a rational starting point to fully support ESM.
Testing and changing this is up to you maintainer, but remember, you should set it by clear intention.