Shipping support for module script integrity in Chrome & Safari
Subresource Integrity previously covered only top-level scripts, styles and preloads, not imported ES modules, which forced Shopify's PCI-compliant checkout to shim dynamic imports. Shopify revived Guy Bedford's proposal to add an "integrity" section to import maps that maps module URLs to hashes, so static imports, dynamic import(), top-level module scripts and modulepreload are verified before execution without the cache-invalidation cascades import maps avoid. The feature was implemented in both Chromium and WebKit and landed in the HTML spec. It shipped in Chromium 127 and Safari 18 Beta after roughly two weeks of full-time work across seven calendar weeks.
Related posts
- Resilient Import Maps - Better Theme Development and Beyond
Shopify Engineering mediumAdeptShopify worked with browser vendors to change the HTML spec, Chromium and WebKit so import maps no longer break when JavaScript modules load before them or when a page has more than one map. Each document keeps a single global import map and a set of already-resolved module names. Each new map is merged in, dropping any rule that would change an already-resolved module or override an existing rule. The change ships in Chrome 133 and Safari 18.4, and es-module-shims 2.4.0+ polyfills it for older browsers. Shopify injects the polyfill on storefronts automatically, so themes and app blocks can now use hashed, immutably cached modules without load-order conflicts.
- Fixing Top-Level Await in Safari
WebKit mediumAdeptSafari 27 fixes long-standing top-level await bugs, such as spurious "accessed before initialization" errors and wrong import completion order, by rewriting WebKit's ES module loader from scratch. The old loader was a self-hosted JavaScript builtin based on the abandoned 2016 WHATWG Loader proposal, so it resolved concurrent dynamic imports of a still-evaluating async module too early. The new loader is native C++ translated directly from the ECMAScript spec's module algorithms, chosen for faster startup and more predictable performance. It was validated with Bun's collected test cases, a differential fuzzer comparing module-graph output against other engines, test262 and WPT.
- Bun v1.1.44
Bun mediumAdept
Bun v1.1.44 adds experimental HTML imports (behind --experimental-html) so Bun.serve() can bundle and serve frontend apps on demand alongside API routes, with no hot module reloading yet. It also adds xxHash32/64/3 to Bun.hash for fast non-cryptographic hashing, lets bun.lock and other JSONC files be read via import, and adds a bunx --no-install flag. The release fixes 43 bugs, including node:dns now passing over 90% of Node's tests, broader node:fs compatibility, S3 client fixes, private npm registry auth in .npmrc, and expect.extend regressions.
- Bun v1.2.5
Bun mediumAdept
Bun v1.2.5 fixes 75 bugs, adds 69 passing Node.js tests, and nearly rewrites its Node-API implementation, which now passes 98% of Node's js-native-api suite. The Node-API work gives each module its own napi_env, adds null-pointer error handling and detects module API versions. node:crypto Sign/Verify are reimplemented in C++ on BoringSSL (about 34x faster), and Hash/Hmac are now native. The release also adds Bun.CSRF, CSS modules, a Svelte plugin and a rewritten HMR system with import.meta.hot.accept, along with many node:net, timers and child_process compatibility fixes.
- Bun v0.7.1
Bun mediumAdept
Bun v0.7.1 makes ES Module loading 30%–250% faster by running its transpiler concurrently for import statements and dynamic imports, though CommonJS require is still sequential. Module resolution now happens only once, at runtime. The release also cuts vite dev startup on Linux by 90%, speeds up bun:sqlite row returns by 10%, and fixes getaddrinfo handling so private registries like Verdaccio work. Node.js compatibility fixes cover fs.watch thread usage, fs.stat truncation on large files, a GC bug in fs.readdir, and making the event loop wait for WebAssembly, Atomics and Web Crypto work, alongside new MessageChannel, fetch file: URLs and Promise.withResolvers support.