Skip to content

Add missing imports to docs for server-components#6545

Merged
juliusmarminge merged 4 commits into
trpc:nextfrom
haldunanil:patch-1
Feb 23, 2025
Merged

Add missing imports to docs for server-components#6545
juliusmarminge merged 4 commits into
trpc:nextfrom
haldunanil:patch-1

Conversation

@haldunanil

@haldunanil haldunanil commented Feb 22, 2025

Copy link
Copy Markdown
Contributor

🎯 Changes

This PR adds a missing import to the docs to clarify usage.

✅ Checklist

  • I have followed the steps listed in the Contributing guide.
  • If necessary, I have added documentation related to the changes made.
  • I have added or updated the tests related to the changes made.

Summary by CodeRabbit

  • New Features
    • Enhanced typesafe operations and context management for improved API integration.
    • Updated data fetching method in the ClientGreeting component for better performance.
  • Documentation
    • Updated documentation to reflect the latest integration features and usage.

@haldunanil haldunanil requested a review from a team as a code owner February 22, 2025 19:20
@vercel

vercel Bot commented Feb 22, 2025

Copy link
Copy Markdown

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

Name Status Preview Comments Updated (UTC)
www ✅ Ready (Inspect) Visit Preview 💬 Add feedback Feb 22, 2025 7:33pm

@vercel

vercel Bot commented Feb 22, 2025

Copy link
Copy Markdown

@haldunanil is attempting to deploy a commit to the trpc Team on Vercel.

A member of the Team first needs to authorize it.

@coderabbitai

coderabbitai Bot commented Feb 22, 2025

Copy link
Copy Markdown
Contributor

Walkthrough

This pull request introduces an import for createTRPCContext from the @trpc/tanstack-react-query package into the trpc/client.tsx file. This change facilitates the creation of typesafe hooks and context providers for the tRPC API. Additionally, the ClientGreeting function is updated to utilize the useQuery hook from @tanstack/react-query, modifying how data fetching is performed while maintaining the overall structure of the component.

Changes

File(s) Change Summary
trpc/client.tsx Added an import for createTRPCContext from @trpc/tanstack-react-query to enhance tRPC context creation.
app/client-greeting.tsx Updated ClientGreeting to use useQuery instead of trpc.hello.useQuery, changing how the greeting variable is assigned.

Possibly related PRs

Suggested labels

♻️ autoupdate

Suggested reviewers

  • juliusmarminge
  • KATT

Poem

Hoppity-hop, I've leaped into code delight,
Bringing a context so nimble and bright.
With a twitch of my nose and a skip in the flow,
createTRPCContext now makes our hooks glow.
From bunny to coder, I celebrate this day—
A joyful hop in the tech burrow at play!
(_/)
(='.'=)
(")
(")


📜 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 b812dd0 and 6c39901.

📒 Files selected for processing (1)
  • www/docs/client/tanstack-react-query/server-components.mdx (2 hunks)
🚧 Files skipped from review as they are similar to previous changes (1)
  • www/docs/client/tanstack-react-query/server-components.mdx
⏰ Context from checks skipped due to timeout of 90000ms (3)
  • GitHub Check: build
  • GitHub Check: test
  • GitHub Check: Lint and auto-fix

Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media?

❤️ 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.
    • Generate unit testing code for this file.
    • 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 generate unit testing code for this file.
    • @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 generate unit testing code.
    • @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.

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. (Beta)
  • @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.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Actionable comments posted: 0

🧹 Nitpick comments (1)
www/docs/client/tanstack-react-query/server-components.mdx (1)

173-173: Ensure Consistent Quote Usage in the New Import

The newly added import

import { createTRPCContext } from "@trpc/tanstack-react-query";

correctly provides the missing context function for type-safe hook and provider creation, which aligns with the PR objectives. However, note that the rest of the file uses single quotes for import statements. For consistency throughout the codebase, please consider switching to single quotes. For example:

- import { createTRPCContext } from "@trpc/tanstack-react-query";
+ import { createTRPCContext } from '@trpc/tanstack-react-query';
📜 Review details

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

📥 Commits

Reviewing files that changed from the base of the PR and between 1eccc11 and 2d3a1b2.

📒 Files selected for processing (1)
  • www/docs/client/tanstack-react-query/server-components.mdx (1 hunks)
⏰ Context from checks skipped due to timeout of 90000ms (20)
  • GitHub Check: E2E-tests (fastify-server)
  • GitHub Check: E2E-tests (express-server)
  • GitHub Check: E2E-tests (express-minimal)
  • GitHub Check: e2e-legacy-node (next-prisma-todomvc, 20.x)
  • GitHub Check: E2E-tests (cloudflare-workers)
  • GitHub Check: e2e-legacy-node (next-prisma-todomvc, 18.x)
  • GitHub Check: E2E-tests (.test/ssg)
  • GitHub Check: e2e-legacy-node (next-prisma-websockets-starter, 20.x)
  • GitHub Check: E2E-tests (.test/internal-types-export)
  • GitHub Check: Release using pkg.pr.new
  • GitHub Check: e2e-legacy-node (next-prisma-websockets-starter, 18.x)
  • GitHub Check: E2E-tests (.test/diagnostics-big-router)
  • GitHub Check: e2e-legacy-node (next-prisma-starter, 20.x)
  • GitHub Check: Test a monorepo using built declaration files
  • GitHub Check: E2E-tests (.experimental/next-app-dir)
  • GitHub Check: e2e-legacy-node (next-prisma-starter, 18.x)
  • GitHub Check: E2E-tests (Deno) (deno-deploy)
  • GitHub Check: E2E-tests (Bun) (bun, ubuntu-latest)
  • GitHub Check: test
  • GitHub Check: Lint and auto-fix

@pkg-pr-new

pkg-pr-new Bot commented Feb 22, 2025

Copy link
Copy Markdown

Open in Stackblitz

@trpc/client

npm i https://pkg.pr.new/trpc/trpc/@trpc/client@6545

@trpc/next

npm i https://pkg.pr.new/trpc/trpc/@trpc/next@6545

@trpc/react-query

npm i https://pkg.pr.new/trpc/trpc/@trpc/react-query@6545

@trpc/server

npm i https://pkg.pr.new/trpc/trpc/@trpc/server@6545

@trpc/tanstack-react-query

npm i https://pkg.pr.new/trpc/trpc/@trpc/tanstack-react-query@6545

@trpc/upgrade

npm i https://pkg.pr.new/trpc/trpc/@trpc/upgrade@6545

commit: 6c39901

@haldunanil haldunanil changed the title Add missing import to docs for server-components Add missing imports to docs for server-components Feb 22, 2025
@github-actions

Copy link
Copy Markdown
Contributor

This pull request has been locked because we are very unlikely to see comments on closed issues. If you think, this PR is still necessary, create a new one with the same branch. Thank you.

@github-actions github-actions Bot locked as resolved and limited conversation to collaborators Feb 24, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants