diff --git a/packages/client/modules/README.i18n.yaml b/packages/client/modules/README.i18n.yaml index f1b75f1da5..0fad02879c 100644 --- a/packages/client/modules/README.i18n.yaml +++ b/packages/client/modules/README.i18n.yaml @@ -2,5 +2,5 @@ # side as of the last confirmed-consistent state. Both languages carry equal authority; # after editing either side, bring the other along and re-record with: # pnpm run verify-translation-pairing --write packages/client/modules/README.md -README.md: 2b5aa0e2e3a0a7d591fc573f3d4d70404e759b2b -README.zh.md: d2a46283b50baab3a5ee9d399df87a0cfa4910e0 +README.md: 31dcffaefaffff4c40880873d95f0ce2fcb59db6 +README.zh.md: c7748a00e7a9ac5d80265d34158f3fb412771df4 diff --git a/packages/client/modules/README.md b/packages/client/modules/README.md index 2b5aa0e2e3..31dcffaefa 100644 --- a/packages/client/modules/README.md +++ b/packages/client/modules/README.md @@ -81,7 +81,7 @@ The host contributes structured index rows that inject, into `
`: the `wind ### Entry ownership -`ClientEntries` records the entries created during boot and serializes full-graph updates, retries and code reloads over the same Loader. A local generation prevents an older download from mounting after a newer graph arrives. New arrivals use single-resource URLs, never startup batches that could register existing factories twice. Cleanup retains declared and observed transitive module requests from every remaining Loader entry. Its observable status has no runtime library import because the modules bootstrap materializes before platform seeds are available. +`ClientEntries` records the entries created during boot and serializes full-graph updates, retries and code reloads over the same Loader. A local generation prevents an older download from mounting after its desired entry or code changes; snapshots of the same targets share the pending load. New arrivals use single-resource URLs, never startup batches that could register existing factories twice. Cleanup retains declared and observed transitive module requests from every remaining Loader entry. Its observable status has no runtime library import because the modules bootstrap materializes before platform seeds are available. ### Source map diff --git a/packages/client/modules/README.zh.md b/packages/client/modules/README.zh.md index d2a46283b5..c7748a00e7 100644 --- a/packages/client/modules/README.zh.md +++ b/packages/client/modules/README.zh.md @@ -81,7 +81,7 @@ bundle 路由随注入的 `webServer` 生命周期注册:服务就绪时注册 ### 条目所有权 -`ClientEntries` 记录启动时创建的条目,并在同一个 Loader 上串行执行完整图更新、重试和代码重载。本地代际阻止旧下载在新图到达后挂载。新增模块使用单资源 URL,不会重新执行可能重复注册现有 factory 的启动 batch。清理会保留每个剩余 Loader 条目的已声明及已观察到的传递模块依赖。其可观察状态不导入运行时库,因为 modules bootstrap 在平台种子可用之前物化。 +`ClientEntries` 记录启动时创建的条目,并在同一个 Loader 上串行执行完整图更新、重试和代码重载。本地代际阻止旧下载在目标条目或代码变化后挂载;目标相同的快照共用进行中的加载。新增模块使用单资源 URL,不会重新执行可能重复注册现有 factory 的启动 batch。清理会保留每个剩余 Loader 条目的已声明及已观察到的传递模块依赖。其可观察状态不导入运行时库,因为 modules bootstrap 在平台种子可用之前物化。 ### 源码索引 diff --git a/packages/client/modules/src/client/entries.ts b/packages/client/modules/src/client/entries.ts index c875e6ddbe..808b719868 100644 --- a/packages/client/modules/src/client/entries.ts +++ b/packages/client/modules/src/client/entries.ts @@ -24,6 +24,11 @@ interface ModuleIndex { const ACTIVE = 2 as FiberState.ACTIVE const FAILED = 3 as FiberState.FAILED +/** Revisions and requests identify desired code; URLs only select its immutable delivery resource. */ +function entryTargets(manifest: BootManifest): string { + return JSON.stringify(manifest.modules.map(row => [row.id, row.rev, row.inject, row.external])) +} + /** Manages only entries created from the Host manifest; other Loader contributors retain ownership. */ export class ClientEntries { /** Stable observable consumed by page diagnostics through the renderer's injected hook. */ @@ -79,13 +84,15 @@ export class ClientEntries { } /** - * Validate and apply the latest full Host graph. A later snapshot prevents an older download from mounting. + * Validate and apply the latest full Host graph. Changed targets cancel obsolete mounts; identical targets share pending loads. * @param graph - JSON-decoded graph received from the Host. * @returns after the queued reconciliation; per-package failures remain available in {@link state}. */ sync(graph: unknown): Promise