From e5035706851683ab378eda89f4efb0abe7c4a8d5 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Wed, 25 Feb 2026 11:43:36 +0000 Subject: [PATCH 1/4] Initial plan From 5afbccfe87947462a04aa099037fcc778ae7c468 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Wed, 25 Feb 2026 11:45:30 +0000 Subject: [PATCH 2/4] fix: sort manifest entries by key for stable build output in generateManifestModule Co-authored-by: motopods <58200641+motopods@users.noreply.github.com> --- packages/start-plugin-core/src/start-compiler-plugin/plugin.ts | 1 + 1 file changed, 1 insertion(+) diff --git a/packages/start-plugin-core/src/start-compiler-plugin/plugin.ts b/packages/start-plugin-core/src/start-compiler-plugin/plugin.ts index 388750ad92..e208ce4fb9 100644 --- a/packages/start-plugin-core/src/start-compiler-plugin/plugin.ts +++ b/packages/start-plugin-core/src/start-compiler-plugin/plugin.ts @@ -114,6 +114,7 @@ function generateManifestModule( includeClientReferencedCheck: boolean, ): string { const manifestEntries = Object.entries(serverFnsById) + .sort(([a], [b]) => a.localeCompare(b)) .map(([id, fn]) => { const baseEntry = `'${id}': { functionName: '${fn.functionName}', From fcfaec801a57e89af00a019cd8b0957d6e0f4302 Mon Sep 17 00:00:00 2001 From: Copilot <198982749+Copilot@users.noreply.github.com> Date: Wed, 25 Feb 2026 20:23:06 +0800 Subject: [PATCH 3/4] Replace localeCompare with deterministic UTF-16 code unit sort in manifest generation (#3) * Initial plan * Replace localeCompare with deterministic UTF-16 code unit comparison in generateManifestModule Co-authored-by: motopods <58200641+motopods@users.noreply.github.com> --------- Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com> Co-authored-by: motopods <58200641+motopods@users.noreply.github.com> --- packages/start-plugin-core/src/start-compiler-plugin/plugin.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/start-plugin-core/src/start-compiler-plugin/plugin.ts b/packages/start-plugin-core/src/start-compiler-plugin/plugin.ts index e208ce4fb9..62b10edc01 100644 --- a/packages/start-plugin-core/src/start-compiler-plugin/plugin.ts +++ b/packages/start-plugin-core/src/start-compiler-plugin/plugin.ts @@ -114,7 +114,7 @@ function generateManifestModule( includeClientReferencedCheck: boolean, ): string { const manifestEntries = Object.entries(serverFnsById) - .sort(([a], [b]) => a.localeCompare(b)) + .sort(([a], [b]) => (a < b ? -1 : a > b ? 1 : 0)) .map(([id, fn]) => { const baseEntry = `'${id}': { functionName: '${fn.functionName}', From 58fab21024ca386b26bed912916e465e6b3f0446 Mon Sep 17 00:00:00 2001 From: motopods <58200641+motopods@users.noreply.github.com> Date: Wed, 18 Mar 2026 11:39:46 +0800 Subject: [PATCH 4/4] Enhance comments for manifest entry sorting Add comments to clarify sorting purpose for manifest entries. --- packages/start-plugin-core/src/start-compiler-plugin/plugin.ts | 3 +++ 1 file changed, 3 insertions(+) diff --git a/packages/start-plugin-core/src/start-compiler-plugin/plugin.ts b/packages/start-plugin-core/src/start-compiler-plugin/plugin.ts index 62b10edc01..94e9889c17 100644 --- a/packages/start-plugin-core/src/start-compiler-plugin/plugin.ts +++ b/packages/start-plugin-core/src/start-compiler-plugin/plugin.ts @@ -114,6 +114,9 @@ function generateManifestModule( includeClientReferencedCheck: boolean, ): string { const manifestEntries = Object.entries(serverFnsById) + // Sort entries by ID so that the generated manifest has a stable, deterministic order. + // Non-deterministic ordering causes the compiled hash of the same source file to change + // between builds, breaking content-addressed caching and reproducible deployments. .sort(([a], [b]) => (a < b ? -1 : a > b ? 1 : 0)) .map(([id, fn]) => { const baseEntry = `'${id}': {