Add flight render starting point (#36760)
## Bug - [ ] Related issues linked using `fixes #number` - [ ] Integration tests added - [ ] Errors have helpful link attached, see `contributing.md` ## Feature - [ ] Implements an existing feature request or RFC. Make sure the feature request has been accepted for implementation before opening a PR. - [ ] Related issues linked using `fixes #number` - [ ] Integration tests added - [ ] Documentation added - [ ] Telemetry added. In case of a feature if it's used or not. - [ ] Errors have helpful link attached, see `contributing.md` ## Documentation / Examples - [ ] Make sure the linting passes by running `yarn lint`
This commit is contained in:
parent
26459ef097
commit
40e9891175
1 changed files with 12 additions and 2 deletions
|
@ -219,9 +219,19 @@ export async function renderToHTML(
|
|||
const hasConcurrentFeatures = !!runtime
|
||||
const pageIsDynamic = isDynamicRoute(pathname)
|
||||
const components = Object.keys(ComponentMod.components)
|
||||
.filter((path) => {
|
||||
const { __flight__, __flight_router_path__: routerPath } = query
|
||||
// Rendering part of the page is only allowed for flight data
|
||||
if (__flight__ !== undefined && routerPath) {
|
||||
// TODO: check the actual path
|
||||
const pathLength = path.length
|
||||
return pathLength >= routerPath.length
|
||||
}
|
||||
return true
|
||||
})
|
||||
.sort()
|
||||
.map((key) => {
|
||||
const mod = ComponentMod.components[key]()
|
||||
.map((path) => {
|
||||
const mod = ComponentMod.components[path]()
|
||||
mod.Component = mod.default || mod
|
||||
return mod
|
||||
})
|
||||
|
|
Loading…
Reference in a new issue