You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Please provide a bundled ESM build for @simplewebauthn/browser
#798
I'm using Deno and I want to load @simplewebauthn/browser in the browser via a dynamic import() / import map, without writing my own build step. Right now the only browser-ready files are the UMD ones (index.umd.min.js / index.es5.umd.min.js). Those don't work for import() because they're not real ES modules, they just attach everything to a global SimpleWebAuthnBrowser object instead of using export.
I know the npm package also has an esm/ folder, but that's not bundled either, it's a bunch of separate files importing each other (e.g. esm/index.js imports from esm/methods/startRegistration.js, which imports 7 more files from esm/helpers/). If a browser loads that straight from a CDN, it has to fetch each file, parse it, find its imports, fetch those, and so on, so it ends up as several round trips instead of one.
Could you add a single bundled ESM file to dist/bundle, something like index.esm.min.js, that has real export statements and everything inlined into one file? That way people could do:
in one request, same as the UMD file works today but with proper exports instead of a global.
Right now I'm working around it by running deno bundle on the JSR package myself, which works fine, just wanted to flag this in case it's useful for others too.
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
Uh oh!
There was an error while loading. Please reload this page.
Hey, thanks for this library, it's great.
I'm using Deno and I want to load @simplewebauthn/browser in the browser via a dynamic import() / import map, without writing my own build step. Right now the only browser-ready files are the UMD ones (index.umd.min.js / index.es5.umd.min.js). Those don't work for import() because they're not real ES modules, they just attach everything to a global SimpleWebAuthnBrowser object instead of using export.
I know the npm package also has an esm/ folder, but that's not bundled either, it's a bunch of separate files importing each other (e.g. esm/index.js imports from esm/methods/startRegistration.js, which imports 7 more files from esm/helpers/). If a browser loads that straight from a CDN, it has to fetch each file, parse it, find its imports, fetch those, and so on, so it ends up as several round trips instead of one.
Could you add a single bundled ESM file to dist/bundle, something like index.esm.min.js, that has real export statements and everything inlined into one file? That way people could do:
const { startRegistration } = await import("https://.../index.esm.min.js");in one request, same as the UMD file works today but with proper exports instead of a global.
Right now I'm working around it by running
deno bundleon the JSR package myself, which works fine, just wanted to flag this in case it's useful for others too.All reactions