Skip to content

fix(router): key route bundle graph entries with a trailing slash - #9304

Merged
Varixo merged 1 commit into
mainfrom
fix/9041-catch-all-route-preload
Oct 26, 2026
Merged

Varixo merged 1 commit into
mainfrom
fix/9041-catch-all-route-preload

Conversation

@Varixo

@Varixo Varixo commented Oct 26, 2026 •

Copy link
Copy Markdown
Member

Catch-all names like docs/[...slug] are built without the slash, but every runtime preload lookup adds it, so their bundles never preloaded. Refs #9041.

Summary by CodeRabbit

  • Bug Fixes
    • Fixed bundle preloading for catch-all routes during link prefetch and navigation.

Catch-all names like `docs/[...slug]` are built without the slash,
but every runtime preload lookup adds it, so their bundles never
preloaded. Refs #9041.
@Varixo
Varixo requested a review from a team as a code owner October 26, 2026 18:44
@changeset-bot

changeset-bot Bot commented Oct 26, 2026

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: a937c63

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

This PR includes changesets to release 8 packages
Name Type
@qwik.dev/router Patch
eslint-plugin-qwik Patch
@qwik.dev/mcp Patch
create-qwik Patch
@qwik.dev/devtools Patch
@qwik.dev/react Patch
@qwik.dev/utils Patch
@qwik.dev/core 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

@maiieul maiieul moved this from Backlog to Waiting For Review in Qwik Development Oct 26, 2026
@coderabbitai

coderabbitai Bot commented Oct 26, 2026 •

Copy link
Copy Markdown

Review in Change Stack →

No actionable comments were generated in the recent review.

Recent review info
Run configuration
  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: defaults
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: adb3c771-3e77-4d6d-801f-da6fc5a452c1
Commits

Reviewing files that changed from the base of the PR and between 2240911 and a937c63.

Files selected for processing: 3
  • .changeset/catch-all-route-preload.md
  • packages/qwik-router/src/buildtime/vite/get-route-imports.ts
  • packages/qwik-router/src/buildtime/vite/get-route-imports.unit.ts

Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 9 remain after this review.

Walkthrough

getRouteImports now adds a trailing slash to route names used as bundle map keys. A unit test covers a catch-all route and updates the subroute snapshot. A changeset records a patch release for @qwik.dev/router.

Changes: Catch-all route preload

Layer / File(s) Summary
Normalize route import keys
packages/qwik-router/src/buildtime/vite/get-route-imports.ts, packages/qwik-router/src/buildtime/vite/get-route-imports.unit.ts, .changeset/catch-all-route-preload.md
getRouteImports applies ensureSlash to route names used as keys. Tests cover the catch-all route key and update the subroute snapshot to include a trailing slash. The changeset records a patch release.

Priority: Normal

Estimated code review effort: 2 (Simple) | ~8 minutes

Change: Bug fix

Possibly related issues

  • QwikDev/qwik#9041: This issue describes the route key mismatch that this change addresses by adding a trailing slash to the build key.

Suggested reviewers: wmertens

Merge Risk: Minimal · up to a937c

The preload-key normalization is compatible with runtime lookups and has focused catch-all coverage, so the PR is ready to merge.

Architecture risk: Low · up to a937c

The change affects 1 system.

Changed systems: packages/qwik-router

Architecture concerns
No architecture-level concerns identified.

Review details

Systems and components

  • observed — packages/qwik-router (library) was modified; 2 changed files map to changed impact.

Before / after behavior

  • observed — Modified behavior in packages/qwik-router/src/buildtime/vite/get-route-imports.ts: Added the ensureSlash import.
  • observed — Modified behavior in packages/qwik-router/src/buildtime/vite/get-route-imports.ts: Route bundle entries are now keyed by ensureSlash(route.routeName) instead of the unmodified route name.
  • observed — Modified behavior in packages/qwik-router/src/buildtime/vite/get-route-imports.unit.ts: Adds a test asserting that getRouteImports keys a catch-all route as docs/[...slug]/.
  • observed — Modified behavior in packages/qwik-router/src/buildtime/vite/get-route-imports.unit.ts: Updates the snapshot’s subroute key from /subroute to /subroute/.
Pre-merge checks: Passed 4 · Failed 1

Failed Failed checks: 1 warning

Check name Status Explanation Resolution
Docstring Coverage Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 1 functions across 2 files. (1 skipped: 1 … Write docstrings for the functions missing them to satisfy the coverage threshold.
Passed Passed checks: 4 passed
Check name Status Explanation
Description Check Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check Passed The title "fix(router): key route bundle graph entries with a trailing slash" matches the main change. The raw summary shows getRouteImports now normalizes route names with ensureSlash before using th…
Linked Issues check Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check Passed Check skipped because no linked issues were found for this pull request.
Full details: Title check

Explanation

The title "fix(router): key route bundle graph entries with a trailing slash" matches the main change. The raw summary shows getRouteImports now normalizes route names with ensureSlash before using them as result keys, and the unit test expects catch-all route imports to use a trailing slash. The PR objectives state that bundle graph entries lacked the trailing slash that runtime preload lookups add, so catch-all route bundles were not preloaded. The title is specific, uses a conventional commit prefix, and is under 72 characters.

Full details: Docstring Coverage

Explanation

Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 1 functions across 2 files. (1 skipped: 1 unsupported.)

Resolution

Write docstrings for the functions missing them to satisfy the coverage threshold.

Finishing Touches: 💡 1
📝 Generate docstrings: 💡
  • Commit to this branch
  • Create a new PR
🧪 Generate unit tests (beta)
  • Commit to this branch
  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Comment @coderabbitai help to get the list of available commands.

@pkg-pr-new

pkg-pr-new Bot commented Oct 26, 2026

Copy link
Copy Markdown

Open in StackBlitz

@qwik.dev/core

npm i https://pkg.pr.new/QwikDev/qwik/@qwik.dev/core@9304

@qwik.dev/router

npm i https://pkg.pr.new/QwikDev/qwik/@qwik.dev/router@9304

@qwik.dev/utils

npm i https://pkg.pr.new/QwikDev/qwik/@qwik.dev/utils@9304

eslint-plugin-qwik

npm i https://pkg.pr.new/QwikDev/qwik/eslint-plugin-qwik@9304

create-qwik

npm i https://pkg.pr.new/QwikDev/qwik/create-qwik@9304

@qwik.dev/optimizer

npm i https://pkg.pr.new/QwikDev/qwik/@qwik.dev/optimizer@9304

@qwik.dev/devtools

npm i https://pkg.pr.new/QwikDev/qwik/@qwik.dev/devtools@9304

@qwik.dev/mcp

npm i https://pkg.pr.new/QwikDev/qwik/@qwik.dev/mcp@9304

commit: a937c63

@github-actions

github-actions Bot commented Oct 26, 2026 •

Copy link
Copy Markdown
Contributor
built with Refined Cloudflare Pages Action

⚡ Cloudflare Pages Deployment

Name Status Preview Last Commit
qwik-docs ✅ Ready (View Log) Visit Preview a937c63

@Varixo
Varixo merged commit b5608b9 into main Oct 26, 2026
56 checks passed
@Varixo
Varixo deleted the fix/9041-catch-all-route-preload branch October 26, 2026 19:10
@github-project-automation github-project-automation Bot moved this from Waiting For Review to Done in Qwik Development Oct 26, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Archived in project

Development

Successfully merging this pull request may close these issues.

1 participant