Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

docs: improve comparison for tRPC #282

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

Nick-Lucas
Copy link

@Nick-Lucas Nick-Lucas commented Mar 21, 2025

Updated comparison table to more accurately reflect what tRPC can do.

Right now it makes an assumption that being coupled in several areas leads to tRPC being worse in those areas, whereas tRPC does provide out the box support but allows you to choose the library (ie. for transformers, cors) you use.

tRPC is mounted inside an adapter which may be a native http module or an adapter inside of express or many other web servers, this means CORS is natively supported but at the adapter level rather than trying to handle that itself

Things like Lazy routers are actually more recent additions so this is a timely update there :)

Summary by CodeRabbit

Summary by CodeRabbit

  • Documentation
    • Updated the support table to reflect improved feature support for tRPC. Now, several functionalities such as end-to-end error typesafety, file/blob typesafety, server actions, lazy routing, native types support, and plugin integration are marked as supported.
    • Adjusted the status for dedicated schemas to indicate they are not applicable.

Copy link

vercel bot commented Mar 21, 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 Mar 22, 2025 9:12am

Copy link

coderabbitai bot commented Mar 21, 2025

Walkthrough

The pull request updates a documentation file by modifying the feature support table. The changes adjust the statuses for various tRPC functionalities, such as end-to-end errors and file/blob typesafe, server actions support, lazy routing, native types, plugins, dedicated Zod schemas, and usage of native modules. No public exports were altered.

Changes

File(s) Change Summary
apps/.../comparison.md Updated tRPC status indicators in the feature comparison table:
- End-to-end Errors Typesafe: 🛑 → ✅
- End-to-end File/Blob Typesafe: 🛑 → ✅
- Server Actions: 🟡 → ✅
- Lazy Router: 🛑 → ✅
- Native Types: 🟡 → ✅
- Plugins support: 🛑 → ✅
- Dedicated Zod Schemas: 🛑 → N/A
- Use Native Modules: 🟡 → ✅

Possibly related PRs


🪧 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.
  • @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.

@unnoq
Copy link
Owner

unnoq commented Mar 22, 2025

Thank you, @Nick-Lucas, for your openness on this issue. However, I have a few points of disagreement in this PR:

  • End-to-End Errors Typesafe: 🛑

If I remember correctly, tRPC not support something like this:
https://orpc.unnoq.com/docs/client/error-handling#using-safe-and-isdefinederror
https://orpc.unnoq.com/docs/error-handling#type%E2%80%90safe-error-handling

  • End-to-End File/Blob Typesafe: 🛑

tRPC only displays data as form-data and does not show actual File/Blob instances.

@unnoq unnoq changed the title Update comparison.md with more accurate representation of tRPC docs: improve comparison for tRPC Mar 22, 2025
Copy link

codecov bot commented Mar 22, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

📢 Thoughts on this report? Let us know!

@Nick-Lucas
Copy link
Author

Thank you, @Nick-Lucas, for your openness on this issue. However, I have a few points of disagreement in this PR:

  • End-to-End Errors Typesafe: 🛑

If I remember correctly, tRPC not support something like this: https://orpc.unnoq.com/docs/client/error-handling#using-safe-and-isdefinederror https://orpc.unnoq.com/docs/error-handling#type%E2%80%90safe-error-handling

I think we have two separate approaches, but the tRPC errorFormatter definitely would allow you to include a type like RatedLimited in a union. The errorFormatter result is global though, no route-level error types. I do think it's wrong to say we don't support type-safe errors, but you might argue oRPC's model is more powerful so I would be happy to change to 🟡 on the basis that tRPC lacks some features

  • End-to-End File/Blob Typesafe: 🛑

tRPC only displays data as form-data and does not show actual File/Blob instances.

We need to document this better, File and Blob are just ReadableStreams under the hood, so we provide octetInputParser as a utility which can be wrapped up to provide type safety there, but by default you're right it exposes ReadableStream on the server-side and that's not feature-complete. Still misleading to say we don't support it at all, we do but I could accept a 🟡

@unnoq
Copy link
Owner

unnoq commented Mar 22, 2025

Approved @Nick-Lucas, please fix the lint issues

Copy link

@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: 0

🧹 Nitpick comments (2)
apps/content/docs/comparison.md (2)

17-17: Confirm Accuracy of "End-to-end Errors Typesafe" Status for tRPC
The updated status for tRPC is now marked as supported (✅). Please verify that this accurately reflects tRPC’s current error handling capabilities. If there are known limitations or if type-safety is only partially supported (as some documentation debates suggest), consider adjusting the status accordingly (e.g., to 🟡).


34-34: Clarify "Dedicated Zod Schemas" Status for tRPC
tRPC is now marked as N/A for dedicated Zod schemas. If this classification might be confusing to readers, consider adding a brief explanatory note in the documentation to clarify why dedicated Zod schemas are not applicable for tRPC.

📜 Review details

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

📥 Commits

Reviewing files that changed from the base of the PR and between 473d526 and 77d2736.

📒 Files selected for processing (1)
  • apps/content/docs/comparison.md (2 hunks)
🔇 Additional comments (6)
apps/content/docs/comparison.md (6)

18-18: Verify "End-to-end File/Blob Typesafe" Update for tRPC
The new entry indicates full support (✅) for file/blob types. Please ensure that this status correctly reflects how tRPC now handles File/Blob instances (leveraging ReadableStreams and utilities like octetInputParser) and that there are no caveats unaddressed in the documentation.


28-28: Review "Server Actions Support" Status Update
tRPC is now marked as fully supporting Server Actions (✅). Confirm that this change aligns with the latest updates and that no aspects of the implementation require a note about partial support.


29-29: Confirm "Lazy Router" Capability for tRPC
With the status now set to supported (✅), please verify that this accurately represents tRPC’s lazy routing features as per the latest release notes and documentation.


30-30: Validate "Native Types" Support for tRPC
The table now shows full support (✅) for native types (e.g., Date, URL, Set, Maps) in tRPC. Please double-check that all these native types are indeed natively handled in the current version of tRPC.


33-33: Confirm "Plugins-able (CORS, ...)" Integration for tRPC
The updated row indicates that tRPC supports plugin-based integrations such as CORS (✅). Verify that this accurately mirrors the feature's implementation, particularly noting that CORS is managed at the adapter level rather than internally.


35-35: Review "Use Native Modules on Each Runtime" Status for tRPC
The table now shows tRPC with full support (✅) for using native modules, in contrast to ts-rest’s partial support (🟡). Please confirm that this comparison accurately reflects the implementation details and, if necessary, consider adding context to explain the distinction.

@Nick-Lucas
Copy link
Author

Approved @Nick-Lucas, please fix the lint issues

Looks sorted now

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.

2 participants