Skip to content

Carry import attributes through the parser, printer, bundler and runtime; add the bytes loader - #40836

Open
robobun wants to merge 9 commits into
mainfrom
farm/27287e5a/import-attributes-end-to-end
Open

robobun wants to merge 9 commits into
mainfrom
farm/27287e5a/import-attributes-end-to-end

Conversation

@robobun

@robobun robobun commented Aug 28, 2026 •

Copy link
Copy Markdown
Collaborator

Problem

  • parse_path (src/js_parser/parse/mod.rs) reduced with { ... } to a loader and dropped the clause; the printer re-synthesized with { type } only for import under --target=bun. Other targets, --no-bundle and re-exports lost it (Node: ERR_IMPORT_ATTRIBUTE_MISSING), and non-type keys were dropped everywhere.
  • The bundler keyed modules on path text, so one file imported with two type values collapsed into one module with the first import's loader. Unknown type values (and bytes) were ignored, a newline before with was a syntax error, duplicate keys were accepted.

Fix

  • ImportRecord.attributes keeps the clause as written. The printer prints it (as with) on every import and re-export that stays in the output, for every target, and derives ModuleInfo FetchParameters from the type attribute as JSC's parser does.
  • The bundler keys the module graph on (path, attributes) (ImportRecord::module_graph_key), like esbuild and JSC's module map, on the plugin paths too. An unknown type is an error when the file is bundled; the runtime throws ERR_IMPORT_ATTRIBUTE_UNSUPPORTED. Duplicate keys are a parse error. Only assert keeps the no-newline rule.
  • New bytes loader: a Uint8Array of the file. Bundles inline base64 decoded by the __toBytes runtime helper; --compile embeds the raw bytes.
  • Verified: test/bundler/bundler_import_attributes.test.ts (32 cases, 29 fail on 1.4.1) and test/js/bun/import-attributes/import-attributes.test.ts. Also the transpiler, loader, plugin, compile, bundler, bake and esbuild suites.

Background

  • An import record is the parser's per-import entry; the bundler resolves it and the printer prints it. The runtime feeds the printed source to JSC, so JSC sees only what the printer keeps.
  • JSC keys its module map on (specifier, ScriptFetchParameters::Type): json is built in, any other type is host-defined and Bun maps it to a loader.
  • A lazy export is a non-JS module turned into export default <expr>. __toBytes is the first runtime helper called from one, so generate_code_for_lazy_export binds the call to the runtime's export.
Notes

Overlapping open PRs this supersedes in part: #37476 (bundler identity), #38407 (re-export loader), #33255 (unknown type). #28512 rejects unknown keys; this PR keeps them, as JSC does under BUN_JSC_ADDITIONS, so with { type: "json", custom: "x" } still loads. #38461 (splitting rewrites a dynamic import to a chunk but keeps its attributes) is a separate bug.

Decisions:

  • assert prints as with. No current engine accepts assert and rejects with.
  • Unknown non-type keys are kept verbatim and never error, in the bundler or the runtime.
  • type: "webassembly" maps to the wasm loader, so the attribute JSC reserves keeps loading .wasm files as before.
  • The dev server keeps path-only keys; its incremental graph is keyed by path. bunBakeGraph is left out of the key: it routes the import to the SSR graph, which has its own map, so react-dom/server stays one module there.
  • On the plugin onResolve fallback path the unknown-type check runs after the external check, like the direct path, so an external import keeps any type.
  • The metafile still synthesizes with.type from the loader (an existing test asserts it).
  • Compile mode serves an embedded bytes module through a wrapped CommonJS shim (readFileSync(__filename)), like the sqlite shim, so require("<bunfs path>") gets the array itself.
  • __toBytes reads Buffer and Uint8Array off globalThis. A free reference in runtime.js becomes a reserved name in every bundle, which renames user code that shadows it (lodash's var Buffer became Buffer2); test/bundler/bundler_bytecode_portable.test.ts caught that.
  • type: "macro" is exempt from the unknown-type error in the runtime as well as the bundler; a dynamic import(x, { with: { type: "macro" } }) loads the module as before.
  • require.extensions wrappers pass an empty type attribute; it counts as none.
  • RuntimeTranspilerCache version 27 -> 28.

Found while testing, handed off separately: export * from "./data.json" does not forward the JSON keys in bun build (no attributes involved).

Suites run with the debug build: transpiler.test.js, import-attributes.test.ts, bundler_loader, esbuild/loader, esbuild/default, esbuild/metafile, bundler_edgecase, bundler_bun, bundler_cjs, bundler_splitting, bundler_html, html-import-manifest, compile-asset-bunfs, bundler_compile (one pre-existing debug-only failure: HelloWorldWithProcessVersionsBun compares process.versions.bun to the release version), bundler_plugin, native-plugin, bake/dev/bundle, webkit-upgrade-3722912f, import-defer, macro-test, the resolve loader suites, the regression tests that mention import attributes, source-lints, bun-types.


[review] gate passed · iteration 1 · 43 files touched

fails on main (without fix)
ASAN without fix: 46 failed, 22 skipped
$ BUN_DEBUG_QUIET_LOGS=1 bun scripts/build.ts --profile=debug --quiet test "--reporter=junit" "--reporter-outfile=/tmp/mechgate.xml" test/bake/dev/bundle.test.ts test/bundler/bundler_import_attributes.test.ts test/bundler/transpiler/transpiler.test.js test/js/bun/import-attributes/import-attributes.test.ts
bun test v1.4.1 (65362b53b)

test/bundler/bundler_import_attributes.test.ts:
37 |       external: ["*"],
38 |       files: { "/entry.js": externalEntry },
39 |       onAfterBundle(api) {
40 |         const out = api.readFile("/out.js");
41 |         for (const line of bundledExternalOutput) {
42 |           expect(out).toContain(line);
                           ^
error: expect(received).toContain(expected)

Expected to contain: "from \"./y.json\" with { type: \"json\" };"
Received: "// @bun\n// entry.js\nimport a from \"./x.json\" with { type: \"json\" };\nimport { default as default2 } from \"./y.json\";\n\nexport * from \"./z.json\";\nimport * as ns from \"./n.json\";\nimport q from \"pkg\";\nimport\"./side-effect.js\" with { type: \"js\" };\nvar c = import(\"./w.json\", { with: { type: \"json\" } });\nconsole.log(a, q, c);\nexport {\n  default2 as b,\n  ns\n};
... (truncated)

release without fix: 1 failed, 22 skipped
bun test v1.4.1-canary.1 (3f486e69f)

test/bundler/bundler_import_attributes.test.ts:
(pass) bundler > import-attributes/external-keeps-attributes-bun [20.10ms]
(pass) bundler > import-attributes/no-bundle-keeps-attributes-bun [9.34ms]
(pass) bundler > import-attributes/minified-external-bun [4.16ms]
(pass) bundler > import-attributes/external-keeps-attributes-node [4.89ms]
(pass) bundler > import-attributes/no-bundle-keeps-attributes-node [9.71ms]
(pass) bundler > import-attributes/minified-external-node [3.76ms]
(pass) bundler > import-attributes/external-keeps-attributes-browser [2.75ms]
(pass) bundler > import-attributes/no-bundle-keeps-attributes-browser [8.86ms]
(pass) bundler > import-attributes/minified-external-browser [4.38ms]
(pass) bundler > import-attributes/assert-prints-as-with [3.16ms]
(pass) bundler > import-attributes/newline-before-with [2.87ms]
(pass) bundler > import-attributes/duplicate-key-is-an-error [2.41ms]
(pass) bundler > import-attributes/same-path-different-type-text-then-json [14.96ms]
(pass) bundler > import-attributes/same-path-different-type-json-then-text [14.67ms]
(pass) bundler > import-attributes/same-path-different-type-across-
... (truncated)
passes on PR (with fix)
ASAN with fix: 22 skipped
$ BUN_DEBUG_QUIET_LOGS=1 bun scripts/build.ts --profile=debug --quiet test "--reporter=junit" "--reporter-outfile=/tmp/mechgate.xml" test/bake/dev/bundle.test.ts test/bundler/bundler_import_attributes.test.ts test/bundler/transpiler/transpiler.test.js test/js/bun/import-attributes/import-attributes.test.ts
bun test v1.4.1 (65362b53b)

test/bundler/bundler_import_attributes.test.ts:
(pass) bundler > import-attributes/external-keeps-attributes-bun [582.41ms]
(pass) bundler > import-attributes/no-bundle-keeps-attributes-bun [244.14ms]
(pass) bundler > import-attributes/minified-external-bun [111.65ms]
(pass) bundler > import-attributes/external-keeps-attributes-node [101.36ms]
(pass) bundler > import-attributes/no-bundle-keeps-attributes-node [235.87ms]
(pass) bundler > import-attributes/minified-external-node [87.37ms]
(pass) bundler > import-attributes/external-keeps-attributes-browser [116.45ms]
(pass) bundler > import-attributes/no-bundle-keeps-attributes-browser [235.31ms]
(pass) bundler > import-attributes/minified-external-browser [87.67ms]
(pass) bundler > import-attributes/assert-prints-as-with [94.46ms]
(pass) bundler > import-attributes/newline-before-with [
... (truncated)

release with fix: 22 skipped
$ bun scripts/build.ts --profile=release
[configured] bun-profile → bun (stripped) in 601ms (unchanged)
ninja: Entering directory `/workspace/bun/build/release'
[1/126] gen ErrorCode+*.h
[2/126] gen generated_host_exports.rs
generated_host_exports.rs: 122 exports (host=5, lazy=10, generic=107, rust=0); 243 extern-C blocks audited
[3/126] gen cpp.rs (cppbind)
[4/126] gen JS modules (bundle-modules)
Preprocess modules (7735ms)
Bundle modules (58ms)
Postprocesss modules (131ms)
Bundle Functions (725ms)
Generate Code (30ms)

[8.69s] Bundled "src/js" for production
  2594 kb
  197 internal modules
  13 native modules
  50 internal functions across 16 files
[4/125] cargo bun_runtime → libbun_runtime.a
�[1m�[92m   Compiling�[0m bun_core v0.0.0 (/workspace/bun/src/bun_core)
�[1m�[92m   Compiling�[0m bun_errno v0.0.0 (/workspace/bun/src/errno)
�[1m�[92m   Compiling�[0m bun_ptr v0.0.0 (/workspace/bun/src/ptr)
�[1m�[92m   Compiling�[0m bun_boringssl_sys v0.0.0 (/workspace/bun/src/boringssl_sys)
�[1m�[92m   Compiling�[0m bun_safety v0.0.0 (/workspace/bun/src/safety)
�[1m�[92m   Compiling�[0m bun_base64 v0.0.0 (/workspace/bun/src/base64)
�[1m�[92m   Compiling�[0m bun_cares_s
... (truncated)
diff hotspot
docs/bundler/loaders.mdx                           |  17 +
 docs/runtime/file-types.mdx                        |  11 +
 .../bun-native-bundler-plugin-api/bundler_plugin.h |   3 +-
 packages/bun-types/bun.d.ts                        |   1 +
 src/ast/e.rs                                       |  39 +-
 src/ast/import_record.rs                           |  46 ++
 src/ast/lib.rs                                     |   4 +-
 src/ast/loader.rs                                  |  15 +-
 src/ast/runtime.rs                                 |  14 +-
 src/bundler/AstBuilder.rs                          |   1 +
 src/bundler/HTMLScanner.rs                         |   1 +
 src/bundler/LinkerContext.rs                       |   1 +
 src/bundler/ParseTask.rs                           |  49 +++
 src/bundler/bundle_v2.rs                           | 215 ++++++++--
 .../linker_context/generateCodeForLazyExport.rs    |  48 +++
 src/bundler/linker_context/postProcessJSChunk.rs   |   1 +
 .../linker_context/prepareCssAstsForChunk.rs       |   2 +
 src/bundler/transpiler.rs                          |   4 +-
 src/bundler_jsc/options_jsc.rs                     |   1 +
 src/codegen/replacements.ts                        |   1 +
 src/css/css_parser.rs                              |   2 +
 src/js_parser/p.rs                                 |  35 +-
 src/js_parser/parse/mod.rs                         | 146 +++----
 src/js_parser/parse/parse_stmt.rs                  |  19 +-
 src/js_parser/parser.rs                            |   5 +
 src/js_parser/visit/visit_expr.rs                  |   6 +
 src/js_printer/lib.rs                              | 181 +++-----
 src/jsc/RuntimeTranspilerCache.rs                  |   3 +-
 src/jsc/bindings/ErrorCode.ts                      |   1 +
 src/jsc/bindings/headers-handwritten.h             |   1 +
 src/options_types/bundle_enums.rs                  |   3 +
 src/options_types/schema.rs                        |   2 +
 src/runtime.js              
... (truncated)

gate history · 4 passed · 0 rejected · iteration 1

evidence per changed file
file                                                     reads  edits  tests
docs/bundler/loaders.mdx                                     0      0      0
docs/runtime/file-types.mdx                                  0      0      0
packages/bun-native-bundler-plugin-api/bundler_plugin.h      0      0      0
packages/bun-types/bun.d.ts                                  0      0      0
src/ast/e.rs                                                 1      2      0
src/ast/import_record.rs                                     1      3      0
src/ast/lib.rs                                               1      2      0
src/ast/loader.rs                                            1      0      0
src/ast/runtime.rs                                           0      0      0
src/bundler/AstBuilder.rs                                    0      0      0
src/bundler/HTMLScanner.rs                                   0      0      0
src/bundler/LinkerContext.rs                                 0      0      0
src/bundler/ParseTask.rs                                     0      0      0
src/bundler/bundle_v2.rs                                     6      0      0
src/bundler/linker_context/generateCodeForLazyExport.rs      1      2      0
src/bundler/linker_context/postProcessJSChunk.rs             0      0      0
(+ 27 more files)

The parser keeps the whole `with { ... }` clause on the import record
instead of reducing it to a loader. The printer prints it as written on
every import, `export * from` and `export {} from` that stays in the
output, for every target. The bundler keys the module graph on
(path, attributes), so one file imported with two `type` values is two
modules, and reports a `type` that names no loader. The runtime reports
the same case with ERR_IMPORT_ATTRIBUTE_UNSUPPORTED.

`with` is a keyword, so a newline before it is allowed; `assert` keeps
the no-newline rule. A duplicate attribute key is a syntax error.

Adds the `bytes` loader: `with { type: "bytes" }` gives the file's bytes
as a Uint8Array. The bundler inlines them as base64 decoded by the new
`__toBytes` runtime helper; a standalone executable embeds the raw bytes.
@coderabbitai

coderabbitai Bot commented Aug 28, 2026 •

Copy link
Copy Markdown
Contributor

Warning

Review limit reached

  • Run on-demand review

On-demand reviews are free for the next 23 days. After that, they cost $0.25 per reviewed file.

Or wait 13 seconds for your next included review.

View limit details

Limit details: You’ve used all 5 included reviews currently available.

Learn how review limits work.

Review configuration:

⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: ASSERTIVE

Plan: Pro

Run ID: 37830ce5-f595-4fa6-9b2f-a4e228e25cbe

📥 Commits

Reviewing files that changed from the base of the PR and between d578a8c and cb28fb7.

📒 Files selected for processing (43)
  • docs/bundler/loaders.mdx
  • docs/runtime/file-types.mdx
  • packages/bun-native-bundler-plugin-api/bundler_plugin.h
  • packages/bun-types/bun.d.ts
  • src/ast/e.rs
  • src/ast/import_record.rs
  • src/ast/lib.rs
  • src/ast/loader.rs
  • src/ast/runtime.rs
  • src/bundler/AstBuilder.rs
  • src/bundler/HTMLScanner.rs
  • src/bundler/LinkerContext.rs
  • src/bundler/ParseTask.rs
  • src/bundler/bundle_v2.rs
  • src/bundler/linker_context/generateCodeForLazyExport.rs
  • src/bundler/linker_context/postProcessJSChunk.rs
  • src/bundler/linker_context/prepareCssAstsForChunk.rs
  • src/bundler/transpiler.rs
  • src/bundler_jsc/options_jsc.rs
  • src/codegen/replacements.ts
  • src/css/css_parser.rs
  • src/js_parser/p.rs
  • src/js_parser/parse/mod.rs
  • src/js_parser/parse/parse_stmt.rs
  • src/js_parser/parser.rs
  • src/js_parser/visit/visit_expr.rs
  • src/js_printer/lib.rs
  • src/jsc/RuntimeTranspilerCache.rs
  • src/jsc/bindings/ErrorCode.ts
  • src/jsc/bindings/headers-handwritten.h
  • src/options_types/bundle_enums.rs
  • src/options_types/schema.rs
  • src/runtime.js
  • src/runtime/api/JSBundler.rs
  • src/runtime/cli/Arguments.rs
  • src/runtime/cli/test/parallel/runner.rs
  • src/runtime/error.rs
  • src/runtime/jsc_hooks.rs
  • test/bake/dev/bundle.test.ts
  • test/bundler/bundler_import_attributes.test.ts
  • test/bundler/expectBundled.ts
  • test/bundler/transpiler/transpiler.test.js
  • test/js/bun/import-attributes/import-attributes.test.ts

Comment @coderabbitai help to get the list of available commands.

@robobun

robobun commented Aug 28, 2026 •

Copy link
Copy Markdown
Collaborator Author
Updated 12:41 PM PT - Aug 28th, 2026

@robobun, your commit cb28fb7 is building: #107950

require.extensions wrappers call Bun__transpileFile with an empty string
for the type attribute, which the new unknown-type check rejected.
Comment thread src/ast/e.rs Outdated
Comment thread src/ast/e.rs Outdated
Comment thread src/ast/import_record.rs Outdated
Comment thread src/ast/import_record.rs Outdated
Comment thread src/ast/import_record.rs Outdated
Comment thread src/ast/loader.rs Outdated
Comment thread src/bundler/ParseTask.rs Outdated
Comment thread src/bundler/bundle_v2.rs Outdated
Comment thread src/bundler/bundle_v2.rs Outdated
Comment thread src/bundler/bundle_v2.rs Outdated
Comment thread src/bundler/linker_context/generateCodeForLazyExport.rs Outdated
Comment thread src/bundler/linker_context/generateCodeForLazyExport.rs Outdated
Comment thread src/js_parser/parse/mod.rs Outdated
Comment thread src/js_parser/parse/mod.rs Outdated
Comment thread src/js_printer/lib.rs Outdated
Comment thread src/js_printer/lib.rs Outdated
Comment thread src/jsc/RuntimeTranspilerCache.rs Outdated
Comment thread src/runtime/jsc_hooks.rs Outdated
Comment thread src/runtime/jsc_hooks.rs Outdated
Comment thread src/runtime/jsc_hooks.rs Outdated
Comment thread src/runtime/jsc_hooks.rs Outdated
Comment thread src/bundler/ParseTask.rs Outdated

@claude claude Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Additional findings (outside the current diff — GitHub can't attach inline comments there):

  • 🟣 src/bundler/bundle_v2.rs — Plugin onResolve success path still keys path_to_source_index_map on path.text alone, ignoring import attributes (pre-existing — partial fix)

    Extended reasoning...

    The PR's stated fix is that the bundler now keys the module graph on (path, attributes) via ImportRecord::module_graph_key, so import a from './x.json' with { type: 'text' } and import b from './x.json' with { type: 'json' } become distinct modules. Every direct-resolve/file-map path in resolve_import_records and enqueue_on_resolve_plugins was updated to compute module_key with key_attributes. However, when a JS plugin's onResolve hook returns a Success result, the handler at ~line 4929 still does path_to_source_index_map(...).get_or_put(path.text) with the raw resolved path and no attributes — MiniImportRecord (line 1062) does not carry attributes at all, so the callback has nothing to key on. Two imports of the same file with different with { type: ... } attributes that both flow through a matching onResolve plugin therefore collapse to a single source index and the first import's loader wins — the exact bug the PR fixes on the non-plugin path. Relative to base this path behaves the same as before, so it is a leftover site of the class the PR is…

    Verification: pre-existing — partial fix. At src/bundler/bundle_v2.rs:4926-4930 the plugin onResolve Success handler still keys the module map on the raw path: let existing = this .path_to_source_index_map(resolve.import_record.original_target) .get_or_put(path.text) .expect("oom"); Every sibling insert/lookup site in this file was migrated to `ImportRecord::module_graph_key(path.text,…

  • 🟣 src/bundler/bundle_v2.rs — Plugin fallback path (run_resolver) skips the new unknown-type check, so with { type: "nope" } silently falls back to the extension loader when any onResolve filter matched (pre-existing — partial fix)

    Extended reasoning...

    The PR adds has_unsupported_type_attribute and calls it from resolve_import_records at lines 6434 and 6785 so that a bundled import with an unrecognised type attribute fails the build. But an import whose specifier matches a registered onResolve filter takes the plugin dispatch at line 6363 (enqueue_on_resolve_plugin_if_needed returns true → continue), never reaching either check. When the plugin's callback returns undefined, the NoMatch branch (line 4850) calls run_resolver, which resolves the file and picks a loader at lines 2639-2651: record.loader is None for an unknown type (parse_path only sets it when Loader::from_string matched), so it falls through to path.loader(&transpiler.options.loaders).unwrap_or(Loader::File). Concretely, with a build that registers onResolve({ filter: /\.json$/ }, () => undefined) and a source containing import x from "./data.json" with { type: "nope" }, the bundle succeeds and loads data.json with the JSON loader — whereas the identical build without the plugin now errors with `Importing with a type attribute of…

    Verification: pre-existing — partial fix. The new has_unsupported_type_attribute guard (bundle_v2.rs:6171-6196) is invoked only from resolve_import_records at :6434 and :6785. Both call sites are downstream of the plugin dispatch at :6363-6371: when enqueue_on_resolve_plugin_if_needed finds plugins.has_any_matches(...) (:5814) it dispatches and returns true, and the loop continues before either…

Comment thread src/runtime/jsc_hooks.rs Outdated

@claude claude Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code review found no issues

No high-confidence issues detected in this change.

…ead decoder globals off globalThis

The onResolve success path keyed the module map on the path alone and
took the loader from the extension, and the no-match fallback skipped
the unknown-type check. The runtime now exempts type: "macro" like the
bundler. __toBytes reads Buffer and Uint8Array off globalThis so they do
not become reserved names that rename user code shadowing them.
Comment thread src/bundler/bundle_v2.rs Outdated
Comment thread src/runtime.js Outdated
…) and require() with an unknown type, and the dev server re-export
@robobun

robobun commented Aug 28, 2026

Copy link
Copy Markdown
Collaborator Author

Dedupe pass against the four older import attribute PRs, run on a debug build of this branch (head 396831bdcf before the test commit below). This PR's own suites are green here: bundler_import_attributes, import-attributes, bundler_loader, esbuild/loader.

Coverage of the older PRs' test additions:

  • parser: honor the type attribute on export ... from statements #38407 (type attribute on export ... from): 12 of 14 cases pass as written. The two others only check a parser message for a named re-export that a text or sqlite module does not provide. Closed in favor of this PR.
  • Reject unknown import attribute type values #33255 (unknown type value): static import, import(), require(path, { type }) and Bun.build all reject with ERR_IMPORT_ATTRIBUTE_UNSUPPORTED. Closed in favor of this PR. Two differences for the record: that PR used Node's message format, Import attribute "type" with value "x" is not supported, and treated type: "webassembly" as unsupported.
  • bundler: bundle a file once per requested loader instead of once per path #37476 (bundler keyed on the requested loader): 8 of 9 cases pass after 1f731b7675. The one that does not is an HTML <link rel="manifest"> asset reference and a script's JSON import of the same file: neither carries an attribute, so they still share one module and the script gets the asset path. Left open with a note to rebase onto this PR and keep only that part.
  • Throw ERR_IMPORT_ATTRIBUTE_UNSUPPORTED for unsupported import attributes #28512 (unknown attribute keys): a design conflict, not a duplicate. That PR rejects any key other than type with ERR_IMPORT_ATTRIBUTE_UNSUPPORTED, as Node does (Node 26 throws for with { type: "json", notARealAssertion: "value" }). This PR keeps unknown keys and loads. A maintainer needs to pick one. Left open with the same note.

Commit 3f486e69f7 adds the cases from those PRs that this PR did not have yet: the cross-module and self-import identity cases and the embedded sqlite re-export in bundler_import_attributes.test.ts, the sqlite re-export, bun test --isolate and import()/require() unknown type cases in import-attributes.test.ts, and the dev server re-export in bake/dev/bundle.test.ts. All of them fail on the released bun and pass on this branch.

Comment thread src/bundler/bundle_v2.rs
Comment thread src/bundler/bundle_v2.rs Outdated
Comment thread src/ast/import_record.rs Outdated
@robobun

robobun commented Aug 28, 2026

Copy link
Copy Markdown
Collaborator Author

CI on cb28fb7: every lane passes except darwin x64, where test/js/web/url/url.test.ts ("special-scheme hosts use the Unicode 16 IDNA table") fails. That test fails the same way on main (build 107791) and is unrelated to this change; it is reported separately. The remaining failures in the run were retries that passed.

@claude claude Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code review found no issues

No high-confidence issues detected in this change.

Jarred-Sumner pushed a commit that referenced this pull request Sep 14, 2026
… under --isolate (#42679)

Fixes #33904. Re-lands #33905. Same printer change as @alii's 0de84ef
on #35605, carried alone to land first.

### Problem
- A runtime plugin resolves `./data.bar?custom` into namespace `custom`.
`bun test --isolate` and `--parallel` never run the namespaced `onLoad`:
`Expected: "FROM_PLUGIN" Received: "<abs>/data.bar"`. Debug builds stop
with `error: Imports different between parseFromSourceCode and
fallbackParse`.
- In `src/js_printer/lib.rs`, `print_import_record_path` prints that
record as `"custom:/abs/data.bar"`, but the three `ModuleInfo` recording
sites (`import`, `export {} from`, `export * from`) interned only
`path.text`. The module record asked for `/abs/data.bar`.

### Fix
- `printed_namespace()` decides whether a record prints as
`namespace:path`. `print_import_record_path` and the new
`ModuleInfo::str_for_import_record` both call it. The three recording
sites use the latter.
- The transpiler cache version goes from 32 to 33. The on-disk cache
stores the same record, so an older entry brings the bug back.
- Verified: three new cases in `test/cli/test/isolation.test.ts`
(`--isolate`, `--parallel`, on-disk cache) fail on 1.4.3-canary. Also
ran `test/js/bun/plugin/`.
- Self-reviewed: 4 concerns raised, 3 addressed. Not done: keep
plugin-rewritten files out of the on-disk cache, an older separate bug
(Notes).

### Background
- `--isolate` gives each test file a fresh global. Bun builds the JSC
module record from `ModuleInfo`, a table the printer fills, with no
second parse.
- The runtime linker (`src/bundler/linker.rs:462`) runs plugin
`onResolve` before the print, stores the answer as `path.text` plus
`path.namespace`, and sets `PRINT_NAMESPACE_IN_PATH`.
- A source specifier `virt:thing` breaks the same way when namespace
`virt` has an `onResolve`. With only an `onLoad` it works.

<details><summary>Notes</summary>

**Related PRs**
- #33905 was the first version of this fix. A stale-PR cleanup closed it
on 2026-09-13 with no review verdict.
- #35605 (open, conflicts with main) attaches `ModuleInfo` to every ESM
transpile, not only under `--isolate`. With it, this bug reaches plain
`bun run`. Its commit 0de84ef makes the same change to the printer
(one predicate, the same three sites). This PR does not depend on #35605
and does not change when `ModuleInfo` is built. Whichever lands second
keeps one helper.
- #40836 (open) rewrites the same three recording sites for import
attributes and still interns `path.text` there. It has to call
`str_for_import_record` after a rebase.

**Which plugins were affected**
- The trigger is the linker rewrite, not the `?query`. The record breaks
when the namespaced module cannot be found again from the bare
`path.text`.
- `./data.bar?custom` with an `onResolve` that strips the query and sets
a namespace: broken. This is the issue's case.
- `virt:thing` in source with an `onResolve` for namespace `virt`:
broken (`Cannot find package 'resolved-other'` in the new test). This is
the esbuild-style virtual module pattern.
- `./data.bar` with `onResolve({ filter: /\.bar$/ })` into a namespace:
worked by accident. The runtime resolve of the bare path matched the
same `onResolve` again.
- A namespaced specifier with only an `onLoad`: worked. The linker does
not rewrite the record, so `path.text` keeps the prefix.
- `onResolve` with no namespace (a plain redirect): worked, and still
takes the `None` arm of `printed_namespace`. The new test keeps one such
import.

**Scope of the change**
- `request_module` and `request_module_with_phase` have three callers in
the printer. All three are changed. The `require()` and `import()`
printers also call `print_import_record_path`, but they add nothing to
the module record.
- Only `src/bundler/linker.rs:472` sets `PRINT_NAMESPACE_IN_PATH`, and
only the runtime transpile path (`src/runtime/jsc_hooks.rs`) reaches it
with a `ModuleInfo`. The bundler and `bun build --compile` never set the
flag.

**On-disk transpiler cache**
- Stale entry check: ran the issue's repro with a test file above the 4
KiB cache floor and `BUN_RUNTIME_TRANSPILER_CACHE_PATH` set. The `.pile`
entry from 1.4.3-canary holds `custom:/abs/data.bar` in the output and
`/abs/data.bar` in the ESM record, and the second run fails from the
cache. The cache file name is the input hash only, so a fixed build
reads that entry unless the version changes. Version 22 was bumped for
the same reason.
- The third new test runs the fixture cold and warm against a private
cache directory, with one module padded past 4 KiB. It covers the record
round trip through the cache entry.
- Not changed here: the on-disk cache stores output that holds a
plugin's link-time `onResolve` answer, under a key made from the
importing file's content. If the plugin later answers differently, the
old answer is served until the importing file changes. This is
independent of `--isolate` and older than this bug. One line after the
rewrite in `src/bundler/linker.rs` (`result.runtime_transpiler_cache =
None`) would stop it. `parse_entry.rs` already drops the cache in a like
case, when it rewrites `@jest/globals` to `bun:test`. The cost is a
transpile on every run for each file that a resolve plugin touches, for
example every importer of a path alias. That trade needs a maintainer's
call, so it is left for a separate PR.

**Self-review**
1. The PR body did not name #35605 and #40836, and said a source-written
`custom:foo` was never affected. Fixed above.
2. No test for a namespace that is already in the source. Added the
`virt:` imports.
3. The cache version bump was checked by hand only. Added the cold and
warm cache test.
4. Keep plugin-rewritten output out of the on-disk cache. Not done, see
above.

**Tests**
- The new cases fail on the unfixed release build with `Cannot find
package 'resolved-other'` (first error) and `SyntaxError: Export named
'named' not found in module '<dir>/reexport-clause.ts'`. The same
fixture passes there without `--isolate`.
- Suites run with the debug build: `test/cli/test/isolation.test.ts` (39
pass), `test/js/bun/plugin/` (48 pass),
`test/cli/run/transpiler-cache.test.ts`,
`test/regression/issue/30887.test.ts`,
`test/js/bun/typescript/type-export.test.ts`,
`test/cli/inspect/debugger-buntranspiledmodule.test.ts`. Two cases in
the last four (`--drop invalidates cache`, one `--compile` case) hit the
5 s default timeout on the local debug build and pass with a longer
timeout.

</details>

<!-- robobun:evidence:begin -->

---

**[human-review]** gate passed · iteration 0 · 3 files touched

<details><summary>fails on main (without fix)</summary>

```console
ASAN without fix: 3 FAILED
$ BUN_DEBUG_QUIET_LOGS=1 bun scripts/build.ts --profile=debug --quiet test "--reporter=junit" "--reporter-outfile=/tmp/pr_gate.xml" test/cli/test/isolation.test.ts
bun test v1.4.3 (b993710)

test/cli/test/isolation.test.ts:
(pass) bun test --isolate > without --isolate, leaked global is visible to next file [430.63ms]
(pass) bun test --isolate > with --isolate, each file gets a fresh global [483.42ms]
(pass) bun test --isolate > without --isolate, --preload still runs once (regression) [282.91ms]
(pass) bun test --isolate > with --isolate, --preload re-runs in each file's fresh global [448.63ms]
(pass) bun test --isolate > with --isolate, module state is not shared between files [379.00ms]
(pass) bun test --isolate > with --isolate, a file's process.chdir() is undone before the next file [1257.31ms]
(pass) bun test --isolate > with --isolate, a file's process.env writes with native side effects are undone before the next file [1568.05ms]
439 |     using dir = tempDir("isolate-plugin-namespace", pluginNamespaceFixture);
440 |     const { stderr, exitCode } = await runTests(String(dir), args, ["./a.test.ts", "./b.test.ts"], {
441 |       ...bunEnv,
442 |       ...en
... (truncated)

release without fix: 3 FAILED
bun test v1.4.3-canary.1 (b993710)

test/cli/test/isolation.test.ts:
439 |     using dir = tempDir("isolate-plugin-namespace", pluginNamespaceFixture);
440 |     const { stderr, exitCode } = await runTests(String(dir), args, ["./a.test.ts", "./b.test.ts"], {
441 |       ...bunEnv,
442 |       ...env,
443 |     });
444 |     expect(normalizeBunSnapshot(stderr, dir)).toContain("2 pass");
                                                    ^
error: expect(received).toContain(expected)

Expected to contain: "2 pass"
Received: "a.test.ts:\n\n# Unhandled error between tests\n-------------------------------\nerror: Cannot find package 'resolved-other' from '<dir>/a.test.ts'\n-------------------------------\n\n\nb.test.ts:\n\n# Unhandled error between tests\n-------------------------------\nerror: Cannot find package 'resolved-other' from '<dir>/b.test.ts'\n-------------------------------\n\n\n 0 pass\n 2 fail\n 2 errors\nRan 2 tests across 2 files."

      at <anonymous> (/workspace/bun/test/cli/test/isolation.test.ts:444:47)
(pass) bun test --isolate > without --isolate, leaked global is visible to next file [26.77ms]
(pass) bun test --isolate > with --isolate, --preloa
... (truncated)
```

</details>

<details><summary>passes on PR (with fix)</summary>

```console
ASAN with fix: all passed
$ BUN_DEBUG_QUIET_LOGS=1 bun scripts/build.ts --profile=debug --quiet test "--reporter=junit" "--reporter-outfile=/tmp/pr_gate.xml" test/cli/test/isolation.test.ts
bun test v1.4.3 (b993710)

test/cli/test/isolation.test.ts:
(pass) bun test --isolate > with --isolate, each file gets a fresh global [352.05ms]
(pass) bun test --isolate > without --isolate, leaked global is visible to next file [439.29ms]
(pass) bun test --isolate > without --isolate, --preload still runs once (regression) [297.02ms]
(pass) bun test --isolate > with --isolate, --preload re-runs in each file's fresh global [336.20ms]
(pass) bun test --isolate > with --isolate, module state is not shared between files [371.07ms]
(pass) bun test --isolate > with --isolate, a file's process.env writes with native side effects are undone before the next file [1392.12ms]
(pass) bun test --isolate > with --isolate, a file's process.chdir() is undone before the next file [1461.43ms]
(pass) bun test --isolate > cached module records keep the namespace a plugin onResolve gives an import (--isolate) [542.79ms]
(pass) bun test --isolate > with --isolate, cached module records keep short, Latin-1 and UTF-16 names 
... (truncated)

release with fix: all passed
$ bun scripts/build.ts --profile=release
[configured] bun-profile → bun (stripped)
  target       linux-x64-gnu
  build type   Release
  build dir    ./build/release
  revision     68e0e0b
  features     baseline

23 deps, 131 codegen, 1176 objects in 689ms

ninja: Entering directory `/workspace/bun/build/release'
[1/1248] install /workspace/bun
bun install v1.4.3-canary.1 (b993710)

Checked 22 installs across 61 packages (no changes) [7.00ms]
[2/1248] gen ErrorCode+*.h
[3/1248] install /workspace/bun/packages/bun-error
bun install v1.4.3-canary.1 (b993710)

Checked 1 install across 2 packages (no changes) [1.00ms]
[4/1248] gen bindgenv2
[5/1248] install /workspace/bun/src/node-fallbacks
bun install v1.4.3-canary.1 (b993710)

Checked 111 installs across 104 packages (no changes) [4.00ms]
[6/1248] gen node-fallbacks/react-refresh.js
Bundled 1 module in 4ms

  react-refresh.js  4.81 KB  (entry point)

[7/1248] fetch zlib
[zlib] up to date
[8/1248] fetch tinycc
[tinycc] up to date
[9/1247] fetch libjpeg-turbo
[libjpeg-turbo] up to date
[10/1247] gen bake.{client,server,error}.js
-> bake.client.js, bake.server.js, bake.error.js
[11/1247] gen .bind.ts → Gene
... (truncated)
```

</details>

<details><summary>diff hotspot</summary>

```
src/js_printer/lib.rs             |  51 +++++++++--------
 src/jsc/RuntimeTranspilerCache.rs |   5 +-
 test/cli/test/isolation.test.ts   | 116 ++++++++++++++++++++++++++++++++++++++
 3 files changed, 149 insertions(+), 23 deletions(-)
```

</details>

**gate history** · 1 passed · 0 rejected · iteration 0

<details><summary>evidence per changed file</summary>

```
file                               reads  edits  tests
src/js_printer/lib.rs                  6      5     23
src/jsc/RuntimeTranspilerCache.rs      2      1     23
test/cli/test/isolation.test.ts        4      3     23
```

</details>

<!-- robobun:evidence:end -->

Co-authored-by: Alistair Smith <hi@alistair.sh>
@PixelHabits

Copy link
Copy Markdown

@robobun

Production use case for the bytes loader.

We run a nitro server bundle on Vercel's Bun runtime and bun test on the same modules. The parsers load web-tree-sitter and two
grammar .wasm files. nitro 3.0.260903-beta accepts import x from "./f.wasm" with { type: "bytes" } in the bundle. Bun
1.4.3-canary returns a string for the same import, because an unknown type falls back to the text loader with no error.

So we generate a 435 KB module of base64 strings and commit it, with a regen hook and a drift test. This PR removes all of that.
The ERR_IMPORT_ATTRIBUTE_UNSUPPORTED change matters too. A silent string is worse than a missing loader.

#41834 now carries the module-map part alone. Could the bytes loader and the unknown-type error land the same way, on top of
#41834?

usrbinkat pushed a commit to usrbinkat/bun that referenced this pull request Sep 15, 2026
… under --isolate (oven-sh#42679)

Fixes oven-sh#33904. Re-lands oven-sh#33905. Same printer change as @alii's 0de84ef
on oven-sh#35605, carried alone to land first.

### Problem
- A runtime plugin resolves `./data.bar?custom` into namespace `custom`.
`bun test --isolate` and `--parallel` never run the namespaced `onLoad`:
`Expected: "FROM_PLUGIN" Received: "<abs>/data.bar"`. Debug builds stop
with `error: Imports different between parseFromSourceCode and
fallbackParse`.
- In `src/js_printer/lib.rs`, `print_import_record_path` prints that
record as `"custom:/abs/data.bar"`, but the three `ModuleInfo` recording
sites (`import`, `export {} from`, `export * from`) interned only
`path.text`. The module record asked for `/abs/data.bar`.

### Fix
- `printed_namespace()` decides whether a record prints as
`namespace:path`. `print_import_record_path` and the new
`ModuleInfo::str_for_import_record` both call it. The three recording
sites use the latter.
- The transpiler cache version goes from 32 to 33. The on-disk cache
stores the same record, so an older entry brings the bug back.
- Verified: three new cases in `test/cli/test/isolation.test.ts`
(`--isolate`, `--parallel`, on-disk cache) fail on 1.4.3-canary. Also
ran `test/js/bun/plugin/`.
- Self-reviewed: 4 concerns raised, 3 addressed. Not done: keep
plugin-rewritten files out of the on-disk cache, an older separate bug
(Notes).

### Background
- `--isolate` gives each test file a fresh global. Bun builds the JSC
module record from `ModuleInfo`, a table the printer fills, with no
second parse.
- The runtime linker (`src/bundler/linker.rs:462`) runs plugin
`onResolve` before the print, stores the answer as `path.text` plus
`path.namespace`, and sets `PRINT_NAMESPACE_IN_PATH`.
- A source specifier `virt:thing` breaks the same way when namespace
`virt` has an `onResolve`. With only an `onLoad` it works.

<details><summary>Notes</summary>

**Related PRs**
- oven-sh#33905 was the first version of this fix. A stale-PR cleanup closed it
on 2026-09-13 with no review verdict.
- oven-sh#35605 (open, conflicts with main) attaches `ModuleInfo` to every ESM
transpile, not only under `--isolate`. With it, this bug reaches plain
`bun run`. Its commit 0de84ef makes the same change to the printer
(one predicate, the same three sites). This PR does not depend on oven-sh#35605
and does not change when `ModuleInfo` is built. Whichever lands second
keeps one helper.
- oven-sh#40836 (open) rewrites the same three recording sites for import
attributes and still interns `path.text` there. It has to call
`str_for_import_record` after a rebase.

**Which plugins were affected**
- The trigger is the linker rewrite, not the `?query`. The record breaks
when the namespaced module cannot be found again from the bare
`path.text`.
- `./data.bar?custom` with an `onResolve` that strips the query and sets
a namespace: broken. This is the issue's case.
- `virt:thing` in source with an `onResolve` for namespace `virt`:
broken (`Cannot find package 'resolved-other'` in the new test). This is
the esbuild-style virtual module pattern.
- `./data.bar` with `onResolve({ filter: /\.bar$/ })` into a namespace:
worked by accident. The runtime resolve of the bare path matched the
same `onResolve` again.
- A namespaced specifier with only an `onLoad`: worked. The linker does
not rewrite the record, so `path.text` keeps the prefix.
- `onResolve` with no namespace (a plain redirect): worked, and still
takes the `None` arm of `printed_namespace`. The new test keeps one such
import.

**Scope of the change**
- `request_module` and `request_module_with_phase` have three callers in
the printer. All three are changed. The `require()` and `import()`
printers also call `print_import_record_path`, but they add nothing to
the module record.
- Only `src/bundler/linker.rs:472` sets `PRINT_NAMESPACE_IN_PATH`, and
only the runtime transpile path (`src/runtime/jsc_hooks.rs`) reaches it
with a `ModuleInfo`. The bundler and `bun build --compile` never set the
flag.

**On-disk transpiler cache**
- Stale entry check: ran the issue's repro with a test file above the 4
KiB cache floor and `BUN_RUNTIME_TRANSPILER_CACHE_PATH` set. The `.pile`
entry from 1.4.3-canary holds `custom:/abs/data.bar` in the output and
`/abs/data.bar` in the ESM record, and the second run fails from the
cache. The cache file name is the input hash only, so a fixed build
reads that entry unless the version changes. Version 22 was bumped for
the same reason.
- The third new test runs the fixture cold and warm against a private
cache directory, with one module padded past 4 KiB. It covers the record
round trip through the cache entry.
- Not changed here: the on-disk cache stores output that holds a
plugin's link-time `onResolve` answer, under a key made from the
importing file's content. If the plugin later answers differently, the
old answer is served until the importing file changes. This is
independent of `--isolate` and older than this bug. One line after the
rewrite in `src/bundler/linker.rs` (`result.runtime_transpiler_cache =
None`) would stop it. `parse_entry.rs` already drops the cache in a like
case, when it rewrites `@jest/globals` to `bun:test`. The cost is a
transpile on every run for each file that a resolve plugin touches, for
example every importer of a path alias. That trade needs a maintainer's
call, so it is left for a separate PR.

**Self-review**
1. The PR body did not name oven-sh#35605 and oven-sh#40836, and said a source-written
`custom:foo` was never affected. Fixed above.
2. No test for a namespace that is already in the source. Added the
`virt:` imports.
3. The cache version bump was checked by hand only. Added the cold and
warm cache test.
4. Keep plugin-rewritten output out of the on-disk cache. Not done, see
above.

**Tests**
- The new cases fail on the unfixed release build with `Cannot find
package 'resolved-other'` (first error) and `SyntaxError: Export named
'named' not found in module '<dir>/reexport-clause.ts'`. The same
fixture passes there without `--isolate`.
- Suites run with the debug build: `test/cli/test/isolation.test.ts` (39
pass), `test/js/bun/plugin/` (48 pass),
`test/cli/run/transpiler-cache.test.ts`,
`test/regression/issue/30887.test.ts`,
`test/js/bun/typescript/type-export.test.ts`,
`test/cli/inspect/debugger-buntranspiledmodule.test.ts`. Two cases in
the last four (`--drop invalidates cache`, one `--compile` case) hit the
5 s default timeout on the local debug build and pass with a longer
timeout.

</details>

<!-- robobun:evidence:begin -->

---

**[human-review]** gate passed · iteration 0 · 3 files touched

<details><summary>fails on main (without fix)</summary>

```console
ASAN without fix: 3 FAILED
$ BUN_DEBUG_QUIET_LOGS=1 bun scripts/build.ts --profile=debug --quiet test "--reporter=junit" "--reporter-outfile=/tmp/pr_gate.xml" test/cli/test/isolation.test.ts
bun test v1.4.3 (b993710)

test/cli/test/isolation.test.ts:
(pass) bun test --isolate > without --isolate, leaked global is visible to next file [430.63ms]
(pass) bun test --isolate > with --isolate, each file gets a fresh global [483.42ms]
(pass) bun test --isolate > without --isolate, --preload still runs once (regression) [282.91ms]
(pass) bun test --isolate > with --isolate, --preload re-runs in each file's fresh global [448.63ms]
(pass) bun test --isolate > with --isolate, module state is not shared between files [379.00ms]
(pass) bun test --isolate > with --isolate, a file's process.chdir() is undone before the next file [1257.31ms]
(pass) bun test --isolate > with --isolate, a file's process.env writes with native side effects are undone before the next file [1568.05ms]
439 |     using dir = tempDir("isolate-plugin-namespace", pluginNamespaceFixture);
440 |     const { stderr, exitCode } = await runTests(String(dir), args, ["./a.test.ts", "./b.test.ts"], {
441 |       ...bunEnv,
442 |       ...en
... (truncated)

release without fix: 3 FAILED
bun test v1.4.3-canary.1 (b993710)

test/cli/test/isolation.test.ts:
439 |     using dir = tempDir("isolate-plugin-namespace", pluginNamespaceFixture);
440 |     const { stderr, exitCode } = await runTests(String(dir), args, ["./a.test.ts", "./b.test.ts"], {
441 |       ...bunEnv,
442 |       ...env,
443 |     });
444 |     expect(normalizeBunSnapshot(stderr, dir)).toContain("2 pass");
                                                    ^
error: expect(received).toContain(expected)

Expected to contain: "2 pass"
Received: "a.test.ts:\n\n# Unhandled error between tests\n-------------------------------\nerror: Cannot find package 'resolved-other' from '<dir>/a.test.ts'\n-------------------------------\n\n\nb.test.ts:\n\n# Unhandled error between tests\n-------------------------------\nerror: Cannot find package 'resolved-other' from '<dir>/b.test.ts'\n-------------------------------\n\n\n 0 pass\n 2 fail\n 2 errors\nRan 2 tests across 2 files."

      at <anonymous> (/workspace/bun/test/cli/test/isolation.test.ts:444:47)
(pass) bun test --isolate > without --isolate, leaked global is visible to next file [26.77ms]
(pass) bun test --isolate > with --isolate, --preloa
... (truncated)
```

</details>

<details><summary>passes on PR (with fix)</summary>

```console
ASAN with fix: all passed
$ BUN_DEBUG_QUIET_LOGS=1 bun scripts/build.ts --profile=debug --quiet test "--reporter=junit" "--reporter-outfile=/tmp/pr_gate.xml" test/cli/test/isolation.test.ts
bun test v1.4.3 (b993710)

test/cli/test/isolation.test.ts:
(pass) bun test --isolate > with --isolate, each file gets a fresh global [352.05ms]
(pass) bun test --isolate > without --isolate, leaked global is visible to next file [439.29ms]
(pass) bun test --isolate > without --isolate, --preload still runs once (regression) [297.02ms]
(pass) bun test --isolate > with --isolate, --preload re-runs in each file's fresh global [336.20ms]
(pass) bun test --isolate > with --isolate, module state is not shared between files [371.07ms]
(pass) bun test --isolate > with --isolate, a file's process.env writes with native side effects are undone before the next file [1392.12ms]
(pass) bun test --isolate > with --isolate, a file's process.chdir() is undone before the next file [1461.43ms]
(pass) bun test --isolate > cached module records keep the namespace a plugin onResolve gives an import (--isolate) [542.79ms]
(pass) bun test --isolate > with --isolate, cached module records keep short, Latin-1 and UTF-16 names 
... (truncated)

release with fix: all passed
$ bun scripts/build.ts --profile=release
[configured] bun-profile → bun (stripped)
  target       linux-x64-gnu
  build type   Release
  build dir    ./build/release
  revision     68e0e0b
  features     baseline

23 deps, 131 codegen, 1176 objects in 689ms

ninja: Entering directory `/workspace/bun/build/release'
[1/1248] install /workspace/bun
bun install v1.4.3-canary.1 (b993710)

Checked 22 installs across 61 packages (no changes) [7.00ms]
[2/1248] gen ErrorCode+*.h
[3/1248] install /workspace/bun/packages/bun-error
bun install v1.4.3-canary.1 (b993710)

Checked 1 install across 2 packages (no changes) [1.00ms]
[4/1248] gen bindgenv2
[5/1248] install /workspace/bun/src/node-fallbacks
bun install v1.4.3-canary.1 (b993710)

Checked 111 installs across 104 packages (no changes) [4.00ms]
[6/1248] gen node-fallbacks/react-refresh.js
Bundled 1 module in 4ms

  react-refresh.js  4.81 KB  (entry point)

[7/1248] fetch zlib
[zlib] up to date
[8/1248] fetch tinycc
[tinycc] up to date
[9/1247] fetch libjpeg-turbo
[libjpeg-turbo] up to date
[10/1247] gen bake.{client,server,error}.js
-> bake.client.js, bake.server.js, bake.error.js
[11/1247] gen .bind.ts → Gene
... (truncated)
```

</details>

<details><summary>diff hotspot</summary>

```
src/js_printer/lib.rs             |  51 +++++++++--------
 src/jsc/RuntimeTranspilerCache.rs |   5 +-
 test/cli/test/isolation.test.ts   | 116 ++++++++++++++++++++++++++++++++++++++
 3 files changed, 149 insertions(+), 23 deletions(-)
```

</details>

**gate history** · 1 passed · 0 rejected · iteration 0

<details><summary>evidence per changed file</summary>

```
file                               reads  edits  tests
src/js_printer/lib.rs                  6      5     23
src/jsc/RuntimeTranspilerCache.rs      2      1     23
test/cli/test/isolation.test.ts        4      3     23
```

</details>

<!-- robobun:evidence:end -->

Co-authored-by: Alistair Smith <hi@alistair.sh>

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants