esbuild icon indicating copy to clipboard operation
esbuild copied to clipboard

Feature request: JSR registry package

Open dbushell opened this issue 1 year ago • 2 comments

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/[email protected]/mod.js blocked.
JSR packages cannot import non-JSR remote modules for security reasons.

dbushell avatar Mar 03 '24 10:03 dbushell

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:[email protected].

evanw avatar Mar 07 '24 14:03 evanw

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.

dbushell avatar Mar 08 '24 13:03 dbushell