next 15.4.2-canary.17 → 15.4.2-canary.18

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.
Files changed (57) hide show
  1. package/dist/bin/next +1 -1
  2. package/dist/build/index.js +19 -29
  3. package/dist/build/index.js.map +1 -1
  4. package/dist/build/swc/index.js +1 -1
  5. package/dist/build/webpack-config.js +2 -2
  6. package/dist/client/app-bootstrap.js +1 -1
  7. package/dist/client/index.js +1 -1
  8. package/dist/compiled/@vercel/og/emoji/index.d.ts +15 -0
  9. package/dist/compiled/@vercel/og/figma/index.d.ts +7 -0
  10. package/dist/compiled/@vercel/og/index.edge.d.ts +5 -9
  11. package/dist/compiled/@vercel/og/index.edge.js +2587 -3024
  12. package/dist/compiled/@vercel/og/index.node.d.ts +7 -10
  13. package/dist/compiled/@vercel/og/index.node.js +2585 -3022
  14. package/dist/compiled/@vercel/og/language/index.d.ts +28 -0
  15. package/dist/compiled/@vercel/og/og.d.ts +1 -0
  16. package/dist/compiled/@vercel/og/package.json +1 -1
  17. package/dist/compiled/@vercel/og/satori/index.d.ts +4 -1
  18. package/dist/compiled/@vercel/og/types.d.ts +118 -0
  19. package/dist/compiled/@vercel/og/yoga.wasm +0 -0
  20. package/dist/compiled/next-server/pages-api-turbo.runtime.dev.js +1 -1
  21. package/dist/compiled/next-server/pages-api-turbo.runtime.dev.js.map +1 -1
  22. package/dist/compiled/next-server/pages-api-turbo.runtime.prod.js +1 -1
  23. package/dist/compiled/next-server/pages-api-turbo.runtime.prod.js.map +1 -1
  24. package/dist/compiled/next-server/pages-api.runtime.dev.js +1 -1
  25. package/dist/compiled/next-server/pages-api.runtime.dev.js.map +1 -1
  26. package/dist/compiled/next-server/pages-turbo.runtime.dev.js +1 -1
  27. package/dist/compiled/next-server/pages-turbo.runtime.dev.js.map +1 -1
  28. package/dist/compiled/next-server/pages-turbo.runtime.prod.js +1 -1
  29. package/dist/compiled/next-server/pages-turbo.runtime.prod.js.map +1 -1
  30. package/dist/compiled/next-server/pages.runtime.dev.js +1 -1
  31. package/dist/compiled/next-server/pages.runtime.dev.js.map +1 -1
  32. package/dist/esm/build/index.js +20 -30
  33. package/dist/esm/build/index.js.map +1 -1
  34. package/dist/esm/build/swc/index.js +1 -1
  35. package/dist/esm/build/webpack-config.js +2 -2
  36. package/dist/esm/client/app-bootstrap.js +1 -1
  37. package/dist/esm/client/index.js +1 -1
  38. package/dist/esm/export/routes/app-page.js +4 -2
  39. package/dist/esm/export/routes/app-page.js.map +1 -1
  40. package/dist/esm/server/dev/hot-reloader-turbopack.js +1 -1
  41. package/dist/esm/server/dev/hot-reloader-webpack.js +1 -1
  42. package/dist/esm/server/lib/app-info-log.js +1 -1
  43. package/dist/esm/server/lib/start-server.js +1 -1
  44. package/dist/esm/shared/lib/canary-only.js +1 -1
  45. package/dist/export/routes/app-page.js +4 -2
  46. package/dist/export/routes/app-page.js.map +1 -1
  47. package/dist/server/dev/hot-reloader-turbopack.js +1 -1
  48. package/dist/server/dev/hot-reloader-webpack.js +1 -1
  49. package/dist/server/lib/app-info-log.js +1 -1
  50. package/dist/server/lib/start-server.js +1 -1
  51. package/dist/shared/lib/canary-only.js +1 -1
  52. package/dist/telemetry/anonymous-meta.js +1 -1
  53. package/dist/telemetry/events/session-stopped.js +2 -2
  54. package/dist/telemetry/events/version.js +2 -2
  55. package/package.json +15 -15
  56. package/server.d.ts +1 -1
  57. package/dist/compiled/@vercel/og/types-d38469ff.d.ts +0 -74
package/dist/bin/next CHANGED
@@ -79,7 +79,7 @@ const program = new NextRootCommand();
79
79
  program.name('next').description('The Next.js CLI allows you to develop, build, start your application, and more.').configureHelp({
80
80
  formatHelp: (cmd, helper)=>(0, _formatclihelpoutput.formatCliHelpOutput)(cmd, helper),
81
81
  subcommandTerm: (cmd)=>`${cmd.name()} ${cmd.usage()}`
82
- }).helpCommand(false).helpOption('-h, --help', 'Displays this message.').version(`Next.js v${"15.4.2-canary.17"}`, '-v, --version', 'Outputs the Next.js version.');
82
+ }).helpCommand(false).helpOption('-h, --help', 'Displays this message.').version(`Next.js v${"15.4.2-canary.18"}`, '-v, --version', 'Outputs the Next.js version.');
83
83
  program.command('build').description('Creates an optimized production build of your application. The output displays information about each route.').argument('[directory]', `A directory on which to build the application. ${(0, _picocolors.italic)('If no directory is provided, the current directory will be used.')}`).option('-d, --debug', 'Enables a more verbose build output.').option('--debug-prerender', 'Enables debug mode for prerendering. Not for production use!').option('--no-lint', 'Disables linting.').option('--no-mangling', 'Disables mangling.').option('--profile', 'Enables production profiling for React.').option('--experimental-app-only', 'Builds only App Router routes.').option('--turbo', 'Starts development mode using Turbopack.').option('--turbopack', 'Starts development mode using Turbopack.').addOption(new _commander.Option('--experimental-build-mode [mode]', 'Uses an experimental build mode.').choices([
84
84
  'compile',
85
85
  'generate',
@@ -394,7 +394,7 @@ async function build(dir, reactProductionProfiling = false, debugOutput = false,
394
394
  const nextBuildSpan = (0, _trace.trace)('next-build', undefined, {
395
395
  buildMode: experimentalBuildMode,
396
396
  isTurboBuild: String(isTurbopack),
397
- version: "15.4.2-canary.17"
397
+ version: "15.4.2-canary.18"
398
398
  });
399
399
  _buildcontext.NextBuildContext.nextBuildSpan = nextBuildSpan;
400
400
  _buildcontext.NextBuildContext.dir = dir;
@@ -781,7 +781,7 @@ async function build(dir, reactProductionProfiling = false, debugOutput = false,
781
781
  // Files outside of the distDir can be "type": "module"
782
782
  await writeFileUtf8(_path.default.join(distDir, 'package.json'), '{"type": "commonjs"}');
783
783
  // These are written to distDir, so they need to come after creating and cleaning distDr.
784
- await (0, _builddiagnostics.recordFrameworkVersion)("15.4.2-canary.17");
784
+ await (0, _builddiagnostics.recordFrameworkVersion)("15.4.2-canary.18");
785
785
  await (0, _builddiagnostics.updateBuildDiagnostics)({
786
786
  buildStage: 'start'
787
787
  });
@@ -1989,9 +1989,23 @@ async function build(dir, reactProductionProfiling = false, debugOutput = false,
1989
1989
  });
1990
1990
  }
1991
1991
  }
1992
- dynamicRoute.prefetchSegmentDataRoutes ??= [];
1993
- for (const segmentPath of metadata.segmentPaths){
1994
- dynamicRoute.prefetchSegmentDataRoutes.push((0, _buildprefetchsegmentdataroute.buildPrefetchSegmentDataRoute)(route.pathname, segmentPath));
1992
+ if (metadata.segmentPaths) {
1993
+ const pageSegmentPath = metadata.segmentPaths.find((item)=>item.endsWith('__PAGE__'));
1994
+ if (!pageSegmentPath) {
1995
+ throw Object.defineProperty(new Error(`Invariant: missing __PAGE__ segmentPath`), "__NEXT_ERROR_CODE", {
1996
+ value: "E759",
1997
+ enumerable: false,
1998
+ configurable: true
1999
+ });
2000
+ }
2001
+ // We build a combined segment data route from the
2002
+ // page segment as we need to limit the number of
2003
+ // routes we output and they can be shared
2004
+ const builtSegmentDataRoute = (0, _buildprefetchsegmentdataroute.buildPrefetchSegmentDataRoute)(route.pathname, pageSegmentPath);
2005
+ builtSegmentDataRoute.source = builtSegmentDataRoute.source.replace('/__PAGE__\\.segment\\.rsc$', `(?<segment>/__PAGE__\\.segment\\.rsc|\\.segment\\.rsc)(?:/)?$`);
2006
+ builtSegmentDataRoute.destination = builtSegmentDataRoute.destination.replace('/__PAGE__.segment.rsc', '$segment');
2007
+ dynamicRoute.prefetchSegmentDataRoutes ??= [];
2008
+ dynamicRoute.prefetchSegmentDataRoutes.push(builtSegmentDataRoute);
1995
2009
  }
1996
2010
  }
1997
2011
  pageInfos.set(route.pathname, {
@@ -2239,30 +2253,6 @@ async function build(dir, reactProductionProfiling = false, debugOutput = false,
2239
2253
  force: true
2240
2254
  });
2241
2255
  await writeManifest(pagesManifestPath, pagesManifest);
2242
- if (config.experimental.clientSegmentCache) {
2243
- for (const route of [
2244
- ...routesManifest.staticRoutes,
2245
- ...routesManifest.dynamicRoutes
2246
- ]){
2247
- // If the segment paths aren't defined, we need to insert a
2248
- // reverse routing rule so that there isn't any conflicts
2249
- // with other dynamic routes for the prefetch segment
2250
- // routes. This is true for any route that is not PPR-enabled,
2251
- // including all routes defined by Pages Router.
2252
- // We don't need to add the prefetch segment data routes if it was
2253
- // added due to a page that was already generated. This would have
2254
- // happened if the page was static or partially static.
2255
- if (route.prefetchSegmentDataRoutes) {
2256
- continue;
2257
- }
2258
- route.prefetchSegmentDataRoutes = [
2259
- (0, _buildprefetchsegmentdataroute.buildInversePrefetchSegmentDataRoute)(route.page, // We use the special segment path of `/_tree` because it's
2260
- // the first one sent by the client router so it's the only
2261
- // one we need to rewrite to the regular prefetch RSC route.
2262
- '/_tree')
2263
- ];
2264
- }
2265
- }
2266
2256
  });
2267
2257
  // As we may have modified the dynamicRoutes, we need to sort the
2268
2258
  // dynamic routes by page.