-
-
Notifications
You must be signed in to change notification settings - Fork 159
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
Go ESM-only #211
Comments
Or maybe we could compile to ESM and CommonJS now that cookie uses TypeScript and needs to be transpiled anyway. Although this would increase the package size, it’s just an idea. |
@bjohansebas That would be a solution but in the Ref comment linked by @balazsorban44 we can find:
from @blakeembrey. Was it discussed in the weekly TC meeting? I think I remember something but no details. |
This has been discussed in a few forums. Please search the issues. TLDR: this package is staying commonjs for a while. You can safety import commonjs in every environment we support (including into ESM files) and you still cannot import ESM into some environments we support (current Node.js LTS if using require in a CJS file). I am not going to close this because it would be good to have a single place for folks to have this conversation (especially to hear from other project members, although they have mostly all shared their opinions elsewhere in EDIT: I guess an EDIT should be made to directly address the op.
Can you give a clear and concrete example of this package not "running well in an esm only env"? The browser without a bundler is not a supported environment and never has been. |
First of all, thanks for the work on this library! It is appreciated!
The minimum required Node.js version is 18, which supports ESM.
Ref:
The opposite is true as well, ESM is supported by all modern bundlers, as it is the actual standard.
Context: This is currently making it hard to adapt
@auth/core
(a dependent of thecookie
library), which is an ESM-only package, expected to run well in ESM-only environments. Currently it does not, unfortunately: https://x.com/OrJDevv/status/1853418682522763369This issue is more of a probing on the willingness to re-visit the ESM path.
My alternatives:
@auth/core
Both of which ideally I would like to avoid long-term. 🙏
The text was updated successfully, but these errors were encountered: