You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
fix(create): use shared router factory in router-only apps - #481
React and Solid router-only apps now call the shared getRouter() factory, so router customizations apply and the Register declaration stays in one place.
Adding Query to either framework wraps the router with its browser Query provider and uses the same query client as router context. React router-only output no longer imports the Start SSR integration. The add command also lets pnpm update the lockfile after intentionally changing dependencies, including in CI.
Validation:
Repository build and 456 unit tests passed.
Four affected browser cases generated apps outside the monorepo, installed dependencies, built and type-checked both frameworks, and verified custom router settings and Query results.
The normal pre-commit build, unit and eight blocking browser checks passed.
Files skipped from review as they are similar to previous changes: 1
.changeset/shared-router-factory.md
Included review availability: This review used your included allowance. Your plan provides up to 4 included reviews per hour; 3 remain after this review.
Walkthrough
React and Solid router-only templates now initialize through getRouter() and configure Query providers without SSR query integration. Tests cover generated templates and router-only app behavior. The add-to-app installation path can update pnpm lockfiles when it installs dependencies.
React uses QueryClientProvider and skips SSR query integration in router-only mode. Solid passes Query context into the router and provides context.queryClient in router-only mode.
Template tests check generated router and Query output. End-to-end tests check not-found rendering and Query routes in React and Solid. The fixture helper passes --forced to the add command.
The add-to-app flow requests lockfile updates. With the option enabled, pnpm installs without a package use --no-frozen-lockfile; npm install arguments remain unchanged. Tests cover these cases.
Router-only apps use the shared factory and Query providers. No merge-blocking issue was identified.
Pre-merge checks: 3 · 2
Failed checks: 2 warnings
Check name
Status
Explanation
Resolution
Out of Scope Changes check
The supplied active linked issue is [#480]. The PR also changes Query provider generation, SSR Query imports, package-manager lockfile behavior, the add-on test helper, and related tests and release n…
Keep this PR limited to [#480] by removing the unrelated Query, lockfile, add-on helper, and associated production and test changes, or provide the active linked issue requirements that explicitly cover those changes.
Docstring Coverage
Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff with cyclomatic complexity of at least 2. Documentat…
Write docstrings for the functions missing them to satisfy the coverage threshold.
Passed checks: 3 passed
Check name
Status
Explanation
Description Check
Check skipped - CodeRabbit’s high-level summary is enabled.
Title check
The title clearly and concisely describes the main change: using the shared router factory in router-only applications.
Linked Issues check
Issue [#480] requires router-only React and Solid main.tsx templates to import and call getRouter() from router.tsx. The whole-PR diff shows both templates make this change and remove inline rou…
Full details: Linked Issues check
Explanation
Issue [#480] requires router-only React and Solid main.tsx templates to import and call getRouter() from router.tsx. The whole-PR diff shows both templates make this change and remove inline router creation. The templates also remove the duplicate Register declarations from main.tsx. router.tsx.ejs keeps the factory and the single Register declaration. Template tests cover both frameworks and the end-to-end tests verify factory configuration at runtime.
Full details: Out of Scope Changes check
Explanation
The supplied active linked issue is [#480]. The PR also changes Query provider generation, SSR Query imports, package-manager lockfile behavior, the add-on test helper, and related tests and release notes. These changes have no concrete connection to #480, which only requires the shared router factory and the single Register declaration. The PR description mentions #522, but no linked-issue requirements for #522 are supplied for this assessment.
Resolution
Keep this PR limited to [#480] by removing the unrelated Query, lockfile, add-on helper, and associated production and test changes, or provide the active linked issue requirements that explicitly cover those changes.
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 with cyclomatic complexity of at least 2. Documentation-only edits and deletions within surviving functions are included; unchanged diff context and fully deleted functions are excluded. Analyzed 4 functions across 6 files. (3 skipped: 3 unsupported.)
Resolution
Write docstrings for the functions missing them to satisfy the coverage threshold.
Finishing Touches
Generate unit tests (beta)
Create a new PR
Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts
Warning
Some tools did not complete. Review the errors below.
ESLint
If the error stems from missing dependencies, add them to the package.json file. For unrecoverable errors (e.g., due to private dependencies), disable the tool in the CodeRabbit configuration.
packages/cli/tests-e2e/helpers.ts
Parsing error: "parserOptions.project" has been provided for @typescript-eslint/parser.
The file was not found in any of the provided project(s): packages/cli/tests-e2e/helpers.ts
Parsing error: "parserOptions.project" has been provided for @typescript-eslint/parser.
The file was not found in any of the provided project(s): packages/cli/tests-e2e/shared-router-factory.spec.ts
packages/create/tests/framework-template.test.ts
Parsing error: "parserOptions.project" has been provided for @typescript-eslint/parser.
The file was not found in any of the provided project(s): packages/create/tests/framework-template.test.ts
1 others
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.
These expectations would still pass if main.tsx imported RouterProvider from the wrong framework package. Adding that assertion closes the cross-framework contract gap.
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
In `@packages/create/tests/framework-template.test.ts` around lines 73 - 99, The
router-only entry test in framework-template.test.ts is missing an assertion for
the RouterProvider import source, so it could still pass with the wrong
framework package. Update the renderRouterOnlyEntries expectations in the shared
router factory test to also verify the main entry imports RouterProvider from
the correct framework-specific package, alongside the existing getRouter,
createRouter, and declare module checks.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Nitpick comments:
In `@packages/create/tests/framework-template.test.ts`:
- Around line 73-99: The router-only entry test in framework-template.test.ts is
missing an assertion for the RouterProvider import source, so it could still
pass with the wrong framework package. Update the renderRouterOnlyEntries
expectations in the shared router factory test to also verify the main entry
imports RouterProvider from the correct framework-specific package, alongside
the existing getRouter, createRouter, and declare module checks.
ℹ️ Review info⚙️ Run configuration
Configuration used: defaults
Review profile: CHILL
Plan: Pro
Run ID: ffe9213f-35bd-4052-9e3d-b73028fe98b1
📥 Commits
Reviewing files that changed from the base of the PR and between 12c31df and 5837032.
The Query repair is now pushed for both frameworks. Generated-app checks and the normal local gates passed at b99bf94, and this updated head is waiting for CI and review.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
React and Solid router-only apps now call the shared
getRouter()factory, so router customizations apply and theRegisterdeclaration stays in one place.Adding Query to either framework wraps the router with its browser Query provider and uses the same query client as router context. React router-only output no longer imports the Start SSR integration. The add command also lets pnpm update the lockfile after intentionally changing dependencies, including in CI.
Validation:
Fixes #480 and #522.
Summary by CodeRabbit