@vercel/next 4.12.4 → 4.12.6

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 (2) hide show
  1. package/dist/index.js +55 -14
  2. package/package.json +2 -2
package/dist/index.js CHANGED
@@ -11364,12 +11364,13 @@ async function getDynamicRoutes({
11364
11364
  routes2.push({
11365
11365
  src: route.src.replace(
11366
11366
  new RegExp((0, import_escape_string_regexp.default)("(?:/)?$")),
11367
- shouldSkipSuffixes ? "\\.rsc(?:/)?$" : "(?<rscSuffix>\\.rsc|\\.prefetch\\.rsc|\\.segments/.+\\.segment\\.rsc)(?:/)?$"
11368
- ),
11369
- dest: route.dest?.replace(
11370
- /($|\?)/,
11371
- shouldSkipSuffixes ? ".rsc$1" : "$rscSuffix$1"
11367
+ // Now than the upstream issues has been resolved, we can safely
11368
+ // add the suffix back, this resolves a bug related to segment
11369
+ // rewrites not capturing the correct suffix values when
11370
+ // enabled.
11371
+ shouldSkipSuffixes ? "(?<rscSuffix>\\.rsc|\\.segments/.+\\.segment\\.rsc)(?:/)?$" : "(?<rscSuffix>\\.rsc|\\.prefetch\\.rsc|\\.segments/.+\\.segment\\.rsc)(?:/)?$"
11372
11372
  ),
11373
+ dest: route.dest?.replace(/($|\?)/, "$rscSuffix$1"),
11373
11374
  check: true,
11374
11375
  override: true
11375
11376
  });
@@ -12094,8 +12095,8 @@ async function getPageLambdaGroups({
12094
12095
  });
12095
12096
  opts = { ...vercelConfigOpts, ...opts };
12096
12097
  }
12097
- const isGeneratedSteps = routeName.includes("api/generated/steps");
12098
- const isGeneratedWorkflows = routeName.includes("api/generated/workflows");
12098
+ const isGeneratedSteps = routeName.includes(".well-known/workflow/v1/step") || routeName.includes("api/generated/steps");
12099
+ const isGeneratedWorkflows = routeName.includes(".well-known/workflow/v1/flow") || routeName.includes("api/generated/workflows");
12099
12100
  if (isGeneratedSteps || isGeneratedWorkflows) {
12100
12101
  const sourceFile = await getSourceFilePathFromPage({
12101
12102
  workPath: entryPath,
@@ -12473,7 +12474,8 @@ var onPrerenderRoute = (prerenderRouteArgs) => async (routeKey, {
12473
12474
  let postponedPrerender;
12474
12475
  let postponedState = null;
12475
12476
  let didPostpone = false;
12476
- if (renderingMode === "PARTIALLY_STATIC" /* PARTIALLY_STATIC */ && appDir && !isBlocking) {
12477
+ if (renderingMode === "PARTIALLY_STATIC" /* PARTIALLY_STATIC */ && appDir && // TODO(NAR-402): Investigate omitted routes
12478
+ !isBlocking) {
12477
12479
  postponedState = getHTMLPostponedState({ appDir, routeFileNoExt });
12478
12480
  const htmlPath = import_path3.default.join(appDir, `${routeFileNoExt}.html`);
12479
12481
  if (import_fs_extra3.default.existsSync(htmlPath)) {
@@ -12696,7 +12698,8 @@ var onPrerenderRoute = (prerenderRouteArgs) => async (routeKey, {
12696
12698
  };
12697
12699
  }
12698
12700
  let htmlAllowQuery = allowQuery;
12699
- if (renderingMode === "PARTIALLY_STATIC" /* PARTIALLY_STATIC */ && (isFallback || isBlocking)) {
12701
+ if (renderingMode === "PARTIALLY_STATIC" /* PARTIALLY_STATIC */ && // TODO(NAR-402): Investigate omitted routes
12702
+ (isFallback || isBlocking)) {
12700
12703
  const { fallbackRootParams, fallback } = isFallback ? prerenderManifest.fallbackRoutes[routeKey] : prerenderManifest.blockingFallbackRoutes[routeKey];
12701
12704
  if (
12702
12705
  // We only want to vary on the shell contents if there is a fallback
@@ -12798,7 +12801,7 @@ var onPrerenderRoute = (prerenderRouteArgs) => async (routeKey, {
12798
12801
  rscContentTypeHeader
12799
12802
  )}`;
12800
12803
  let rdcRSCAllowQuery = allowQuery;
12801
- if (isAppClientParamParsingEnabled && (isFallback || isBlocking)) {
12804
+ if (isAppClientParamParsingEnabled) {
12802
12805
  rdcRSCAllowQuery = [];
12803
12806
  }
12804
12807
  prerenders[normalizePathData(outputPathData)] = new import_build_utils.Prerender({
@@ -12806,10 +12809,14 @@ var onPrerenderRoute = (prerenderRouteArgs) => async (routeKey, {
12806
12809
  staleExpiration: initialExpire,
12807
12810
  lambda,
12808
12811
  allowQuery: rdcRSCAllowQuery,
12809
- fallback: isFallback ? null : new import_build_utils.FileBlob({
12810
- data: postponedState,
12811
- contentType
12812
- }),
12812
+ fallback: (
12813
+ // Use the fallback value for the RSC route if the route doesn't
12814
+ // vary based on the route parameters.
12815
+ rdcRSCAllowQuery && rdcRSCAllowQuery.length === 0 ? new import_build_utils.FileBlob({
12816
+ data: postponedState,
12817
+ contentType
12818
+ }) : null
12819
+ ),
12813
12820
  group: prerenderGroup,
12814
12821
  bypassToken: prerenderManifest.bypassToken,
12815
12822
  experimentalBypassFor,
@@ -15504,6 +15511,30 @@ ${JSON.stringify(
15504
15511
  // trailing slash
15505
15512
  ...trailingSlashRedirects,
15506
15513
  ...privateOutputs.routes,
15514
+ ...isNextDataServerResolving ? [
15515
+ // ensure x-nextjs-data header is always present
15516
+ // if we are doing middleware next data resolving
15517
+ {
15518
+ src: import_path5.default.posix.join("/", entryDirectory, "/_next/data/(.*)"),
15519
+ missing: [
15520
+ {
15521
+ type: "header",
15522
+ key: "x-nextjs-data"
15523
+ }
15524
+ ],
15525
+ transforms: [
15526
+ {
15527
+ type: "request.headers",
15528
+ op: "append",
15529
+ target: {
15530
+ key: "x-nextjs-data"
15531
+ },
15532
+ args: `1`
15533
+ }
15534
+ ],
15535
+ continue: true
15536
+ }
15537
+ ] : [],
15507
15538
  // normalize _next/data URL before processing redirects
15508
15539
  ...normalizeNextDataRoute(true),
15509
15540
  ...i18n ? [
@@ -18291,10 +18322,20 @@ var diagnostics = async ({
18291
18322
  "trace",
18292
18323
  import_path6.default.join(basePath, diagnosticsEntrypoint, outputDirectory)
18293
18324
  ),
18325
+ // Collect `.next/trace-build` file
18326
+ ...await (0, import_build_utils3.glob)(
18327
+ "trace-build",
18328
+ import_path6.default.join(basePath, diagnosticsEntrypoint, outputDirectory)
18329
+ ),
18294
18330
  // Collect `.next/turbopack` file
18295
18331
  ...await (0, import_build_utils3.glob)(
18296
18332
  "turbopack",
18297
18333
  import_path6.default.join(basePath, diagnosticsEntrypoint, outputDirectory)
18334
+ ),
18335
+ // Collect `.next/trace-turbopack` file
18336
+ ...await (0, import_build_utils3.glob)(
18337
+ "trace-turbopack",
18338
+ import_path6.default.join(basePath, diagnosticsEntrypoint, outputDirectory)
18298
18339
  )
18299
18340
  };
18300
18341
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@vercel/next",
3
- "version": "4.12.4",
3
+ "version": "4.12.6",
4
4
  "license": "Apache-2.0",
5
5
  "main": "./dist/index",
6
6
  "homepage": "https://vercel.com/docs/runtimes#official-runtimes/next-js",
@@ -30,7 +30,7 @@
30
30
  "@types/semver": "6.0.0",
31
31
  "@types/text-table": "0.2.1",
32
32
  "@types/webpack-sources": "3.2.0",
33
- "@vercel/build-utils": "12.0.0",
33
+ "@vercel/build-utils": "12.1.0",
34
34
  "@vercel/routing-utils": "5.1.1",
35
35
  "async-sema": "3.0.1",
36
36
  "buffer-crc32": "0.2.13",