next 15.4.0-canary.0 → 15.4.0-canary.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/bin/next +1 -1
- package/dist/build/index.js +37 -4
- package/dist/build/index.js.map +1 -1
- package/dist/build/swc/index.js +1 -1
- package/dist/build/utils.d.ts +1 -0
- package/dist/build/utils.js.map +1 -1
- package/dist/build/webpack-config.js +2 -2
- package/dist/client/app-bootstrap.js +1 -1
- package/dist/client/index.js +1 -1
- package/dist/esm/build/index.js +38 -5
- package/dist/esm/build/index.js.map +1 -1
- package/dist/esm/build/swc/index.js +1 -1
- package/dist/esm/build/utils.js.map +1 -1
- package/dist/esm/build/webpack-config.js +2 -2
- package/dist/esm/client/app-bootstrap.js +1 -1
- package/dist/esm/client/index.js +1 -1
- package/dist/esm/server/dev/hot-reloader-turbopack.js +1 -1
- package/dist/esm/server/dev/hot-reloader-webpack.js +1 -1
- package/dist/esm/server/lib/app-info-log.js +1 -1
- package/dist/esm/server/lib/router-utils/build-prefetch-segment-data-route.js +29 -3
- package/dist/esm/server/lib/router-utils/build-prefetch-segment-data-route.js.map +1 -1
- package/dist/esm/server/lib/start-server.js +1 -1
- package/dist/esm/shared/lib/canary-only.js +1 -1
- package/dist/server/dev/hot-reloader-turbopack.js +1 -1
- package/dist/server/dev/hot-reloader-webpack.js +1 -1
- package/dist/server/lib/app-info-log.js +1 -1
- package/dist/server/lib/router-utils/build-prefetch-segment-data-route.d.ts +13 -0
- package/dist/server/lib/router-utils/build-prefetch-segment-data-route.js +24 -2
- package/dist/server/lib/router-utils/build-prefetch-segment-data-route.js.map +1 -1
- package/dist/server/lib/start-server.js +1 -1
- package/dist/shared/lib/canary-only.js +1 -1
- package/dist/telemetry/anonymous-meta.js +1 -1
- package/dist/telemetry/events/session-stopped.js +2 -2
- package/dist/telemetry/events/version.js +2 -2
- package/package.json +15 -15
package/dist/esm/build/index.js
CHANGED
@@ -73,7 +73,7 @@ import { getParamKeys } from '../server/request/fallback-params';
|
|
73
73
|
import { formatNodeOptions, getParsedNodeOptionsWithoutInspect } from '../server/lib/utils';
|
74
74
|
import { InvariantError } from '../shared/lib/invariant-error';
|
75
75
|
import { HTML_LIMITED_BOT_UA_RE_STRING } from '../shared/lib/router/utils/is-bot';
|
76
|
-
import { buildPrefetchSegmentDataRoute } from '../server/lib/router-utils/build-prefetch-segment-data-route';
|
76
|
+
import { buildInversePrefetchSegmentDataRoute, buildPrefetchSegmentDataRoute } from '../server/lib/router-utils/build-prefetch-segment-data-route';
|
77
77
|
import { turbopackBuild } from './turbopack-build';
|
78
78
|
import { isPersistentCachingEnabled } from '../shared/lib/turbopack/utils';
|
79
79
|
import { inlineStaticEnv } from '../lib/inline-static-env';
|
@@ -307,7 +307,7 @@ export default async function build(dir, reactProductionProfiling = false, debug
|
|
307
307
|
const nextBuildSpan = trace('next-build', undefined, {
|
308
308
|
buildMode: experimentalBuildMode,
|
309
309
|
isTurboBuild: String(isTurbopack),
|
310
|
-
version: "15.4.0-canary.
|
310
|
+
version: "15.4.0-canary.1"
|
311
311
|
});
|
312
312
|
NextBuildContext.nextBuildSpan = nextBuildSpan;
|
313
313
|
NextBuildContext.dir = dir;
|
@@ -688,7 +688,7 @@ export default async function build(dir, reactProductionProfiling = false, debug
|
|
688
688
|
// Files outside of the distDir can be "type": "module"
|
689
689
|
await writeFileUtf8(path.join(distDir, 'package.json'), '{"type": "commonjs"}');
|
690
690
|
// These are written to distDir, so they need to come after creating and cleaning distDr.
|
691
|
-
await recordFrameworkVersion("15.4.0-canary.
|
691
|
+
await recordFrameworkVersion("15.4.0-canary.1");
|
692
692
|
await updateBuildDiagnostics({
|
693
693
|
buildStage: 'start'
|
694
694
|
});
|
@@ -1202,6 +1202,7 @@ export default async function build(dir, reactProductionProfiling = false, debug
|
|
1202
1202
|
}
|
1203
1203
|
}
|
1204
1204
|
pageInfos.set(page, {
|
1205
|
+
originalAppPath,
|
1205
1206
|
size,
|
1206
1207
|
totalSize,
|
1207
1208
|
isStatic,
|
@@ -1857,8 +1858,7 @@ export default async function build(dir, reactProductionProfiling = false, debug
|
|
1857
1858
|
}
|
1858
1859
|
dynamicRoute.prefetchSegmentDataRoutes ??= [];
|
1859
1860
|
for (const segmentPath of metadata.segmentPaths){
|
1860
|
-
|
1861
|
-
dynamicRoute.prefetchSegmentDataRoutes.push(result);
|
1861
|
+
dynamicRoute.prefetchSegmentDataRoutes.push(buildPrefetchSegmentDataRoute(route.pathname, segmentPath));
|
1862
1862
|
}
|
1863
1863
|
}
|
1864
1864
|
pageInfos.set(route.pathname, {
|
@@ -2106,6 +2106,39 @@ export default async function build(dir, reactProductionProfiling = false, debug
|
|
2106
2106
|
force: true
|
2107
2107
|
});
|
2108
2108
|
await writeManifest(pagesManifestPath, pagesManifest);
|
2109
|
+
if (config.experimental.clientSegmentCache) {
|
2110
|
+
for (const dynamicRoute of routesManifest.dynamicRoutes){
|
2111
|
+
var _pageInfos_get;
|
2112
|
+
// We only want to handle pages that are using the app router. We
|
2113
|
+
// need this path in order to determine if it's an app route or an
|
2114
|
+
// app page.
|
2115
|
+
const originalAppPath = (_pageInfos_get = pageInfos.get(dynamicRoute.page)) == null ? void 0 : _pageInfos_get.originalAppPath;
|
2116
|
+
if (!originalAppPath) {
|
2117
|
+
continue;
|
2118
|
+
}
|
2119
|
+
// We only want to handle app pages, not app routes.
|
2120
|
+
if (isAppRouteRoute(originalAppPath)) {
|
2121
|
+
continue;
|
2122
|
+
}
|
2123
|
+
// We don't need to add the prefetch segment data routes if it was
|
2124
|
+
// added due to a page that was already generated. This would have
|
2125
|
+
// happened if the page was static or partially static.
|
2126
|
+
if (dynamicRoute.prefetchSegmentDataRoutes) {
|
2127
|
+
continue;
|
2128
|
+
}
|
2129
|
+
// If the segment paths aren't defined, we need to insert a
|
2130
|
+
// reverse routing rule so that there isn't any conflicts
|
2131
|
+
// with other dynamic routes for the prefetch segment
|
2132
|
+
// routes. This is only an issue for pages that do not have
|
2133
|
+
// partial prerendering enabled.
|
2134
|
+
dynamicRoute.prefetchSegmentDataRoutes = [
|
2135
|
+
buildInversePrefetchSegmentDataRoute(dynamicRoute.page, // We use the special segment path of `/_tree` because it's
|
2136
|
+
// the first one sent by the client router so it's the only
|
2137
|
+
// one we need to rewrite to the regular prefetch RSC route.
|
2138
|
+
'/_tree')
|
2139
|
+
];
|
2140
|
+
}
|
2141
|
+
}
|
2109
2142
|
});
|
2110
2143
|
// We need to write the manifest with rewrites after build as it might
|
2111
2144
|
// have been modified.
|