mirror of
https://github.com/hanzoai/next.js.git
synced 2026-10-30 14:46:38 +00:00
### Why?
When SSG, the pages can bail out when detected a dynamic usage. However,
the routes that bailed out were still marked as SSG, which can confuse
the users.
### How?
Remove the bailed-out routes from the SSG routes list. If there are no
more SSG routes for the dynamic route, mark it as dynamic in Build CLI.
#### Before - Has 1, 2, 3, even though they bailed.
```
Route (app) Size First Load JS
┌ ○ /_not-found 0 B 114 kB
└ ● /[id] 0 B 114 kB
├ /1
├ /2
└ /3
+ First Load JS shared by all 114 kB
├ chunks/29c57ad6b43f6070.js 75.8 kB
├ chunks/df142624801412ea.js 24.3 kB
└ other shared chunks (total) 13.5 kB
○ (Static) prerendered as static content
● (SSG) prerendered as static HTML (uses generateStaticParams)
```
#### After - No longer has 1, 2, 3, and the route is marked as dynamic.
```
Route (app) Size First Load JS
┌ ○ /_not-found 0 B 114 kB
└ ƒ /[id] 0 B 114 kB
+ First Load JS shared by all 114 kB
├ chunks/4963d796c068bb13.js 24.3 kB
├ chunks/f59bbf014aa0eff6.js 75.8 kB
└ other shared chunks (total) 13.5 kB
○ (Static) prerendered as static content
ƒ (Dynamic) server-rendered on demand
```
Fixes https://github.com/vercel/next.js/issues/76507
Closes NAR-194
---------
Co-authored-by: Wyatt Johnson <[email protected]>
9 lines
174 B
TypeScript
9 lines
174 B
TypeScript
import { ReactNode } from 'react'
|
|
export default function Root({ children }: { children: ReactNode }) {
|
|
return (
|
|
<html>
|
|
<body>{children}</body>
|
|
</html>
|
|
)
|
|
}
|