Unverified Commit 6dd25d96 authored by Niklas Mischkulnig's avatar Niklas Mischkulnig Committed by GitHub

fix: use EntryKeySide in EntryKey side field (#100053)

## Summary

The serialized `side` field in `EntryKey`
(`packages/next/src/shared/lib/turbopack/entry-key.ts`) was declared
with `${EntryKeyType}` instead of `${EntryKeySide}`, so the type claimed
`side` could be `"app" | "pages" | "root" | "assets"` while
`getEntryKey` actually produces `"client" | "server"`. The `as EntryKey`
assertion on `JSON.stringify` masked the mismatch. Type-only fix;
runtime serialization is unchanged and no tests were added per the
agreed scope.

## Verification

- `pnpm --filter=next types` (after workspace bootstrap via `pnpm
build`)
- `pnpm prettier --check
packages/next/src/shared/lib/turbopack/entry-key.ts`
- Scratch tsc check (not committed): original type accepts `side:app`
literals; corrected type rejects them while still accepting keys from
`getEntryKey`

<!-- NEXT_JS_LLM -->

<!-- fleet 18629715-7a2d-41b0-8706-8b3f9db46fcc -->
Co-authored-by: 's avatarvercel-fleet-prod[bot] <318278635+vercel-fleet-prod[bot]@users.noreply.github.com>
parent a9437d1d
...@@ -9,7 +9,7 @@ export type EntryKeySide = 'client' | 'server' ...@@ -9,7 +9,7 @@ export type EntryKeySide = 'client' | 'server'
// custom type to make sure you can't accidentally use a "generic" string // custom type to make sure you can't accidentally use a "generic" string
export type EntryKey = export type EntryKey =
`{"type":"${EntryKeyType}","side":"${EntryKeyType}","page":"${string}"}` `{"type":"${EntryKeyType}","side":"${EntryKeySide}","page":"${string}"}`
/** /**
* Get a key that's unique across all entrypoints. * Get a key that's unique across all entrypoints.
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment