Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
N
next.js
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Alex
next.js
Commits
8a027d78
Unverified
Commit
8a027d78
authored
Jun 29, 2026
by
Niklas Mischkulnig
Committed by
GitHub
Jun 29, 2026
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Improve typing of `decodeReply` (#95263)
The types were unnecessarily specific (it doesn't always return a `T[]`)
parent
a88f25ca
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
16 additions
and
12 deletions
+16
-12
action-handler.ts
packages/next/src/server/app-render/action-handler.ts
+4
-4
use-cache-probe-worker.ts
packages/next/src/server/dev/use-cache-probe-worker.ts
+9
-5
$$compiled.internal.d.ts
packages/next/types/$$compiled.internal.d.ts
+3
-3
No files found.
packages/next/src/server/app-render/action-handler.ts
View file @
8a027d78
...
...
@@ -780,7 +780,7 @@ export async function handleAction({
return
handleUnrecognizedFetchAction
(
err
)
}
boundActionArguments
=
await
decodeReply
(
boundActionArguments
=
await
decodeReply
<
unknown
[]
>
(
formData
,
serverModuleMap
,
{
temporaryReferences
}
...
...
@@ -861,7 +861,7 @@ export async function handleAction({
const
actionData
=
Buffer
.
concat
(
chunks
).
toString
(
'utf-8'
)
boundActionArguments
=
await
decodeReply
(
boundActionArguments
=
await
decodeReply
<
unknown
[]
>
(
actionData
,
serverModuleMap
,
{
temporaryReferences
}
...
...
@@ -954,7 +954,7 @@ export async function handleAction({
pipeline
(
body
,
sizeLimitTransform
,
busboy
,
{
signal
:
abortController
.
signal
,
}),
decodeReplyFromBusboy
(
busboy
,
serverModuleMap
,
{
decodeReplyFromBusboy
<
unknown
[]
>
(
busboy
,
serverModuleMap
,
{
temporaryReferences
,
}),
])
...
...
@@ -1070,7 +1070,7 @@ export async function handleAction({
const
actionData
=
Buffer
.
concat
(
chunks
).
toString
(
'utf-8'
)
boundActionArguments
=
await
decodeReply
(
boundActionArguments
=
await
decodeReply
<
unknown
[]
>
(
actionData
,
serverModuleMap
,
{
temporaryReferences
}
...
...
packages/next/src/server/dev/use-cache-probe-worker.ts
View file @
8a027d78
...
...
@@ -117,9 +117,13 @@ export async function probeUseCache(msg: ProbeMessage): Promise<boolean> {
const
temporaryReferences
=
createTemporaryReferenceSet
()
let
decoded
:
CacheKeyParts
if
(
msg
.
encodedArguments
.
kind
===
'string'
)
{
decoded
=
(
await
decodeReply
(
msg
.
encodedArguments
.
data
,
serverModuleMap
,
{
temporaryReferences
,
}))
as
CacheKeyParts
decoded
=
await
decodeReply
<
CacheKeyParts
>
(
msg
.
encodedArguments
.
data
,
serverModuleMap
,
{
temporaryReferences
,
}
)
}
else
{
const
entries
=
msg
.
encodedArguments
.
entries
.
map
<
[
string
,
string
|
File
]
>
(
([
key
,
value
])
=>
{
...
...
@@ -130,7 +134,7 @@ export async function probeUseCache(msg: ProbeMessage): Promise<boolean> {
return
[
key
,
new
File
([
bytes
],
''
,
{
type
:
value
.
type
})]
}
)
decoded
=
(
await
decodeReplyFromAsyncIterable
(
decoded
=
await
decodeReplyFromAsyncIterable
<
CacheKeyParts
>
(
{
async
*
[
Symbol
.
asyncIterator
]()
{
for
(
const
pair
of
entries
)
{
...
...
@@ -140,7 +144,7 @@ export async function probeUseCache(msg: ProbeMessage): Promise<boolean> {
},
serverModuleMap
,
{
temporaryReferences
}
)
)
as
CacheKeyParts
)
}
const
args
=
decoded
[
2
]
...
...
packages/next/types/$$compiled.internal.d.ts
View file @
8a027d78
...
...
@@ -279,17 +279,17 @@ declare module 'react-server-dom-webpack/server.node' {
...
args
:
unknown
[]
):
TemporaryReferenceSet
export
function
decodeReplyFromBusboy
(
export
function
decodeReplyFromBusboy
<
T
>
(
busboyStream
:
Busboy
,
webpackMap
:
ServerManifest
,
options
?:
{
temporaryReferences
?:
TemporaryReferenceSet
}
):
Promise
<
unknown
[]
>
):
Promise
<
T
>
export
function
decodeReply
<
T
>
(
body
:
string
|
FormData
,
webpackMap
:
ServerManifest
,
options
?:
{
temporaryReferences
?:
TemporaryReferenceSet
}
):
Promise
<
T
[]
>
):
Promise
<
T
>
export
function
decodeAction
(
body
:
FormData
,
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment