AngelMunoz / Finny

A cross-platform tool for unbundled front-end development that doesn't depend on Node or requires you to install a complex toolchain
https://perla-docs.web.app/
MIT License
132 stars 11 forks source link

Replace Skypack with esm.sh as default source #95

Closed nojaf closed 1 year ago

nojaf commented 1 year ago

Hello,

I'm circling back to my Perla project to try and update everything to Fable 4. I had to install some new packages and long story short things aren't going well with Skypack: https://github.com/skypackjs/skypack-cdn/issues/343.

I used https://esm.sh/ as a workaround. (Installed things manually) And I think it could be a great replacement for the default source when adding a package.

Thoughts?

AngelMunoz commented 1 year ago

Hey there, nice to have you back

In the latest previews I actually did change skypack for jspm as the default CDN, for the moment since I'm relying in the jspm generator API I can only support what they support (jspm, skypack, unpkg, jsdlivr) I'll investigate a little bit around esm.sh and see if they have an API I can tap into, so we can consider adding it to the list of out of the box supported CDNs.

However, as you can see you can manually update those in the import map and things should just work it is one of the advantages import maps have!

AngelMunoz commented 1 year ago

Just in case you're wondering about the jspm generator api https://jspm.org/docs/api

The Apis we're currently using are in the Generator section

AngelMunoz commented 1 year ago

I just gave another look to their generator CLI, it looks like esm.sh support has been added

https://github.com/jspm/generator/tree/main#providers

So I will look into incorporate this into perla as well

nojaf commented 1 year ago

Oh that is great! Thanks a bunch. Because, as far as I understood it, similar to skypack, esm.sh will actually expose es6 modules. Even if the npm package uses something else, which is really what we are after.

AngelMunoz commented 1 year ago

Using esm.sh as source has been enabled for beta 16