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

Feature request: JSR registry package #3678

Open
dbushell opened this issue Mar 3, 2024 · 2 comments
Open

Feature request: JSR registry package #3678

dbushell opened this issue Mar 3, 2024 · 2 comments

Comments

@dbushell
Copy link

dbushell commented Mar 3, 2024

JSR is a new package registry.
It would be useful to have the Node and Deno packages (and WASM variants) published there if possible.

Deno in particular does not allow JSR packages to import non-JSR dependencies:

error: Uncaught (in promise) TypeError: Importing https://deno.land/x/esbuild@v0.20.0/mod.js blocked.
JSR packages cannot import non-JSR remote modules for security reasons.
@evanw
Copy link
Owner

evanw commented Mar 7, 2024

https://jsr.io/docs/publishing-packages says this:

npm packages are supported: You can depend on npm packages by either specifying them in the dependencies of your package.json, or by referencing them in code using npm: specifiers such as import { cloneDeep } from "npm:lodash@4";.

It sounds like JSR lets you do import * as esbuild from 'npm:esbuild@0.20.1.

@dbushell
Copy link
Author

dbushell commented Mar 8, 2024

Yes this is true, that may be my solution.

A minor edge case, but this won't work on Deno Deploy because there is no writable file system. The Deno WASM package works on Deploy but npm:esbuild-wasm doesn't (some Node child processes API isn't compatibility). I guess a JSR package for Deno Deploy is rather niche.

I did look into this further and it'd require the denoflate package being published to JSR first as that's a dependency on the deno side.

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

2 participants