Skip to content

Conversation

@KATT
Copy link
Member

@KATT KATT commented Sep 22, 2024

Closes #

The goal

Move the middleware abstraction and the base of the procedure builder out of tRPC so other libraries can leverage it

Usecases

Create a base trpc middleware lib

  • a future RSC-only library it and only add e.g. .actions() and to make a safe data layer
  • a standalone app can use middleware instead of e.g. a express middleware
  • @trpc/server can use it and add .query() / .mutation() etc

The how

🚧 The real way of doing this should likely be done like how redux toolkit does it

Right now - I've mainly cared about the types

  • I've created a middleware.ts that is the "base module"
  • Trying to work out how middlewareExtend.test.ts could extend the base module and inject options into the middleware chain and new builder methods without polluting the global scope

modules.test.ts is a start of a builder that can be extended by libraries

References

The principle should be possible: https://x.com/eskimojo/status/1837827507795501323

@railway-app
Copy link

railway-app bot commented Sep 22, 2024

🚅 Deployed to the trpc-pr-6027 environment in trpc-sse-and-websockets

Service Status Web Updated (UTC)
next-prisma-websockets-starter ◻️ Removed (View Logs) Nov 14, 2025 at 3:11 pm
next-sse-chat ◻️ Removed (View Logs) Web Nov 14, 2025 at 3:11 pm

@vercel
Copy link

vercel bot commented Sep 22, 2024

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

Name Status Preview Comments Updated (UTC)
next-prisma-starter ✅ Ready (Inspect) Visit Preview Jan 24, 2025 4:48pm
og-image ✅ Ready (Inspect) Visit Preview 💬 Add feedback Jan 24, 2025 4:48pm
www ✅ Ready (Inspect) Visit Preview 💬 Add feedback Jan 24, 2025 4:48pm

@KATT KATT changed the title wip - making a middleware library wip - making a standalone middleware library Sep 22, 2024
@coderabbitai
Copy link
Contributor

coderabbitai bot commented Jan 24, 2025

Important

Review skipped

Draft detected.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.


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

@pkg-pr-new
Copy link

pkg-pr-new bot commented Jan 24, 2025

Open in Stackblitz

npm i https://pkg.pr.new/trpc/trpc/@trpc/client@6027
npm i https://pkg.pr.new/trpc/trpc/@trpc/next@6027
npm i https://pkg.pr.new/trpc/trpc/@trpc/server@6027
npm i https://pkg.pr.new/trpc/trpc/@trpc/react-query@6027

commit: 5e3cd63

@railway-app railway-app bot temporarily deployed to trpc-pr-6027 May 15, 2025 05:49 Destroyed
@Nick-Lucas Nick-Lucas closed this Nov 14, 2025
@github-actions
Copy link
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 Nov 15, 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.

3 participants