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

[REPL] Switch to jsDelivr #457

Open
longnguyen2004 opened this issue Apr 4, 2023 · 11 comments
Open

[REPL] Switch to jsDelivr #457

longnguyen2004 opened this issue Apr 4, 2023 · 11 comments

Comments

@longnguyen2004
Copy link

unpkg has been intermittent for ~6 months. jsDelivr is more resilient, (seems to) supports CORS and also hosts files from GitHub, so switching to it would fix #282 as well.

@jimaek
Copy link

jimaek commented Apr 4, 2023

Let us know if the jsDelivr team can help with anything. jsDelivr is under active development and aims at production use-cases with multi-CDN logic https://www.jsdelivr.com/network/infographic

@sean-mystyle
Copy link

JSDelivr has a helpful tool for converting an unpkg URL to their jsdelivr url here:

https://www.jsdelivr.com/unpkg

@theetrain
Copy link
Contributor

In my related comment, I suggested using Skypack to help with package compatibility: #137 (comment)

@longnguyen2004
Copy link
Author

jsDelivr also has esm.run, which does ESM conversion and minification as well.

@benmccann
Copy link
Member

@longnguyen2004 thanks for the suggestion (as well as the issues in Svelte itself - sorry we have a hard time keeping up with all the issues 😄)

Let us know if the jsDelivr team can help with anything. jsDelivr is under active development and aims at production use-cases with multi-CDN logic https://www.jsdelivr.com/network/infographic

@jimaek, just curious, how were you made aware of this issue? Do you have a GitHub alert for jsDelivr always running or something?

@jimaek
Copy link

jimaek commented Apr 18, 2023

Yep I monitor jsDelivr mentions in case someone needs help

@PuruVJ
Copy link
Collaborator

PuruVJ commented Dec 29, 2023

Hi, I'm experimenting with jsDelivr in REPL(See #551). So far loving it, only issue is that it doesn't resolve barrel imports(https://cdn.jsdelivr.net/npm/radix-svelte/dist/components) while unpkg does(https://unpkg.com/radix-svelte/dist/components). Can be done manually in the REPL by resolving with different methods('.js', '.mjs', '.cjs', './index.js', 'index.cjs', 'index.mjs'), but that would require 7 fetch requests in worst case, which is too much to be doing on user's device.

That is something that would make transitioning very easy. Is this possible to implement on jsdelivr's end? cc @jimaek

@MartinKolarik
Copy link

Hi, I'm experimenting with jsDelivr in REPL(See #551). So far loving it, only issue is that it doesn't resolve barrel imports(https://cdn.jsdelivr.net/npm/radix-svelte/dist/components) while unpkg does(https://unpkg.com/radix-svelte/dist/components). Can be done manually in the REPL by resolving with different methods('.js', '.mjs', '.cjs', './index.js', 'index.cjs', 'index.mjs'), but that would require 7 fetch requests in worst case, which is too much to be doing on user's device.

That is something that would make transitioning very easy. Is this possible to implement on jsdelivr's end? cc @jimaek

Hey, we support server-side resolving in ESM mode so this would generally work: https://cdn.jsdelivr.net/npm/radix-svelte@latest/dist/components/+esm but here the package declares exports and doesn't expose that directory, so it can't be accessed like that. For packages with no exports it works with all files.

@PuruVJ
Copy link
Collaborator

PuruVJ commented Jan 2, 2024

I am facing some weird problems with esm.run, where the output component code just doesn't work with esm.run, but does with regular old jsdelivr. Is there a way to configure the rollup and terser version esm.run uses?

@MartinKolarik
Copy link

Is there a way to configure the rollup and terser version esm.run uses?

No, but if the files happen to be built using an older version, we might be able to update them to the version we use at this time.

@benmccann
Copy link
Member

We gave up on esm.run because the bundling was causing issues with ending up with multiple versions of the Svelte runtime. jsdelivr would still be interesting though

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

7 participants