-
Notifications
You must be signed in to change notification settings - Fork 27.6k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'canary' into eslint-plugin-next
- Loading branch information
Showing
11 changed files
with
74 additions
and
20 deletions.
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
22 changes: 13 additions & 9 deletions
22
packages/next/src/server/app-render/get-short-dynamic-param-type.tsx
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,19 +1,23 @@ | ||
import { DynamicParamTypes, DynamicParamTypesShort } from './types' | ||
|
||
export const dynamicParamTypes: Record< | ||
DynamicParamTypes, | ||
DynamicParamTypesShort | ||
> = { | ||
catchall: 'c', | ||
'optional-catchall': 'oc', | ||
dynamic: 'd', | ||
} | ||
|
||
/** | ||
* Shorten the dynamic param in order to make it smaller when transmitted to the browser. | ||
*/ | ||
export function getShortDynamicParamType( | ||
type: DynamicParamTypes | ||
): DynamicParamTypesShort { | ||
switch (type) { | ||
case 'catchall': | ||
return 'c' | ||
case 'optional-catchall': | ||
return 'oc' | ||
case 'dynamic': | ||
return 'd' | ||
default: | ||
throw new Error('Unknown dynamic param type') | ||
const short = dynamicParamTypes[type] | ||
if (!short) { | ||
throw new Error('Unknown dynamic param type') | ||
} | ||
return short | ||
} |
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
8 changes: 8 additions & 0 deletions
8
...-dir/parallel-routes-and-interception/app/parallel-nested/home/@parallelB/nested/page.tsx
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,8 @@ | ||
export default function ParallelPage() { | ||
return ( | ||
<> | ||
<p>Hello from nested parallel page!</p> | ||
<div id="timestamp">{Date.now()}</div> | ||
</> | ||
) | ||
} |
8 changes: 8 additions & 0 deletions
8
test/e2e/app-dir/parallel-routes-and-interception/app/parallel-nested/home/layout.tsx
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,8 @@ | ||
export default function Layout({ parallelB }: { parallelB: React.ReactNode }) { | ||
return ( | ||
<main> | ||
<h3>{`(parallelB)`}</h3> | ||
<div>{parallelB}</div> | ||
</main> | ||
) | ||
} |
10 changes: 10 additions & 0 deletions
10
test/e2e/app-dir/parallel-routes-and-interception/app/parallel-nested/layout.tsx
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,10 @@ | ||
export default function Parallel({ children }) { | ||
return ( | ||
<div> | ||
parallel/layout: | ||
<div className="parallel" title="children"> | ||
{children} | ||
</div> | ||
</div> | ||
) | ||
} |
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