Skip to content
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

Publishing ESM #70

Open
43081j opened this issue Jun 18, 2024 · 2 comments
Open

Publishing ESM #70

43081j opened this issue Jun 18, 2024 · 2 comments

Comments

@43081j
Copy link

43081j commented Jun 18, 2024

Most consumers are running in node (without a bundler) so this has been fine so far as CJS

However, it is the only one of the many alternatives that doesn't ship modern modules. So it would be good to solve that

To avoid having to ship a dual package (which would mean doubling the package size), my suggestion is basically:

  • maintain a 1.x branch which ships as CJS
  • maintain main which ships as ESM
  • all changes go into both branches until a majority of consumers are using the ESM version

Id be happy to help out if needed

@crutchcorn
Copy link

Something like TanStack Config, suggested here: #59 (comment)

Would fix this and allow dual-publishing. I can make a PR for this if wanted

@43081j
Copy link
Author

43081j commented Jan 26, 2025

i'd be cautious of publishing a dual package, especially since require(esm) will soon be in all LTS node versions and typescript

if it was up to me, i'd still opt for going esm-only and keeping any CJS/older-node consumers on the old version (but backporting fixes if we ever needed any). its a fairly simple package so i can't see many fixes being needed, if any

just my opinion though ofc

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants