Skip to content

docs: solid start ssr#562

Merged
dinwwwh merged 4 commits into
mainfrom
docs/solid-start-ssr
May 28, 2025
Merged

docs: solid start ssr#562
dinwwwh merged 4 commits into
mainfrom
docs/solid-start-ssr

Conversation

@dinwwwh
Copy link
Copy Markdown
Member

@dinwwwh dinwwwh commented May 28, 2025

Summary by CodeRabbit

  • Documentation
    • Improved integration guides for Next.js, Solid Start, and TanStack Start, including clearer examples, missing import statements, and enhanced SSR optimization instructions.
    • Updated Solid Start documentation with new sections for server/client setup and SSR optimization tips.
  • New Features
    • Added support for the HTTP HEAD method in Solid Start server routes.
    • Introduced server-side ORPC client setup for optimized SSR in Solid Start playground.
  • Bug Fixes
    • Fixed missing imports in integration documentation examples to ensure code snippets work as intended.
    • Corrected minor typos in documentation for better clarity.
  • Chores
    • Upgraded various dependencies, including TanStack Query packages and related libraries, to the latest versions.
    • Added new development dependencies and configuration for top-level await support in Solid Start playground.
  • Style
    • Improved loading UI and simplified query/mutation hooks usage in Solid Start playground components.

@vercel
Copy link
Copy Markdown

vercel Bot commented May 28, 2025

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
orpc ✅ Ready (Inspect) Visit Preview 💬 Add feedback May 28, 2025 0:56am

@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented May 28, 2025

Caution

Review failed

The pull request is closed.

Walkthrough

This update revises integration documentation and code examples for Next.js, Solid Start, and TanStack Start to add missing RPCLink imports and enhance SSR optimization guidance. It also updates several TanStack query dependencies across packages and playgrounds, refines Solid Start’s SSR client setup, and simplifies certain Solid query hooks and UI logic.

Changes

Files/Paths Change Summary
apps/content/docs/integrations/next.md
apps/content/docs/integrations/tanstack-start.md
Added missing RPCLink import statements in code examples; fixed minor typos.
apps/content/docs/integrations/solid-start.md Updated documentation for clarity; renamed sections; added SSR optimization guidance and code; exported HTTP HEAD.
apps/content/package.json
packages/react-query/package.json
packages/solid-query/package.json
packages/svelte-query/package.json
packages/tanstack-query/package.json
packages/vue-query/package.json
playgrounds/electron/package.json
playgrounds/nuxt/package.json
playgrounds/solid-start/package.json
playgrounds/svelte-kit/package.json
playgrounds/tanstack-start/package.json
Updated TanStack query and related dependencies to ^5.77.2; updated vinxi and added vite-plugin-top-level-await where needed.
playgrounds/solid-start/app.config.ts Added vite-plugin-top-level-await to Vite plugins in app config.
playgrounds/solid-start/src/app.tsx Moved queryClient instantiation inside App; enabled experimental_prefetchInRender; added loading fallback.
playgrounds/solid-start/src/lib/orpc.server.ts Introduced server-only global ORPC client instance for SSR optimization.
playgrounds/solid-start/src/lib/orpc.ts Added environment-aware client setup; dynamic header extraction; global client reuse; renamed link variable.
playgrounds/solid-start/src/routes/orpc-mutation.tsx Switched from createMutation to useMutation hook.
playgrounds/solid-start/src/routes/orpc-query.tsx Replaced createInfiniteQuery with useInfiniteQuery; removed conditional UI rendering; simplified component logic.
playgrounds/solid-start/src/routes/rpc/[...rest].ts Simplified context logic; always assigns fixed user; exported HTTP HEAD handler.
apps/content/.vitepress/config.ts Changed sidebar label from "SolidStart" to "Solid Start" without altering the link.

Sequence Diagram(s)

sequenceDiagram
    participant Browser
    participant orpc.ts
    participant orpc.server.ts
    participant Server

    Browser->>orpc.ts: Import client
    alt Browser environment
        orpc.ts->>orpc.ts: Use createORPCClient(link)
    else Server environment (SSR)
        orpc.ts->>orpc.server.ts: Import global $client
        orpc.server.ts->>Server: Create RouterClient with SSR context
        orpc.server.ts-->>orpc.ts: Assign globalThis.$client
        orpc.ts->>orpc.ts: Use globalThis.$client
    end
    orpc.ts-->>Browser: Export client instance
Loading

Possibly related PRs

  • unnoq/orpc#488: Adds Next.js SSR integration docs and client setup, similar to the current PR's documentation and SSR enhancements.
  • unnoq/orpc#421: Adds detailed SSR optimization docs and code for Solid Start, closely related to this PR's Solid Start SSR improvements.
  • unnoq/orpc#231: Modifies RPCLink URL construction in Solid Start, related through changes to RPCLink usage and configuration.

Poem

A rabbit hopped through docs and code,
Adding links so imports showed.
SSR now runs with cheer,
With global clients always near.
Query hooks got a tidy sweep,
And dependencies took a leap!
🐇✨


📜 Recent review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between a74795f and 274c902.

📒 Files selected for processing (4)
  • apps/content/.vitepress/config.ts (1 hunks)
  • apps/content/docs/integrations/next.md (2 hunks)
  • apps/content/docs/integrations/solid-start.md (3 hunks)
  • apps/content/docs/integrations/tanstack-start.md (2 hunks)
✨ Finishing Touches
  • 📝 Generate Docstrings

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.

❤️ Share
🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Explain this complex logic.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai explain this code block.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read src/utils.ts and explain its main purpose.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

Support

Need help? Create a ticket on our support page for assistance with any issues or questions.

Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.

CodeRabbit Commands (Invoked using PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai generate docstrings to generate docstrings for this PR.
  • @coderabbitai generate sequence diagram to generate a sequence diagram of the changes in this PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

@codecov
Copy link
Copy Markdown

codecov Bot commented May 28, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

📢 Thoughts on this report? Let us know!

@pkg-pr-new
Copy link
Copy Markdown

pkg-pr-new Bot commented May 28, 2025

More templates

@orpc/arktype

npm i https://pkg.pr.new/@orpc/arktype@562

@orpc/client

npm i https://pkg.pr.new/@orpc/client@562

@orpc/contract

npm i https://pkg.pr.new/@orpc/contract@562

@orpc/hey-api

npm i https://pkg.pr.new/@orpc/hey-api@562

@orpc/nest

npm i https://pkg.pr.new/@orpc/nest@562

@orpc/openapi

npm i https://pkg.pr.new/@orpc/openapi@562

@orpc/openapi-client

npm i https://pkg.pr.new/@orpc/openapi-client@562

@orpc/react

npm i https://pkg.pr.new/@orpc/react@562

@orpc/react-query

npm i https://pkg.pr.new/@orpc/react-query@562

@orpc/server

npm i https://pkg.pr.new/@orpc/server@562

@orpc/shared

npm i https://pkg.pr.new/@orpc/shared@562

@orpc/solid-query

npm i https://pkg.pr.new/@orpc/solid-query@562

@orpc/standard-server

npm i https://pkg.pr.new/@orpc/standard-server@562

@orpc/standard-server-aws-lambda

npm i https://pkg.pr.new/@orpc/standard-server-aws-lambda@562

@orpc/standard-server-fetch

npm i https://pkg.pr.new/@orpc/standard-server-fetch@562

@orpc/standard-server-node

npm i https://pkg.pr.new/@orpc/standard-server-node@562

@orpc/standard-server-peer

npm i https://pkg.pr.new/@orpc/standard-server-peer@562

@orpc/svelte-query

npm i https://pkg.pr.new/@orpc/svelte-query@562

@orpc/tanstack-query

npm i https://pkg.pr.new/@orpc/tanstack-query@562

@orpc/valibot

npm i https://pkg.pr.new/@orpc/valibot@562

@orpc/vue-colada

npm i https://pkg.pr.new/@orpc/vue-colada@562

@orpc/vue-query

npm i https://pkg.pr.new/@orpc/vue-query@562

@orpc/zod

npm i https://pkg.pr.new/@orpc/zod@562

commit: 274c902

Copy link
Copy Markdown

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 2

🧹 Nitpick comments (2)
apps/content/docs/integrations/solid-start.md (2)

8-8: Fix compound adjective hyphenation.

-[SolidStart](https://start.solidjs.com/) is a full stack JavaScript framework for building web applications with SolidJS.
+[SolidStart](https://start.solidjs.com/) is a full-stack JavaScript framework for building web applications with SolidJS.
🧰 Tools
🪛 LanguageTool

[uncategorized] ~8-~8: If this is a compound adjective that modifies the following noun, use a hyphen.
Context: ...Start](https://start.solidjs.com/) is a full stack JavaScript framework for building web a...

(EN_COMPOUND_ADJECTIVE_INTERNAL)


67-67: Fix grammatical error in article usage.

-To reduce HTTP requests and improve latency during SSR, you can utilize a [Server-Side Client](/docs/client/server-side) during SSR. Below is a quick setup, see [Optimize SSR](/docs/best-practices/optimize-ssr) for a more details.
+To reduce HTTP requests and improve latency during SSR, you can utilize a [Server-Side Client](/docs/client/server-side) during SSR. Below is a quick setup, see [Optimize SSR](/docs/best-practices/optimize-ssr) for more details.
🧰 Tools
🪛 LanguageTool

[grammar] ~67-~67: The plural noun “details” cannot be used with the article “a”. Did you mean “a more detail” or “more details”?
Context: ...(/docs/best-practices/optimize-ssr) for a more details. ::: code-group ```ts [src/lib/orpc.t...

(A_NNS)

📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between b653f83 and a74795f.

⛔ Files ignored due to path filters (1)
  • pnpm-lock.yaml is excluded by !**/pnpm-lock.yaml
📒 Files selected for processing (21)
  • apps/content/docs/integrations/next.md (1 hunks)
  • apps/content/docs/integrations/solid-start.md (3 hunks)
  • apps/content/docs/integrations/tanstack-start.md (1 hunks)
  • apps/content/package.json (1 hunks)
  • packages/react-query/package.json (1 hunks)
  • packages/solid-query/package.json (1 hunks)
  • packages/svelte-query/package.json (1 hunks)
  • packages/tanstack-query/package.json (1 hunks)
  • packages/vue-query/package.json (1 hunks)
  • playgrounds/electron/package.json (1 hunks)
  • playgrounds/nuxt/package.json (1 hunks)
  • playgrounds/solid-start/app.config.ts (1 hunks)
  • playgrounds/solid-start/package.json (1 hunks)
  • playgrounds/solid-start/src/app.tsx (1 hunks)
  • playgrounds/solid-start/src/lib/orpc.server.ts (1 hunks)
  • playgrounds/solid-start/src/lib/orpc.ts (1 hunks)
  • playgrounds/solid-start/src/routes/orpc-mutation.tsx (1 hunks)
  • playgrounds/solid-start/src/routes/orpc-query.tsx (2 hunks)
  • playgrounds/solid-start/src/routes/rpc/[...rest].ts (3 hunks)
  • playgrounds/svelte-kit/package.json (1 hunks)
  • playgrounds/tanstack-start/package.json (1 hunks)
🧰 Additional context used
🧬 Code Graph Analysis (1)
playgrounds/solid-start/src/routes/rpc/[...rest].ts (2)
playgrounds/solid-start/src/routes/api/index.ts (1)
  • HEAD (3-3)
playgrounds/solid-start/src/routes/api/[...rest].ts (2)
  • HEAD (62-62)
  • handle (49-60)
🪛 LanguageTool
apps/content/docs/integrations/solid-start.md

[uncategorized] ~8-~8: If this is a compound adjective that modifies the following noun, use a hyphen.
Context: ...Start](https://start.solidjs.com/) is a full stack JavaScript framework for building web a...

(EN_COMPOUND_ADJECTIVE_INTERNAL)


[grammar] ~67-~67: The plural noun “details” cannot be used with the article “a”. Did you mean “a more detail” or “more details”?
Context: ...(/docs/best-practices/optimize-ssr) for a more details. ::: code-group ```ts [src/lib/orpc.t...

(A_NNS)

⏰ Context from checks skipped due to timeout of 90000ms (2)
  • GitHub Check: lint
  • GitHub Check: publish-commit
🔇 Additional comments (32)
playgrounds/tanstack-start/package.json (1)

30-30: Align vinxi version for consistency
The devDependency vinxi was bumped from ^0.5.4 to ^0.5.6 to match other playgrounds. Ensure this patch upgrade does not introduce breaking changes and remember to update the lockfile accordingly.

packages/svelte-query/package.json (1)

49-49: Bump @tanstack/svelte-query to ^5.77.2
Updated the devDependency from ^5.72.3 for uniformity across the monorepo. Please verify compatibility with existing code and update your lockfile.

playgrounds/nuxt/package.json (1)

18-18: Update @tanstack/vue-query to ^5.77.2
The @tanstack/vue-query devDependency was aligned with the monorepo standard. Confirm that this bump does not affect Nuxt integration and that the lockfile reflects the change.

packages/vue-query/package.json (1)

49-49: Sync @tanstack/vue-query version
Upgraded the devDependency to ^5.77.2 to stay in step with sibling packages. Double-check for any breaking changes and regenerate the lockfile.

packages/react-query/package.json (1)

49-49: Upgrade @tanstack/react-query to ^5.77.2
Bumped the devDependency to maintain consistency across all query packages. Verify compatibility with peer dependencies and update the lockfile.

playgrounds/electron/package.json (1)

24-24: Consistent dependency upgrade of @tanstack/react-query
Updated @tanstack/react-query from ^5.72.3 to ^5.77.2 to align with the rest of the TanStack packages in the repo.

packages/solid-query/package.json (1)

49-49: Consistent dependency upgrade of @tanstack/solid-query
Bumped @tanstack/solid-query to ^5.77.2 in devDependencies to match other query packages.

playgrounds/svelte-kit/package.json (1)

23-23: Consistent dependency upgrade of @tanstack/svelte-query
Updated @tanstack/svelte-query to ^5.77.2 for consistency with related packages.

packages/tanstack-query/package.json (1)

44-44: Consistent dependency upgrade of @tanstack/query-core
Bumped @tanstack/query-core to ^5.77.2 to stay in sync with other TanStack dependencies.

apps/content/package.json (1)

27-29: Consistent dependency upgrades for TanStack query integrations
Updated the following devDependencies to ^5.77.2 for alignment:

  • @tanstack/solid-query
  • @tanstack/svelte-query
  • @tanstack/vue-query
apps/content/docs/integrations/tanstack-start.md (1)

59-59: LGTM! Missing import added correctly.

This import statement fixes the previously broken code example by providing the necessary RPCLink import for the instantiation on line 63.

playgrounds/solid-start/src/lib/orpc.server.ts (2)

5-7: Good defensive programming practice.

The browser check prevents accidental import in client-side code, which would cause runtime errors since this module is designed specifically for server-side SSR optimization.


14-29:

Details

✅ Verification successful

Verify global client management and memory implications.

The global client setup is appropriate for SSR optimization, but consider the following:

  1. The async context function is called per-request, which is correct
  2. The global client instance is shared across requests, which is intentional for performance

However, verify that this pattern doesn't lead to memory leaks or context bleeding between requests.


🏁 Script executed:

#!/bin/bash
# Description: Check for similar global client patterns in the codebase
# Expected: Find other examples of globalThis usage for SSR clients

echo "Searching for globalThis client patterns..."
rg -A 5 -B 5 'globalThis\.\$client'

echo "Searching for createRouterClient usage patterns..."
rg -A 10 'createRouterClient.*context.*async'

Length of output: 9002


Global client management is correct

The createRouterClient call in orpc.server.ts matches the documented SSR-optimization pattern:

  • The async context callback is invoked on each request, sourcing only the per-request headers.
  • No mutable state is preserved on the client between invocations, so there’s no risk of memory leaks or context bleeding.

No changes required.

playgrounds/solid-start/package.json (2)

21-21:

Details

✅ Verification successful

Ensure vite-plugin-top-level-await is properly configured.

The new vite-plugin-top-level-await dependency suggests support for top-level await syntax. Verify that this plugin is properly configured in the Vite configuration files.


🏁 Script executed:

#!/bin/bash
# Description: Check if vite-plugin-top-level-await is configured in Vite config
# Expected: Find configuration in vite.config or app.config files

echo "Searching for Vite configuration files..."
fd -e ts -e js "vite.config|app.config" .

echo "Searching for top-level-await plugin usage..."
rg -A 5 -B 5 "top-level-await"

Length of output: 3925


Configuration Verified: vite-plugin-top-level-await

The vite-plugin-top-level-await package is imported and invoked in the Vite config:

  • File: playgrounds/solid-start/app.config.ts
    import topLevelAwait from 'vite-plugin-top-level-await'
    
    export default defineConfig({
      vite: {
        plugins: [
          topLevelAwait(),
          // …
        ]
      }
    })

No further action is needed.


18-18:

Details

✅ Verification successful

Verify the TanStack Solid Query version compatibility.

The version bump to ^5.77.2 should be verified for compatibility with the current codebase and other dependencies.


🌐 Web query:

What is the latest version of @tanstack/solid-query and are there any breaking changes in version 5.77.2?

💡 Result:

The latest version of @tanstack/solid-query is 5.77.2, which was published one day ago according to the NPM package information[3].

Looking at the recent releases of TanStack Query, there's no specific information indicating breaking changes in version 5.77.2. The most recent releases documented are:

  • Version 5.77.0 (May 24, 2025) which included:
    • New feature: maxChunks
    • Some chore changes related to removing ts-node and baseUrl from tsConfig
    • Test cases and documentation fixes[1]

Prior to that was version 5.76.1 (May 13, 2025) which contained fixes for experimental_createQueryPersister[1].

TanStack Query v5 as a whole (compared to v4) did introduce several breaking changes which apply to all framework versions including Solid Query:

  1. API signature changes - only object format is now supported for useQuery and related functions
  2. Removal of isDataEqual in favor of structuralSharing
  3. Removal of custom loggers
  4. Updated browserslist for more modern, performant bundles
  5. Changes to hydration APIs (renaming Hydrate to HydrationBoundary, removal of useHydrate)[6][7][9]

For Solid Query specifically, there were framework-specific changes in v5, but there's no indication of new breaking changes specific to the 5.77.2 release based on the available search results.

If you're migrating from an earlier version of TanStack Query to v5.x, you should review the migration guides to understand the full scope of changes that might affect your application.

Citations:


🏁 Script executed:

#!/bin/bash
rg "vite-plugin-top-level-await" -n

Length of output: 487


🏁 Script executed:

#!/bin/bash
sed -n '1,200p' playgrounds/solid-start/app.config.ts

Length of output: 256


Approve dependency updates

  • The @tanstack/solid-query entry in playgrounds/solid-start/package.json is now ^5.77.2, which is the latest published version and introduces no new breaking changes beyond the established v5 migration considerations.
  • The new dev dependency vite-plugin-top-level-await (^1.5.0) is correctly imported and registered in playgrounds/solid-start/app.config.ts under the Vite plugins array.

No further action required.

apps/content/docs/integrations/next.md (1)

97-97: LGTM! Consistent documentation fix.

This import addition matches the same fix applied to the TanStack Start documentation, ensuring code examples are functional and consistent across all integration guides.

playgrounds/solid-start/src/app.tsx (1)

20-22: Good improvement to user experience.

Adding a loading fallback to the Suspense component provides better UX during navigation and data loading states.

playgrounds/solid-start/src/routes/orpc-mutation.tsx (2)

7-7: Hook usage updated consistently with import.

The usage is correctly updated to match the new import.


2-2:

Details

✅ Verification successful

Verify API compatibility with TanStack Solid Query version.

The migration from createMutation to useMutation looks correct, but please ensure this aligns with the version of @tanstack/solid-query being used in the project.


🏁 Script executed:

#!/bin/bash
# Check the TanStack Solid Query version and verify the useMutation API exists
cat playgrounds/solid-start/package.json | jq '.dependencies["@tanstack/solid-query"]'

# Search for other usages of createMutation to ensure consistency
rg "createMutation" --type ts --type tsx

Length of output: 162


#!/bin/bash

Search all package.json files for @tanstack/solid-query to locate its version

rg '"@tanstack/solid-query"' -n --glob '*package.json'

Check the root package.json for the dependency or devDependency

cat package.json | jq '.dependencies["@tanstack/solid-query"], .devDependencies["@tanstack/solid-query"]'

Search for any remaining usages of createMutation in .ts/.tsx files

rg "createMutation" -g '.ts' -g '.tsx'


🏁 Script executed:

#!/bin/bash
# 1. Locate all package.json files declaring @tanstack/solid-query and print the version
rg '"@tanstack/solid-query"' -n --glob '*package.json'
echo
for pkg in $(rg '"@tanstack/solid-query"' -l --glob '*package.json'); do
  version=$(jq -r '.dependencies["@tanstack/solid-query"] // .devDependencies["@tanstack/solid-query"]' "$pkg")
  echo "Found in $pkg → @tanstack/solid-query@$version"
done

# 2. Search for any remaining createMutation usages in .ts/.tsx files
rg "createMutation" -n --glob '*.ts' --glob '*.tsx'

Length of output: 3516


🏁 Script executed:

#!/bin/bash
# Verify that `useMutation` is implemented in the Solid Query source
rg "useMutation" -n packages/solid-query/src

# Specifically look for its export
rg "export.*useMutation" -n packages/solid-query/src

Length of output: 553


API compatibility confirmed: useMutation is available in Solid Query v5.77.2

All instances of @tanstack/solid-query across the repo are pinned to ^5.77.2, and the useMutation hook is already imported and exercised in the existing tests (e.g. packages/solid-query/src/procedure-utils.test-d.ts). No further action is needed.

• Dependencies in packages/solid-query, playgrounds/solid-start, and apps/content all resolve to ^5.77.2
• Tests successfully import and invoke useMutation, demonstrating its export and functionality

playgrounds/solid-start/src/routes/rpc/[...rest].ts (3)

5-5: Import reordering is acceptable.

Moving the polyfill import after the onError import doesn't affect functionality.


26-26: Good addition for HTTP method completeness.

Adding the HEAD export maintains consistency with other route handlers and follows REST conventions.


16-16:

Details

❓ Verification inconclusive

Verify if removing authentication logic is intentional.

The context assignment was simplified to always provide a fixed user object, removing the conditional check for the Authorization header. This removes authentication logic from the demo.

Is this change intentional for simplifying the demo, or should authentication logic be preserved?


🏁 Script executed:

#!/bin/bash
# Check if other route handlers have similar authentication patterns
rg -A 5 -B 5 "Authorization.*header" --type ts

Length of output: 48


🏁 Script executed:

#!/bin/bash
# Inspect the beginning of the RPC handler to verify any removed auth logic
sed -n '1,200p' playgrounds/solid-start/src/routes/rpc/\[\.\.\.rest\].ts

# Search within this handler for any header-based auth checks
rg -i "authorization" -A5 -B5 playgrounds/solid-start/src/routes/rpc/\[\.\.\.rest\].ts

# Search all route handlers in this playground for auth-related patterns
rg -i "auth" -A5 -B5 playgrounds/solid-start/src/routes

Length of output: 3624


Confirm RPC handler authentication removal
The RPC endpoint (playgrounds/solid-start/src/routes/rpc/[...rest].ts) now always injects a fixed user object into context, whereas the API handler (playgrounds/solid-start/src/routes/api/[...rest].ts) still guards on the Authorization header.

• File: playgrounds/solid-start/src/routes/rpc/[...rest].ts
• Line: context assignment

Should this unconditional user context be intentional for a simplified demo?

  • If yes, please add a comment or README note explaining that auth is omitted here.
  • If not, restore the header check (e.g. request.headers.get('Authorization') ? { user: … } : {}) to align with the API routes.
playgrounds/solid-start/app.config.ts (1)

2-10:

Details

✅ Verification successful

Configuration looks correct for enabling top-level await support.

The addition of the vite-plugin-top-level-await plugin properly enables top-level await syntax, which supports the SSR optimizations mentioned in the PR objectives.

Please verify that the plugin dependency is properly installed:


🏁 Script executed:

#!/bin/bash
# Check if vite-plugin-top-level-await is listed in dependencies
cat playgrounds/solid-start/package.json | jq '.dependencies["vite-plugin-top-level-await"] // .devDependencies["vite-plugin-top-level-await"]'

Length of output: 154


Plugin dependency verified and configuration approved

I confirmed that vite-plugin-top-level-await@^1.5.0 is listed in playgrounds/solid-start/package.json. The Vite configuration is correct—ready to merge.

playgrounds/solid-start/src/routes/orpc-query.tsx (1)

1-1: Hook import change looks correct.

The change from createInfiniteQuery to useInfiniteQuery aligns with the TanStack Solid Query API updates.

apps/content/docs/integrations/solid-start.md (4)

2-3: Documentation improvements look good.

The updated title and description provide better clarity about the integration purpose.


29-29: Good addition of HEAD method support.

Adding the HEAD method export ensures complete HTTP method coverage for the RPC handler.


47-63: Excellent client configuration guidance.

The new Client section provides clear instructions for setting up RPCLink with SSR-compatible header forwarding using getRequestEvent.


65-126: Comprehensive SSR optimization documentation.

The new "Optimize SSR" section provides valuable guidance for reducing HTTP requests during SSR. The code examples are well-structured and follow best practices for server-side client reuse.

🧰 Tools
🪛 LanguageTool

[grammar] ~67-~67: The plural noun “details” cannot be used with the article “a”. Did you mean “a more detail” or “more details”?
Context: ...(/docs/best-practices/optimize-ssr) for a more details. ::: code-group ```ts [src/lib/orpc.t...

(A_NNS)

playgrounds/solid-start/src/lib/orpc.ts (4)

1-3: Excellent SSR optimization setup.

The conditional import ensures the server-side client is only loaded in the appropriate environment, preventing browser-side imports of server-only code.


12-14: Good global type declaration.

The global variable declaration properly types the shared client instance for SSR optimization.


18-18: Smart dynamic header forwarding.

Using getRequestEvent() to extract headers dynamically enables proper request context forwarding in both SSR and client environments.


21-21: Well-implemented client fallback pattern.

The fallback from global server client to client-side client ensures optimal performance during SSR while maintaining functionality in client-only scenarios.

Comment on lines +7 to +13
const queryClient = new QueryClient({
defaultOptions: {
queries: {
experimental_prefetchInRender: true,
},
},
})
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue

Move QueryClient instantiation outside the component to prevent recreation on each render.

The QueryClient is being instantiated inside the App component, which means a new instance will be created on every render. This can lead to performance issues and loss of cached data.

+const queryClient = new QueryClient({
+  defaultOptions: {
+    queries: {
+      experimental_prefetchInRender: true,
+    },
+  },
+})
+
 export default function App() {
-  const queryClient = new QueryClient({
-    defaultOptions: {
-      queries: {
-        experimental_prefetchInRender: true,
-      },
-    },
-  })
-
   return (
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
const queryClient = new QueryClient({
defaultOptions: {
queries: {
experimental_prefetchInRender: true,
},
},
})
const queryClient = new QueryClient({
defaultOptions: {
queries: {
experimental_prefetchInRender: true,
},
},
})
export default function App() {
return (
/* ... */
🤖 Prompt for AI Agents
In playgrounds/solid-start/src/app.tsx around lines 7 to 13, the QueryClient is
instantiated inside the component, causing it to be recreated on every render.
To fix this, move the QueryClient instantiation outside the component function
so that the same instance is reused across renders, preserving cache and
improving performance.

Comment thread playgrounds/solid-start/src/routes/orpc-query.tsx
@dinwwwh dinwwwh merged commit fd6982a into main May 28, 2025
4 of 5 checks passed
@coderabbitai coderabbitai Bot mentioned this pull request Jun 3, 2025
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