perf(ext): convert ext/ffi JS source to lazy-loaded script#33780
Merged
Conversation
fibibot
approved these changes
May 2, 2026
fibibot
left a comment
Contributor
There was a problem hiding this comment.
LGTM. Tiny 3-file change following the established lazy_loaded_js conversion pattern from #33760 and the already-merged ext/web counterparts:
ext/ffi/00_ffi.js: standard IIFE wrap ((function () { ... })()),globalThis.__bootstrapfor core/internals/primordials (matchingext/web/02_timers.js's established pattern),const { op_X } = core.opsfor ops destructuring,return { ... }in place ofexport { ... }. No cross-extension ESM imports, so nointernalssymbol bridges needed — the PR body's claim is verifiable from the diff.ext/ffi/lib.rs:esm = ["00_ffi.js"]→lazy_loaded_js = ["00_ffi.js"]. Right shape.runtime/js/90_deno_ns.js:import * as ffi from "ext:deno_ffi/00_ffi.js"→const ffi = core.loadExtScript("ext:deno_ffi/00_ffi.js"). Sole consumer migration.
Unlike #33779 where the IIFE wrapper shifted line numbers in ext/os/30_os.js and broke permissions_trace's pinned :43:10 assertion, 00_ffi.js doesn't appear on any stack-trace-pinning test fixtures, so the same line-shift hazard doesn't apply here.
CI
99/114 success at this head, 12 in flight, 2 failures both unrelated to this PR's substance:
test node_compat (2/3) debug windows-x86_64:parallel/test-dns-resolver-max-timeout.js: timeout1: 508, timeout2: 515— the same Windows DNS-timing flake that's hit ~half the daily PRs (millisecond-granular>assertion against OS scheduler jitter). Pre-existing.test specs (1/2) debug macos-aarch64:specs::upgrade::outfails on GitHub returning HTTP 502 ("Unicorn!") forhttps://github.com/denoland/deno/releases/download/v1.43.2/deno-aarch64-apple-darwin.zip. GitHub Releases infra hiccup, not deno code.
Neither is reproducible from substance.
Signed-off-by: Bartek Iwańczuk <[email protected]>
This was referenced May 2, 2026
This was referenced May 3, 2026
2 tasks
bartlomieju
added a commit
that referenced
this pull request
May 4, 2026
… scripts (#33817) - Convert `ext/process/40_process.js` from ESM to IIFE-wrapped lazy-loaded script (`lazy_loaded_js`) - Convert `ext/http/00_serve.ts`, `ext/http/01_http.js`, `ext/http/02_websocket.ts` from ESM to IIFE-wrapped lazy-loaded scripts - Update all consumers (`runtime/js/90_deno_ns.js`, `runtime/js/99_main.js`, `ext/node/polyfills/child_process.ts`, `ext/node/polyfills/internal/child_process.ts`) to use `core.loadExtScript()` instead of ESM imports - Replace `import.meta.log` calls with `internals.log` in `00_serve.ts` Follows the same pattern established in #33778, #33780, #33784, #33800, and #33801.
2 tasks
bartlomieju
added a commit
that referenced
this pull request
May 4, 2026
…ripts (#33818) ## Summary - Convert `ext/kv/01_db.ts` from ESM to IIFE-wrapped lazy-loaded script (`lazy_loaded_js`) - Convert `ext/webgpu/00_init.js` from ESM to IIFE-wrapped lazy-loaded script (`lazy_loaded_js`) - Update all consumers (`runtime/js/90_deno_ns.js`, `runtime/js/98_global_scope_shared.js`, `runtime/js/98_global_scope_window.js`, `runtime/js/98_global_scope_worker.js`) to use `core.loadExtScript()` instead of ESM imports - Replace `import.meta.log` call with `internals.log` in `01_db.ts` Follows the same pattern established in #33778, #33780, #33784, #33800, #33801, and #33817.
littledivy
pushed a commit
to crowlKats/deno
that referenced
this pull request
Jun 10, 2026
…33780) Follow-up to denoland#33760. Converts `ext/ffi/00_ffi.js` from ESM to an IIFE-wrapped lazy-loaded script (`lazy_loaded_js`). Signed-off-by: Bartek Iwańczuk <[email protected]>
littledivy
pushed a commit
to crowlKats/deno
that referenced
this pull request
Jun 10, 2026
… scripts (denoland#33817) - Convert `ext/process/40_process.js` from ESM to IIFE-wrapped lazy-loaded script (`lazy_loaded_js`) - Convert `ext/http/00_serve.ts`, `ext/http/01_http.js`, `ext/http/02_websocket.ts` from ESM to IIFE-wrapped lazy-loaded scripts - Update all consumers (`runtime/js/90_deno_ns.js`, `runtime/js/99_main.js`, `ext/node/polyfills/child_process.ts`, `ext/node/polyfills/internal/child_process.ts`) to use `core.loadExtScript()` instead of ESM imports - Replace `import.meta.log` calls with `internals.log` in `00_serve.ts` Follows the same pattern established in denoland#33778, denoland#33780, denoland#33784, denoland#33800, and denoland#33801.
littledivy
pushed a commit
to crowlKats/deno
that referenced
this pull request
Jun 10, 2026
…ripts (denoland#33818) ## Summary - Convert `ext/kv/01_db.ts` from ESM to IIFE-wrapped lazy-loaded script (`lazy_loaded_js`) - Convert `ext/webgpu/00_init.js` from ESM to IIFE-wrapped lazy-loaded script (`lazy_loaded_js`) - Update all consumers (`runtime/js/90_deno_ns.js`, `runtime/js/98_global_scope_shared.js`, `runtime/js/98_global_scope_window.js`, `runtime/js/98_global_scope_worker.js`) to use `core.loadExtScript()` instead of ESM imports - Replace `import.meta.log` call with `internals.log` in `01_db.ts` Follows the same pattern established in denoland#33778, denoland#33780, denoland#33784, denoland#33800, denoland#33801, and denoland#33817.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Follow-up to #33760. Converts
ext/ffi/00_ffi.jsfrom ESM to an IIFE-wrapped lazy-loaded script (lazy_loaded_js).No cross-extension ESM deps -- only uses
core.loadExtScriptfor already-convertedext/web.Test plan
cargo build --bin denosucceeds