Skip to content

feat: support trpc11 - #1

Merged
Ankcorn merged 2 commits into
baselime:mainfrom
juliusmarminge:trpc-11
Feb 12, 2024
Merged

Ankcorn merged 2 commits into
baselime:mainfrom
juliusmarminge:trpc-11

Conversation

@juliusmarminge

Copy link
Copy Markdown
Contributor

adds support for trpc 11 in the middleware

experimental_standaloneMiddleware is deprecated in favor of experimental_trpcMiddleware (we smurfed a lot of exports for v11) but will still be around, so I kept this change to be backwards compatible and work with both v10 and v11.

The only change relevant here is that we have turned the rawInput into an async getter getRawInput to be able to support more content types than json in the future. Ref: https://trpc.io/docs/migrate-from-v10-to-v11#rawinput-in-middleware-is-now-a-getrawinput

Comment thread package.json
Comment on lines +49 to +52
"peerDependenciesMeta": {
"@trpc/server": {
"optional": true
}

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

i assume you want this as not everyone will be using trpc and some package manager auto-installs peer dependencies unless they're marked optional

@juliusmarminge

juliusmarminge commented Jan 19, 2024 •

Copy link
Copy Markdown
Contributor Author

CleanShot 2024-01-20 at 00 39 49@2x

hmm maybe doesn't work... i'll look into it tomorrow cause I assume i should see the input here right?

EDIT: adding a console.log logs the input so I think it should work?

CleanShot 2024-01-20 at 00 43 11

@Ankcorn Ankcorn 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.

Thanks Julius! Apologies for the delay
This is great. I will release it today

@Ankcorn
Ankcorn merged commit 06e2791 into baselime:main Feb 12, 2024
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