fix(bootstrap): show the boot error shell when the app graph fails to evaluate (09-03)

A module that threw while evaluating stopped main.tsx before boot() ran, so the
static loading shell stayed up. The entry now imports the app (boot.tsx)
dynamically and renders the shell on rejection; the shell reads boot messages
without the feature catalog. The preload helper gets its own chunk so lazy
chunks do not import the per-build entry, and the bundle budget counts the
entry's dynamic imports as initial JS.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
DongHyeonka
2026-09-25 22:54:40 +09:00
co-authored by Claude Opus 5.5
parent e215c849fb
commit 9c8a5f417a
10 changed files with 203 additions and 79 deletions
+25
View File
@@ -26,6 +26,31 @@ describe("Vite bundle classification", () => {
});
});
it("counts the entry's own dynamic imports as initial (09-03)", () => {
// main.tsx does nothing but import the application graph dynamically, so
// that graph is loaded on every visit; the routes it lazy-loads are not.
expect(
classifyViteJavascript({
"index.html": {
file: "assets/entry.js",
isEntry: true,
dynamicImports: ["src/boot.tsx"],
},
"src/boot.tsx": {
file: "assets/boot.js",
imports: ["_shared.js"],
dynamicImports: ["src/lazy.js"],
},
"_shared.js": { file: "assets/shared.js" },
"src/lazy.js": { file: "assets/lazy.js" },
}),
).toEqual({
initialFiles: ["assets/boot.js", "assets/entry.js", "assets/shared.js"],
lazyFiles: ["assets/lazy.js"],
missingImports: [],
});
});
it("reports a manifest import that cannot be resolved", () => {
expect(
classifyViteJavascript({