-
-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
chore(server): rewrite resolveHTTPResponse
with Fetch
#5684
Merged
Merged
Changes from all commits
Commits
Show all changes
115 commits
Select commit
Hold shift + click to select a range
d5eb98b
Revert "fix: rollback formdata/octet type stream support (#5661)"
Nick-Lucas a19547d
add regression test
KATT d3e65c0
cool
KATT 38ebbdf
Add concurrentCache to safely store promises for the body
Nick-Lucas 55ee77f
Add cache straight to adapter
Nick-Lucas 93749da
Add doc comment
Nick-Lucas dbe9428
Remove reundant code
Nick-Lucas 270b354
Add tests for other adapters
Nick-Lucas c1c2abd
Simply impl
Nick-Lucas fd9ecc7
Fix linting
Nick-Lucas af57d9d
Fix express test
Nick-Lucas 662baa8
Do next-prisma-starter
Nick-Lucas 78a8a63
Bump typescript eslint parser to support ts 5.4.2
Nick-Lucas 2568a57
chore: apply lint and formatting fixes
autofix-ci[bot] 42a4b49
regenerate lock file
Nick-Lucas 564c5fa
Fix test types
Nick-Lucas fb7e9a1
wip
KATT cfd3d2b
add memo fn
KATT cb6b609
mkay
KATT 3bd4afc
simplify
KATT d95a527
cool
KATT d928f17
cool
KATT 76c9ee7
wip
KATT ae446d7
wip
KATT 69c5c43
some fix
KATT d78071c
wip
KATT 80fbdd5
fix some
KATT 73c8f4b
method override
KATT 32d0f5a
locky
KATT 9da6e69
cool
KATT 0b3e09e
fix
KATT c676a67
wat
KATT 0cd8a2d
formData
KATT 3ff7bf4
fix formdata
KATT 0fa724d
cool
KATT d765e9d
add regression test
KATT 5a7e82d
cool
KATT b041b53
a security fix aye
KATT ec0e087
chore: apply lint and formatting fixes
autofix-ci[bot] 739de29
fix stuff
KATT 003850d
Merge branch '04-26-resolveResponse' of github.com:trpc/trpc into 04-…
KATT a091d1b
no `.only()`
KATT d368390
tweak
KATT 6f7ca36
Upgrade vitest
Nick-Lucas 5f3f9c9
fix test
KATT 631e948
TextEncoderStream
Sheraff cf12fa6
ugly but w/e
KATT 35c7cc1
Merge branch '04-26-resolveResponse' of github.com:trpc/trpc into 04-…
KATT 895d845
chore: apply lint and formatting fixes
autofix-ci[bot] acaeb36
Fix the bug
Nick-Lucas 6e01f07
Merge branch 'next' of github.com:trpc/trpc into issues/5659-multi-bo…
Nick-Lucas 87e86fc
chore: apply lint and formatting fixes
autofix-ci[bot] 167bc20
add more tests
KATT 805bc74
Merge branch '04-26-resolveResponse' of github.com:trpc/trpc into 04-…
KATT 31479c5
payload too large
KATT 624f6c6
tweak
KATT 12c618a
release
KATT 19b54d8
Merge remote-tracking branch 'origin/next' into issues/5659-multi-bod…
KATT 9b02d70
tmp release
KATT 68f7b52
fix test
KATT b86279a
Merge branch 'issues/5659-multi-body-read' into 04-26-resolveResponse…
KATT 1389e65
wip
KATT b267fbc
colocate
KATT f4b3b80
simplify
KATT f62bc66
add some tests
KATT 5c99bc7
next
KATT 5dabae3
fix
KATT cf91b5b
cool
KATT 3a4c8ff
hi
KATT 764407c
mk
KATT 4242604
fixes
KATT 9586408
rm
KATT 9eb99ea
release
KATT 23f42bf
fix
KATT 5bcf80d
fix
KATT 6e35200
fix
KATT 3d3cac7
rel
KATT 66509c6
cool
KATT 496fc8f
cool
KATT eaf88e6
cool
KATT 073e93b
chore: move more stuff to fetch api (#5685)
KATT 7521c05
mv parseOctetInput to http
KATT 257bf55
revert some tests that work now
KATT 84b43d2
tweak
KATT 3bb3659
tweak
KATT 1dcdc61
cool
KATT b11c387
sort
KATT f9b794d
chore: apply lint and formatting fixes
autofix-ci[bot] be4bf90
04 26 resolve response and multi align example (#5686)
KATT e67ee92
04 26 resolve response and multi happy ts (#5687)
KATT 2f00300
cool
KATT ffb40b1
Merge branch '04-26-resolveResponse-and-multi' of github.com:trpc/trp…
KATT 3095a21
cool
KATT e3feaae
Merge branch 'next' into issues/5659-multi-body-read
KATT d4fb197
Merge branch 'issues/5659-multi-body-read' into 04-26-resolveResponse…
KATT 1d98672
Merge branch 'next' into issues/5659-multi-body-read
KATT 22d05ab
Merge branch 'issues/5659-multi-body-read' into 04-26-resolveResponse…
KATT 67ca904
fix
KATT 3e85ff8
rewrite lambda adapter (#5690)
KATT fb53a74
Merge branch 'next' into issues/5659-multi-body-read
KATT 033dc62
Merge branch 'issues/5659-multi-body-read' into 04-26-resolveResponse…
KATT 33cf415
parts
KATT 328bcc4
tweak
KATT ed9d992
cool
KATT c1585b6
tweak
KATT 699d7d0
Revert "tweak"
KATT 3d33679
chore: move complexity from `resolveResponse` (#5691)
KATT 7edfea7
Merge remote-tracking branch 'origin/next' into 04-26-resolveResponse…
KATT d52febe
Revert "Merge remote-tracking branch 'origin/next' into 04-26-resolve…
KATT 2462a0e
more readable diff
KATT 5ff0e7e
mkay
KATT 26da399
fix
KATT b321139
tweak
KATT d207027
fix
KATT 2c13b76
decode
KATT File filter
Filter by extension
Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
# Next.js + tRPC + `FormData` | ||
|
||
This example showcases how to use tRPC with `FormData`. | ||
|
||
## Setup | ||
|
||
```bash | ||
npx create-next-app --example https://github.com/trpc/trpc --example-path examples/next-formdata trpc-formdata | ||
cd trpc-formdata | ||
npm i | ||
npm run dev | ||
``` |
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,26 +1,21 @@ | ||
export { | ||
getHTTPStatusCode, | ||
getHTTPStatusCodeFromError, | ||
resolveResponse, | ||
} from '../../unstable-core-do-not-import'; | ||
export { resolveHTTPResponse } from '../../unstable-core-do-not-import'; | ||
export type { | ||
BaseHandlerOptions, | ||
HTTPBaseHandlerOptions, | ||
HTTPHeaders, | ||
HTTPRequest, | ||
HTTPResponse, | ||
OnErrorFunction, | ||
ProcedureCall, | ||
HTTPErrorHandler, | ||
/** | ||
* @deprecated Use `HTTPErrorHandler` instead | ||
*/ | ||
HTTPErrorHandler as OnErrorFunction, | ||
ResolveHTTPRequestOptionsContextFn, | ||
ResponseChunk, | ||
ResponseMeta, | ||
ResponseMetaFn, | ||
TRPCRequestInfo, | ||
} from '../../unstable-core-do-not-import'; | ||
|
||
export { getBatchStreamFormatter } from '../../unstable-core-do-not-import'; | ||
export type { | ||
BaseContentTypeHandler, | ||
BodyResult, | ||
} from '../../unstable-core-do-not-import'; | ||
export { toURL } from '../../unstable-core-do-not-import'; | ||
export { octetInputParser, toURL } from '../../unstable-core-do-not-import'; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
cc @Nick-Lucas
I don't see why you'd want to use octet streams over
FormData
?If you upload a file you can just do this?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
saying this because it seems a lot easier to deal with a
File
than aReadableStream
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Choice is good, not everything is a File and you might also want to stream a file direct to some storage which I don't believe FormData could do, it would have to fit in memory (or have hi-jinks like we used to have)