Skip to content

Commit 340167b

Browse files
committed
feat(bun-plugin): use native compiler by default
Retain the selected compiler across Bun setup, reservation, source extraction, CSS publication and delayed callbacks, with explicit WASM selection and no fallback. Refs #686
1 parent 207749e commit 340167b

13 files changed

Lines changed: 645 additions & 88 deletions

‎.changepacks/changepack_log_w74-native-engine.json‎

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,8 @@
33
"packages/plugin-utils/package.json": "Patch",
44
"packages/webpack-plugin/package.json": "Patch",
55
"packages/rsbuild-plugin/package.json": "Patch",
6-
"packages/vite-plugin/package.json": "Patch"
6+
"packages/vite-plugin/package.json": "Patch",
7+
"packages/bun-plugin/package.json": "Patch"
78
},
89
"note": "Add shared native/WASM compiler selection, structural compiler types and exact native platform-load diagnostics for build plugins.",
910
"date": "2026-10-30T17:29:00.000Z"

‎bun.lock‎

Lines changed: 0 additions & 3 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

‎bun.setup.ts‎

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,12 @@ import './bun.matrix'
33
import { afterEach, beforeEach, spyOn } from 'bun:test'
44

55
import { resetWasmForTesting } from './packages/next-plugin/src/wasm'
6-
import { createModuleResolver } from './packages/plugin-utils/src'
6+
import { createModuleResolver, loadCompiler } from './packages/plugin-utils/src'
77

88
const { resetStateForTesting, setDebug, setModuleResolver } =
99
await import('./bindings/devup-ui-wasm/pkg/index.js')
1010
const testModuleResolver = createModuleResolver()
11+
const nativeCompiler = loadCompiler()
1112
const nativeBunPlugin = Bun.plugin
1213
export const bunRegistration = Object.assign(spyOn(Bun, 'plugin'), {
1314
clearAll: nativeBunPlugin.clearAll,
@@ -21,6 +22,9 @@ try {
2122
}
2223

2324
function resetTestState() {
25+
nativeCompiler.resetStateForTesting()
26+
nativeCompiler.setDebug(true)
27+
nativeCompiler.setModuleResolver(testModuleResolver)
2428
resetStateForTesting()
2529
setDebug(true)
2630
setModuleResolver(testModuleResolver)

0 commit comments

Comments
 (0)