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

Weird suffix when using import_map.json #88

Open
omar2205 opened this issue Aug 26, 2022 · 4 comments
Open

Weird suffix when using import_map.json #88

omar2205 opened this issue Aug 26, 2022 · 4 comments
Labels
bug Something isn't working help wanted Extra attention is needed

Comments

@omar2205
Copy link

#^ is being added to the end of the URL (removed from its location after @)

Successfully updated:
https://deno.land/x/fresh@^1.0.2/ ^1.0.2 -> 1.0.2#^
https://esm.sh/preact@^10.10.0 ^10.10.0 -> 10.10.6#^
https://esm.sh/preact@^10.10.0/ ^10.10.0 -> 10.10.6#^
https://esm.sh/twind@^0.16.17 ^0.16.17 -> 0.16.17#^
https://esm.sh/twind@^0.16.17/ ^0.16.17 -> 0.16.17#^

import_map.json

{
  "imports": {
    "$fresh/": "https://deno.land/x/[email protected]/#^",
    "preact": "https://esm.sh/[email protected]/#^",
    "preact/": "https://esm.sh/[email protected]/#^/",
    "preact-render-to-string": "https://esm.sh/preact-render-to-string@^5.2.1?external=preact",
    "@twind": "./utils/twind.ts",
    "twind": "https://esm.sh/[email protected]/#^",
    "twind/": "https://esm.sh/[email protected]/#^/"
  }
}
@hayd hayd added bug Something isn't working question Further information is requested and removed bug Something isn't working labels Aug 29, 2022
@hayd
Copy link
Owner

hayd commented Aug 29, 2022

The idea is that udd controls the update, and the ^ is moved to the fragment.

that said, this is probably too aggressive (?) and the ^ may differ between /x , esm and udd...

my personal preference is that udd/the fragment manages the update behavior and the version is always fixed...
That way future dependency updates can't randomly break builds (and dependency updates require explicitly running udd, so you can test etc)... but this may not be desirable for everyone. 🤔

@omar2205
Copy link
Author

The problem I was having was adding a slash (/) in something like preact that didn't need it, resulting in errors. And /#^ doesn't work in general.

I hate to say it, but can't you make a udd.lock file? Where I can set those versions? It could be JSON or just text like Python.

@hayd
Copy link
Owner

hayd commented Aug 29, 2022

ah, the slash

@hayd hayd added bug Something isn't working and removed question Further information is requested labels Aug 29, 2022
@omar2205
Copy link
Author

But also this "preact": "https://esm.sh/[email protected]/#^", breaks. And this "preact/": "https://esm.sh/[email protected]/#^/", results in:

error: Uncaught (in promise) TypeError: 
The specifier ""preact/hooks"" backtracks above its prefix ""preact/""

@hayd hayd added the help wanted Extra attention is needed label Oct 16, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

2 participants