-
Notifications
You must be signed in to change notification settings - Fork 84
Fun with svelte/foo resolution #22
Comments
A good idea from @mrkishi - we could request https://unpkg.com/svelte/?meta and get a list of everything in the package and use that to help figure out what should resolve to what. |
I just realized, this is probably complicated by this recent addition. I don't know what the particular goal of that feature was, but it's probably incorrect to assume we'll get the same features out of whatever offline package registry as we can get from unpkg. |
It wouldn't be the easiest, but it would probably make the most sense to make the whole resolution part of this pluggable, a la Real Rollup. I don't know how else we're going to support proper resolution and yet also allow things to be loaded from local files. |
Ugh nope not quite resolved with that PR. #27 assumes that |
Does I assume you could use |
Post-v1, at v1.42. |
I think using We can also simplify some other stuff because it's a lot safer to depend on New PR incoming. |
The current version of the REPL resolves
svelte/foo
tounpkg.com/svelte/foo.mjs
. This will break if a new version of Svelte is released in its current form, becausesvelte/foo
ought to resolve tosvelte/foo/index.mjs
.The new version also includes
svelte/foo/package.json
which should theoretically makeunpkg.com/svelte/foo?module
resolve directly tounpkg.com/svelte/foo/index.mjs
via unpkg. But this doesn't work in the existing versions of Svelte, becauseunpkg.com/foo?module
will just give us the CJS version.The most obvious solution is ugly: inspect the version number, and if it's less than or equal to
3.4.4
, go with the old logicunpkg.com/svelte/foo.mjs
, and if it's greater, go withunpkg.com/svelte/foo?module
.Also potentially an issue:
https://unpkg.com/svelte@3.4.4/index.mjs?module
right now contains an ESM module (as expected, since unpkg respects package.json), but the import is from./internal?module
. I don't know whether this is going to be a problem. This would happen with all of the requests and responses if we went forward with the changes outlined here.The text was updated successfully, but these errors were encountered: