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:
co-authored by
Claude Opus 5.5
parent
e215c849fb
commit
9c8a5f417a
@@ -1,4 +1,8 @@
|
||||
import { formatMessage } from "../i18n/index.ts";
|
||||
import { BOOT_MESSAGES } from "../i18n/boot-messages.ts";
|
||||
|
||||
// 09-03. Read from the boot messages alone, not the i18n catalog: the shell
|
||||
// has to render when the installed feature graph failed to evaluate.
|
||||
const MESSAGES = BOOT_MESSAGES["ko-KR"];
|
||||
|
||||
export type BootErrorShellProps = Readonly<{
|
||||
kind?: string;
|
||||
@@ -19,35 +23,36 @@ export function BootErrorShell({
|
||||
}: BootErrorShellProps) {
|
||||
return (
|
||||
<main role="alert">
|
||||
<h1>{formatMessage("ko-KR", "boot.failure.title")}</h1>
|
||||
<h1>{MESSAGES["boot.failure.title"]}</h1>
|
||||
<dl>
|
||||
<dt>{formatMessage("ko-KR", "boot.field.error")}</dt>
|
||||
<dt>{MESSAGES["boot.field.error"]}</dt>
|
||||
<dd>{kind}</dd>
|
||||
<dt>{formatMessage("ko-KR", "boot.field.code")}</dt>
|
||||
<dt>{MESSAGES["boot.field.code"]}</dt>
|
||||
<dd>{code}</dd>
|
||||
{buildId && (
|
||||
<>
|
||||
<dt>{formatMessage("ko-KR", "boot.field.build")}</dt>
|
||||
<dt>{MESSAGES["boot.field.build"]}</dt>
|
||||
<dd>{buildId}</dd>
|
||||
</>
|
||||
)}
|
||||
{configSchemaVersion && (
|
||||
<>
|
||||
<dt>{formatMessage("ko-KR", "boot.field.configSchema")}</dt>
|
||||
<dt>{MESSAGES["boot.field.configSchema"]}</dt>
|
||||
<dd>{configSchemaVersion}</dd>
|
||||
</>
|
||||
)}
|
||||
{releaseId && (
|
||||
<>
|
||||
<dt>{formatMessage("ko-KR", "boot.field.release")}</dt>
|
||||
<dt>{MESSAGES["boot.field.release"]}</dt>
|
||||
<dd>{releaseId}</dd>
|
||||
</>
|
||||
)}
|
||||
</dl>
|
||||
<p>
|
||||
{formatMessage("ko-KR", "boot.supportReference", {
|
||||
reference: supportReference,
|
||||
})}
|
||||
{MESSAGES["boot.supportReference"].replace(
|
||||
"{reference}",
|
||||
() => supportReference,
|
||||
)}
|
||||
</p>
|
||||
</main>
|
||||
);
|
||||
|
||||
@@ -0,0 +1,28 @@
|
||||
/**
|
||||
* 09-03. The boot failure shell's words. They live apart from `catalog.ts`
|
||||
* because the catalog merges every installed feature's messages: when that
|
||||
* feature graph throws while it evaluates, the shell reporting it must still
|
||||
* load. `catalog.ts` spreads these in, so they stay ordinary message keys.
|
||||
*/
|
||||
export const BOOT_MESSAGES = Object.freeze({
|
||||
"ko-KR": Object.freeze({
|
||||
"boot.failure.title": "애플리케이션을 시작할 수 없습니다.",
|
||||
"boot.field.error": "오류",
|
||||
"boot.field.code": "코드",
|
||||
"boot.field.build": "빌드",
|
||||
"boot.field.configSchema": "설정 스키마",
|
||||
"boot.field.release": "릴리스",
|
||||
"boot.supportReference": "지원 참조: {reference}",
|
||||
} as const),
|
||||
"en-US": Object.freeze({
|
||||
"boot.failure.title": "The application could not start.",
|
||||
"boot.field.error": "Error",
|
||||
"boot.field.code": "Code",
|
||||
"boot.field.build": "Build",
|
||||
"boot.field.configSchema": "Configuration schema",
|
||||
"boot.field.release": "Release",
|
||||
"boot.supportReference": "Support reference: {reference}",
|
||||
} as const),
|
||||
});
|
||||
|
||||
export type BootMessageKey = keyof (typeof BOOT_MESSAGES)["ko-KR"];
|
||||
@@ -1,4 +1,5 @@
|
||||
import { INSTALLED_MESSAGE_CATALOGS } from "../../features/installed-feature-messages.ts";
|
||||
import { BOOT_MESSAGES } from "./boot-messages.ts";
|
||||
|
||||
const PLATFORM_KO_MESSAGES = {
|
||||
"common.unavailable": "요청한 문구를 표시할 수 없습니다.",
|
||||
@@ -143,13 +144,7 @@ const PLATFORM_KO_MESSAGES = {
|
||||
"error.asset_mismatch": "화면 자산 구성이 현재 릴리스와 일치하지 않습니다.",
|
||||
"error.render_failure": "화면을 표시하지 못했습니다.",
|
||||
"error.unknown_failure": "예상하지 못한 문제가 발생했습니다.",
|
||||
"boot.failure.title": "애플리케이션을 시작할 수 없습니다.",
|
||||
"boot.field.error": "오류",
|
||||
"boot.field.code": "코드",
|
||||
"boot.field.build": "빌드",
|
||||
"boot.field.configSchema": "설정 스키마",
|
||||
"boot.field.release": "릴리스",
|
||||
"boot.supportReference": "지원 참조: {reference}",
|
||||
...BOOT_MESSAGES["ko-KR"],
|
||||
} as const;
|
||||
|
||||
export const KO_MESSAGES = {
|
||||
@@ -301,13 +296,7 @@ const PLATFORM_EN_MESSAGES = {
|
||||
"error.asset_mismatch": "The page assets do not match this release.",
|
||||
"error.render_failure": "The page could not be displayed.",
|
||||
"error.unknown_failure": "An unexpected problem occurred.",
|
||||
"boot.failure.title": "The application could not start.",
|
||||
"boot.field.error": "Error",
|
||||
"boot.field.code": "Code",
|
||||
"boot.field.build": "Build",
|
||||
"boot.field.configSchema": "Configuration schema",
|
||||
"boot.field.release": "Release",
|
||||
"boot.supportReference": "Support reference: {reference}",
|
||||
...BOOT_MESSAGES["en-US"],
|
||||
} as const satisfies Record<keyof typeof PLATFORM_KO_MESSAGES, string>;
|
||||
|
||||
export const EN_MESSAGES = {
|
||||
|
||||
Reference in New Issue
Block a user