ruby.wasm icon indicating copy to clipboard operation
ruby.wasm copied to clipboard

Unable to use any CDN for ESM

Open WebReflection opened this issue 1 year ago • 0 comments

With recent split of the wasm file from the main module and recent module changes where UMD is preferred (a pretty defunct module kind on the Web as inherently incompatible with ESM) it's fairly impossible to use a CDN to run this project.

Assuming I use this end point:

https://cdn.jsdelivr.net/npm/@ruby/[email protected]/dist/esm/browser.js

the import from @bjorn3/browser_wasi_shim breaks everything.

Assuming I use the CDN to deliver https://cdn.jsdelivr.net/npm/@ruby/[email protected]/+esm I don't get the same export fields or the same logic actually present in the previous export.

unpkg breaks with ?module appended, esm.run fails, jsdelivr can't serve ESM.

Is there any plan to ship a proper ESM module or a different folder / dist structure that could benefit from these CDNs?

REaching the counter .wasm file is OK-ish, even if elsewhere, but the entry ESM point is basically unusable, thanks.

WebReflection avatar Feb 19 '24 12:02 WebReflection