Skip to content

fix(qwik-router): preserve params for ancestor layout loaders - #8945

Draft
ixcans wants to merge 1 commit into
QwikDev:mainfrom
ixcans:fix/nested-layout-loader-params
Draft

fix(qwik-router): preserve params for ancestor layout loaders#8945
ixcans wants to merge 1 commit into
QwikDev:mainfrom
ixcans:fix/nested-layout-loader-params

Conversation

@ixcans

@ixcans ixcans commented Aug 22, 2026

Copy link
Copy Markdown
Contributor

Summary

  • capture the params matched at each route loader's canonical path
  • provide those params to pathname-scoped strict loader request events
  • preserve existing loader URL, pathname, and search scoping behavior

Motivation

This is a narrow follow-up to #8944. Strict loaders intentionally scope an ancestor loader's request event to that loader's own path, but the scoped event currently replaces params with an empty object even when that path resolved dynamic parameters.

For example, a loader declared at /[tenantSlug]/ while rendering /acme/agents/ should keep its canonical /acme/ URL and receive { tenantSlug: 'acme' }. Parameters introduced below the loader's path remain excluded.

Security

This preserves the cache-isolation behavior from #8856. Params come only from the route-trie snapshot captured at the same canonical loader path, and a missing snapshot fails closed to {}. Search-only scoped events retain their existing empty params behavior.

Testing

pnpm test.unit also completed 3,235 tests successfully; seven unrelated Qwik Vite plugin tests failed locally because their source-mode optimizer resolved a missing generated binding at /qwik-vite/src/bindings/qwik.wasm.mjs.

Changeset

  • patch @qwik.dev/router

Keep strict loader events aligned with params matched at each loader's canonical path.
@changeset-bot

changeset-bot Bot commented Aug 22, 2026

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: f173334

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 6 packages
Name Type
@qwik.dev/router Patch
eslint-plugin-qwik Patch
@qwik.dev/core Patch
create-qwik Patch
@qwik.dev/react Patch
@qwik.dev/utils Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

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.

1 participant