-
-
Notifications
You must be signed in to change notification settings - Fork 1.5k
wip - making a standalone middleware library #6027
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
Conversation
|
🚅 Deployed to the trpc-pr-6027 environment in trpc-sse-and-websockets
|
|
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
|
Important Review skippedDraft detected. Please check the settings in the CodeRabbit UI or the You can disable this status message by setting the 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
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)
Other keywords and placeholders
CodeRabbit Configuration File (
|
commit: |
|
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. |
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
.actions()and to make a safe data layer@trpc/servercan use it and add.query()/.mutation()etcThe how
Right now - I've mainly cared about the types
I've created amiddleware.tsthat is the "base module"Trying to work out howmiddlewareExtend.test.tscould extend the base module and inject options into the middleware chain and new builder methods without polluting the global scopemodules.test.tsis a start of a builder that can be extended by librariesReferences
The principle should be possible: https://x.com/eskimojo/status/1837827507795501323