-
Notifications
You must be signed in to change notification settings - Fork 126
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
Emit JavaScript modules for browsers like esm.sh
#133
Comments
esm.sh
esm.sh
esm.sh
esm.sh
hi, you can use esm.sh for now, util this feature is added. - https://esm.sh/jsr/@kwhinnery/yassify@1.0.0
+ https://jsr.io/@kwhinnery/yassify@1.0.0 |
The JSR website says it works with any runtime. Which is a pretty bold claim when it doesn't work in browsers :P |
It's actually a bit more complicated than that. It works on projects when your back end process/bundle your front end. But for me personally, the good ol' browser link is the way for quick and dirty prototyping. For some people, it's even their norm. |
For me it's my norm, it's why I exclusively write .js files 😅 Fwiw, jsr's usage policy says:
So I suppose that even if this does get added, it will still be pretty useless. I think maybe instead we should start bugging jsDelivr. They already support npm, so hopefully they could make use of the npm compatibility layer without too much effort. Their site says:
|
FYI esm.sh already added support for JSR. |
Ah cool! I wasn't aware. |
Yes to all of you that re-mention it, esm.sh already added support of JSR, that's the title and the whole point for this issue:
Why should we use something else to get JSR modules? |
I'm not here to annoy anyone subscribed to this issue, but... |
Deno is supposedly committed to supporting HTTP imports. Or at least not removing them. With the Deno standard library now published exclusively on JSR — deno.land/std is months out of date, and importing from source is broken — I'd expect JSR to surface some kind of HTTP import URL. |
Surprised that this is not (yet?) supported. I suppose it would be quite easy to serve packages directly to browsers, and seems like a missed opportunity. 😉 |
Absolutely. I can't believe I've opened this issue nearly one year ago! |
If I was to guess, they most likely don't want to support it at least at this time due to the extra hosting cost that would burden JSR with. |
Exactly. I hope some Tech Giant will stand up to support JSR. Maybe one that is part of WinterCG like Vercel or even better Cloudflare. |
JSR doesn't have the ability to emit JavaScript from TypeScript sources to serve browsers.
The JavaScript emitted should also be cached.
Example of TypeScript code from JSR https://jsr.io/@kwhinnery/yassify/1.0.0/mod.ts:
At this moment, this code doesn't work.
Although doing similar with
esm.sh
works:The
jsr.io
website actually displays thatJSR should implement emitting and caching for browsers. It would be the ultimate JavaScript registry.
The text was updated successfully, but these errors were encountered: