Skip to content

chore: Let the bootstrapper default the manifest start_url and scope - #2269

Open
mikernet wants to merge 1 commit into
unoplatform:mainfrom
mikernet:dev/mikernet/manifest-defaults
Open

mikernet wants to merge 1 commit into
unoplatform:mainfrom
mikernet:dev/mikernet/manifest-defaults

Conversation

@mikernet

@mikernet mikernet commented Sep 21, 2026 •

Copy link
Copy Markdown

GitHub Issue (If applicable): closes #2268

PR Type

What kind of change does this PR introduce?

  • Feature

What is the current behavior?

The WebAssembly manifest hard-codes "start_url": "/index.html" and "scope": "/", repeating WasmShellWebAppBasePath and breaking sub-folder hosting.

What is the new behavior?

Both members are removed from the template manifest. The bootstrapper sets them from WasmShellWebAppBasePath when absent (unoplatform/Uno.Wasm.Bootstrap#1086), so a new project gets start_url and scope of / by default and follows the base path when it is changed. Until that bootstrapper change ships, a manifest without the two members falls back to the browser defaults, which resolve to the page that references the manifest.

Why the base path rather than /index.html

The template value /index.html caused a startup error in a real app: the installed PWA launched at a literal file path that the app's client-side router did not recognize as a route. Launching at the base path avoids that, and it is what the site serves for that URL anyway.

Offline launch does not depend on the file name either. The service worker precaches every entry of config.offline_files, whose first entry is the base path itself, so the cache holds a response under the / key (and one under /index.html). When the installed app opens start_url offline, the network-first fetch handler falls back to caches.match and finds it. No server redirect or SPA fallback is involved.

The one thing to keep in mind is that the cached response for the base path must be a plain 200: a host that redirected / to /index.html would cache a redirected response, which browsers refuse to use for a navigation. IIS, Azure Static Web Apps and the shipped hosting configs serve / directly, so the base path is the right default.

PR Checklist

Please check if your PR fulfills the following requirements:

  • Associated with an issue (GitHub or internal)

Other information

Companion to unoplatform/Uno.Wasm.Bootstrap#1086.

Internal Issue (If applicable):

The WebAssembly manifest hard-coded start_url to /index.html and scope
to /, which repeats WasmShellWebAppBasePath and is wrong for an app
hosted under a sub-folder. The bootstrapper now derives both from the
base path when they are absent.
@mergify

mergify Bot commented Nov 10, 2026

Copy link
Copy Markdown

Tick the box to add this pull request to the merge queue (same as @mergifyio queue). If it does not match the queue conditions yet, it enters the queue once it does.

  • Queue this pull request

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

WebAssembly manifest hard-codes start_url and scope instead of following WasmShellWebAppBasePath

1 participant