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

Move wmr.cjs to wmr.js (esm) #963

Open
renhiyama opened this issue Jul 19, 2023 · 3 comments
Open

Move wmr.cjs to wmr.js (esm) #963

renhiyama opened this issue Jul 19, 2023 · 3 comments
Labels
enhancement New feature or request

Comments

@renhiyama
Copy link

If the cli binary is converted into esm format, it would make it easier for URL imports, making the world a better place to live in. Well maybe that was an exaggeration, but atleast it would make https://esm.sh work.

Currently neither https://cdn.jsdelivr.net/npm/wmr/wmr.cjs/+esm works nor https://esm.sh/wmr/wmr.cjs works.

Considering nodejs now supports esm, it would be better to make the code ready for the future 😁

@renhiyama renhiyama added the enhancement New feature or request label Jul 19, 2023
@developit
Copy link
Member

What is the use case for loading this via a CDN? It's a 2mb CLI.

@renhiyama
Copy link
Author

What is the use case for loading this via a CDN? It's a 2mb CLI.

I could use it over reejs URL imports, basically URL imports for nodejs & bun (and works alongside with deno ofc).

Also is there any reason why you're still bundling cjs and not esm though? Pretty sure nodejs can do much better with esm.

@rschristian
Copy link
Member

I could use it over reejs URL imports, basically URL imports for nodejs & bun (and works alongside with deno ofc).

Why would you be importing it at all though? As mentioned, it's a CLI, generally not something you'd ever want to import.

Also is there any reason why you're still bundling cjs and not esm though?

This repo hasn't seen any development in a couple years, if you hadn't noticed. Node 12 was the original release target and it did not have great ESM support (though module format is mostly irrelevant for a CLI).

Pretty sure nodejs can do much better with esm.

I'm not quite sure what you think would be better?

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

No branches or pull requests

3 participants