4 ms·
Not specifically for GitHub, but: https://deno.land/manual@v1.30.3/advanced/publishing https://deno.land/manual@v1.30.3/advanced/publishing The point seems to
by katsura 4y ago
Not specifically for GitHub, but:
https://deno.land/manual@v1.30.3/advanced/publishing https://deno.land/manual@v1.30.3/advanced/publishing
The point seems to be that it doesn't need anything special, you just import files, and Deno takes care of the rest.
- brundolf 4y agoAs soon as Deno introduced me to the idea of just using URLs for importing dependencies, it immediately felt like obviously the best way Want a private repository? Stand up an apache server. Or an S3 bucket. CDN in front? Sure, why not Want to casually host and not deal with a repository? Import directly from github Namespacing? Domain names. And they already have ownership controls/auth that your ecosystem doesn't then have to reinvent Combine that with import-mapping (being able to tell the runtime to load X when it sees Y), and I don't see any reason to do it any other way
- revskill 4y agoYes, the only requirements/issues as i see, is: - Need a fallback plan if original hosting died ? - Need to specify immutable version/hash for the url ?
- brundolf 4y agoImport maps take care of the first, like I said: https://deno.land/manual@v1.30.3/basics/import_maps https://deno.land/manual@v1.30.3/basics/import_maps And Deno supports lockfiles for the second: https://deno.land/manual@v1.30.3/basics/modules/integrity_checking https://deno.land/manual@v1.30.3/basics/modules/integrity_ch... It also has a vendoring mechanism, if you prefer that approach: https://deno.land/manual@v1.30.3/tools/vendor https://deno.land/manual@v1.30.3/tools/vendor
- revskill 4y agoThen it's cool. Same in Haskell when i could use multiple versions in same module.
- matklad 4y agoOne potentially compelling reason is dependency resolution. You can’t express Cargo-style “collect _requirements_ for all dependencies, and then pick the minimal set of dependencies which satisfies all requirements” with just urls. You potentially can encode fancy constraints for each specific dep into an url, but you can’t have an algorithm which globally looks at the set of dependencies. If you want that use-case, you’ll need some extra tooling which reads constraints and writes the import map. OTOH, it’s not clear if fancy constraints solve more problems than they create. Notably, if the only constraint is `^x.y.z`, than the gready, expressible-via-urls algorithm of always selecting the latest semver-compatible version yields the minimal solution.
- brundolf 4y agoYeah that's fair. Personally I'm not too worried about that use-case, but it is something that would be tricky to solve with URLs that get treated as black boxes