Repository navigation
fix: Move uno-config.js out of the fingerprinted package folder - #1077
Conversation
There was a problem hiding this comment.
Copilot review overview
🟡 Changes recommended
Required validation-path fixes and specification updates remain unresolved.
Get a fresh assessment by requesting another Copilot review.
Review effort: Lite
Findings: 1
Open (1)
What changed in this PR
Moves uno-config.js from fingerprinted package folders to the web root, preventing stale cached boot configurations.
Changes:
- Updates bootstrapper, service-worker, WebWorker, and version-checker resolution.
- Adjusts publishing, validation scripts, tests, specifications, and documentation.
- Open findings: one critical sample validation path, one moderate WebWorker validation path, and two specification nits require updates.
| File | Summary |
|---|---|
src/Uno.Wasm.VersionChecker.UnitTests/Given_VersionCheckService.cs |
Adds root-layout discovery tests. |
src/Uno.Wasm.VersionChecker.Core/VersionCheckService.cs |
Adds root-first configuration probing. |
src/Uno.Wasm.Tests.WebGL4Gb/test-webgl-4gb.sh |
Finds the root configuration. |
src/Uno.Wasm.Tests.Fingerprint/test-fingerprint.sh |
Validates configuration placement. |
src/Uno.Wasm.Bootstrap/ts/Uno/WebAssembly/WorkerBootstrapper.ts |
Loads worker-local configuration. |
src/Uno.Wasm.Bootstrap/ts/Uno/WebAssembly/Bootstrapper.ts |
Loads root configuration. |
src/Uno.Wasm.Bootstrap/ShellTask.cs |
Emits root-level configuration and removes the worker global. |
src/Uno.Wasm.Bootstrap/Embedded/service-worker.js |
Imports root configuration. |
src/Uno.Wasm.Bootstrap/build/Uno.Wasm.Bootstrap.targets |
Patches root configuration during publishing. |
specs/004-root-uno-config/spec.md |
Specifies the new configuration layout. |
specs/003-webworker-mode/spec.md |
Updates WebWorker requirements. |
specs/003-wasm-version-checker/spec.md |
Updates version-checker requirements. |
doc/features-version-checker.md |
Documents root configuration reporting. |
doc/features-dotnetjs-fingerprinting.md |
Documents configuration placement. |
doc/deploy-and-publish.md |
Documents cache policies. |
build/scripts/validate-dotnetjs-fingerprint.sh |
Updates fingerprint validation guidance. |
build/scripts/validate-boot-config.sh |
Updates boot configuration validation guidance. |
💡 Add a code-review agent skill for context-aware, tailored reviews. Learn more in the docs.
|
No idea what "Two validation-script issues and one documentation issue remain unresolved" copilot is referring to...it didn't indicate anything above. |
|
The The signing step is meant to be skipped on pull requests, but its |
|
Thanks @mikernet! We're going with this approach and closed #1099, which fixed the same bug differently. I pushed two docs commits here:
Heads-up: #1098 also edits |
The config is versioned no more, and moves next to index.html with #1077. Preload it from there when it is, otherwise from the package folder. Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_013terw2KRvw8e64cogQymUL
The config is versioned no more, and moves next to index.html with #1077. Preload it from there when it is, otherwise from the package folder. Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_013terw2KRvw8e64cogQymUL
|
@MartinZikmund No problem - you're welcome :) Just in case it got missed, I also have 4 other PRs in this repo that are ready for review (not sure how frequently PRs are checked here). |
|
@MartinZikmund Sorry, last ping I promise - forgot to mention this somewhat related PR that fixes web.config caching (among other things) in the uno templates as well. |
The config is versioned no more, and moves next to index.html with #1077. Preload it from there when it is, otherwise from the package folder. Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_013terw2KRvw8e64cogQymUL
The config is versioned no more, and moves next to index.html with #1077. Preload it from there when it is, otherwise from the package folder. Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_013terw2KRvw8e64cogQymUL
dbc5dd2 to
d272dc5
Compare
|
Rebased onto the latest I also added Locally, the bootstrap and version checker unit tests and |
🤖 Addressed PR comments up to this point
|
There was a problem hiding this comment.
🔵 Needs a closer look
The fingerprint test can still select a stale package copy, and deployment docs need a WebWorker cache-policy exception.
0 open findings
5 resolved since last review
🧠 Review effort: Lite
Give feedback about Copilot approvals in this survey to enter a drawing for a $150 gift card.
|
Pushed a few follow-ups from a final review pass, each as its own commit:
Checked locally: bootstrap and version checker unit tests, |
There was a problem hiding this comment.
🔵 Needs a closer look
Deployment cache guidance and version-checker specification wording need clarification and alignment.
0 open findings
🧠 Review effort: Lite
Give feedback about Copilot approvals in this survey to enter a drawing for a $150 gift card.
The package_<hash> folder name is computed over the static web content before uno-config.js is generated, and the publish-time fingerprint update rewrites the file again after the folder name is baked into index.html. Hosts cache package_* as immutable, so a publish that only changed managed code kept the folder name and served the previous uno-config.js to returning visitors, which pointed at a dotnet.js that no longer existed or booted the previous build. uno-config.js now lives next to index.html, where hosts always revalidate. The bootstrapper imports it one level above its own folder, the service worker and offline file list reference it at the web app base path, WebWorker scripts fetch it from their own folder, and the publish-time update patches it at the root. Fixes unoplatform#1076
The bootstrapper now lives in the hashed package folder while the configuration sits next to the page that loads it. Pages referencing uno-bootstrap.js are probed one folder above the bootstrapper first, then next to it for older layouts, and the embedded.js fallback probes the site root before the package folder.
The RayTracer sample's publish validation and the PowerShell fingerprint validation still looked for uno-config.js inside the package folder.
The template's staticwebapp.config.json caches the root files for an hour and web.config sets no cache policy, so neither implements the policy yet. Add an Azure Static Web Apps example and the WasmFingerprintAssets caveat. Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_013terw2KRvw8e64cogQymUL
004 is taken by the resilient loading spec. The template's hosting files don't revalidate the root files yet, so the spec no longer claims they do. Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_013terw2KRvw8e64cogQymUL
The recursive glob also matched WebWorker copies, giving a semicolon-separated path. Use wwwroot/uno-config.js, falling back to package_*/uno-config.js for apps built with an older bootstrapper. Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_013terw2KRvw8e64cogQymUL
A stale copy under package_* could otherwise satisfy the validation. Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_013terw2KRvw8e64cogQymUL
Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_013terw2KRvw8e64cogQymUL
The worker imports the root uno-config.js, whose URL no longer changes between deployments. With the default updateViaCache, an updated worker could install with the previous deployment's config. Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_013terw2KRvw8e64cogQymUL
Single-page-app hosts answer the root uno-config.js probe with index.html, which hid the package folder config of older layouts. A network failure on a probe now moves on to the next candidate. Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_013terw2KRvw8e64cogQymUL
Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_013terw2KRvw8e64cogQymUL
Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_013terw2KRvw8e64cogQymUL
Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_013terw2KRvw8e64cogQymUL
Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_013terw2KRvw8e64cogQymUL
…r warning Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_013terw2KRvw8e64cogQymUL
d4eaafa to
e56e6df
Compare
The config is versioned no more, and moves next to index.html with #1077. Preload it from there when it is, otherwise from the package folder. Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_013terw2KRvw8e64cogQymUL
The config is versioned no more, and moves next to index.html with #1077. Preload it from there when it is, otherwise from the package folder. Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_013terw2KRvw8e64cogQymUL



Fixes #1076
What is the current behavior?
uno-config.jsis emitted insidepackage_<hash>/, but the folder hash is computed over the static web content before the file is generated, and_UnoUpdateDotnetJsFingerprintPublishOutputrewrites it again at publish time with the actualdotnet.<fingerprint>.jsname. Hosts cachepackage_*as immutable, so a publish that only changes managed code keeps the folder name and returning visitors get the previousuno-config.js. It points at adotnet.jsthat no longer exists (boot fails) or still exists (the previous build runs against the new assets).What is the new behavior?
uno-config.jslives at thewwwrootroot next toindex.html, in every shell mode, where hosts always revalidate it.embedded.jshosting all resolve it correctly.__unoWorkerPackagePathglobal is gone.$(WasmShellOutputPackagePath)lookup is removed.uno-bootstrap.jsfirst, then beside it for older layouts, with the same root-first order for theembedded.jsfallback.config.uno_app_baseand every other package-relative value are unchanged.Docs: the deployment page gains a cache-policy table per folder, and the fingerprinting page explains where the file lives and why. Spec:
specs/008-root-uno-config/spec.md, with the version checker and WebWorker specs updated to match.Validation
test-fingerprint.sh: all seven scenarios pass, including a new check that the publisheduno-config.jsis at the root and absent from everypackage_*folder. The log shows the build fingerprint differing from the publish fingerprint, which is the mechanism this change addresses.Uno.Wasm.Tests.Fingerprintand loaded it in a browser from a site root and from a/app/sub-folder: the rootuno-config.jsis fetched, then the fingerprinted runtime scripts, and the runtime initialises.Uno.Wasm.SampleNet7built withWasmPWAManifestFile: the service worker imports./uno-config.jsand the offline list contains the root path.Uno.Wasm.VersionChecker.UnitTests: 48 passed, including two new tests for the root layout viauno-bootstrap.jsand viaembedded.js.validate-boot-config.sh,validate-dotnetjs-fingerprint.sh,test-webgl-4gb.sh,test-webworker.sh) locate the file at the root.Notes
index.htmlpages that referenced./uno-config.jsdirectly need to point at the root path. The template only references./uno-bootstrap.js._framework/copy into the host's package folder also happens after the host hash is computed, so worker-mode apps keep the same class of problem one level down. That is not changed here and is tracked in WebWorker mode: the worker's published _framework and uno-config.js change inside the host's fingerprinted package folder #1078.