Unverified Commit df3ef84a authored by Wyatt Johnson's avatar Wyatt Johnson Committed by GitHub

refactor: skip the prospective render when there's a more specific route to be rendered (#78555)

When there's a more specific route available to render, when PPR is
disabled but Dynamic IO is enabled, we should skip the prospective
diagnostic render because it would have been skipped as a part of the
PPR render anyways.
parent ea5dfd7f
...@@ -1981,10 +1981,23 @@ export default async function build( ...@@ -1981,10 +1981,23 @@ export default async function build(
// check that dynamic pages won't error when they // check that dynamic pages won't error when they
// enable PPR. // enable PPR.
else if (config.experimental.dynamicIO && isDynamic) { else if (config.experimental.dynamicIO && isDynamic) {
prospectiveRenders.set(originalAppPath, { // If there's a page with a more specific render
page, // available, then we should skip the prospective
originalAppPath, // render because it'll be done as a part of the
}) // that render to validate the dynamic state.
if (
// The existence of any prerendered routes when
// PPR is disabled means that the route has more
// specific prerendered routes that should be
// used for the diagnostic render anyways.
!workerResult.prerenderedRoutes ||
workerResult.prerenderedRoutes.length === 0
) {
prospectiveRenders.set(originalAppPath, {
page,
originalAppPath,
})
}
} }
if (workerResult.prerenderedRoutes) { if (workerResult.prerenderedRoutes) {
......
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