next 15.3.0-canary.4 → 15.3.0-canary.5

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.
@@ -11,7 +11,7 @@ import { isDeepStrictEqual } from 'util';
11
11
  import { getDefineEnv } from '../webpack/plugins/define-env-plugin';
12
12
  import { getReactCompilerLoader } from '../get-babel-loader-config';
13
13
  import { TurbopackInternalError } from '../../shared/lib/turbopack/utils';
14
- const nextVersion = "15.3.0-canary.4";
14
+ const nextVersion = "15.3.0-canary.5";
15
15
  const ArchName = arch();
16
16
  const PlatformName = platform();
17
17
  function infoLog(...args) {
@@ -1527,7 +1527,7 @@ export default async function getBaseWebpackConfig(dir, { buildId, encryptionKey
1527
1527
  isClient && new CopyFilePlugin({
1528
1528
  // file path to build output of `@next/polyfill-nomodule`
1529
1529
  filePath: require.resolve('./polyfills/polyfill-nomodule'),
1530
- cacheKey: "15.3.0-canary.4",
1530
+ cacheKey: "15.3.0-canary.5",
1531
1531
  name: `static/chunks/polyfills${dev ? '' : '-[hash]'}.js`,
1532
1532
  minimize: false,
1533
1533
  info: {
@@ -1704,7 +1704,7 @@ export default async function getBaseWebpackConfig(dir, { buildId, encryptionKey
1704
1704
  // - Next.js location on disk (some loaders use absolute paths and some resolve options depend on absolute paths)
1705
1705
  // - Next.js version
1706
1706
  // - next.config.js keys that affect compilation
1707
- version: `${__dirname}|${"15.3.0-canary.4"}|${configVars}`,
1707
+ version: `${__dirname}|${"15.3.0-canary.5"}|${configVars}`,
1708
1708
  cacheDirectory: path.join(distDir, 'cache', 'webpack'),
1709
1709
  // For production builds, it's more efficient to compress all cache files together instead of compression each one individually.
1710
1710
  // So we disable compression here and allow the build runner to take care of compressing the cache as a whole.
@@ -3,7 +3,7 @@
3
3
  * sure the following scripts are executed in the correct order:
4
4
  * - Polyfills
5
5
  * - next/script with `beforeInteractive` strategy
6
- */ const version = "15.3.0-canary.4";
6
+ */ const version = "15.3.0-canary.5";
7
7
  window.next = {
8
8
  version,
9
9
  appDir: true
@@ -26,7 +26,7 @@ import { SearchParamsContext, PathParamsContext } from '../shared/lib/hooks-clie
26
26
  import { onRecoverableError } from './react-client-callbacks/on-recoverable-error';
27
27
  import tracer from './tracing/tracer';
28
28
  import { isNextRouterError } from './components/is-next-router-error';
29
- export const version = "15.3.0-canary.4";
29
+ export const version = "15.3.0-canary.5";
30
30
  export let router;
31
31
  export const emitter = mitt();
32
32
  const looseToArray = (input)=>[].slice.call(input);
@@ -4,32 +4,27 @@ import crypto from 'crypto';
4
4
  import { promisify } from 'util';
5
5
  import globOriginal from 'next/dist/compiled/glob';
6
6
  import { Sema } from 'next/dist/compiled/async-sema';
7
- import { BUILD_MANIFEST } from '../shared/lib/constants';
8
7
  import { getNextConfigEnv, getStaticEnv } from './static-env';
9
8
  const glob = promisify(globOriginal);
10
- export async function inlineStaticEnv({ distDir, config, buildId }) {
9
+ export async function inlineStaticEnv({ distDir, config }) {
11
10
  const nextConfigEnv = getNextConfigEnv(config);
12
11
  const staticEnv = getStaticEnv(config);
13
12
  const serverDir = path.join(distDir, 'server');
14
- const serverChunks = await glob('**/*.js', {
13
+ const serverChunks = await glob('**/*.{js,json,js.map}', {
15
14
  cwd: serverDir
16
15
  });
17
16
  const clientDir = path.join(distDir, 'static');
18
- const clientChunks = await glob('**/*.js', {
17
+ const clientChunks = await glob('**/*.{js,json,js.map}', {
19
18
  cwd: clientDir
20
19
  });
21
- const webpackRuntimeFile = clientChunks.find((item)=>item.match(/webpack-[a-z0-9]{16}/));
22
- if (!webpackRuntimeFile) {
23
- throw Object.defineProperty(new Error(`Invariant failed to find webpack runtime chunk`), "__NEXT_ERROR_CODE", {
24
- value: "E662",
25
- enumerable: false,
26
- configurable: true
27
- });
28
- }
20
+ const manifestChunks = await glob('*.{js,json,js.map}', {
21
+ cwd: distDir
22
+ });
29
23
  const inlineSema = new Sema(8);
30
24
  const nextConfigEnvKeys = Object.keys(nextConfigEnv).map((item)=>item.split('process.env.').pop());
31
25
  const builtRegEx = new RegExp(`[\\w]{1,}(\\.env)?\\.(?:NEXT_PUBLIC_[\\w]{1,}${nextConfigEnvKeys.length ? '|' + nextConfigEnvKeys.join('|') : ''})`, 'g');
32
26
  const changedClientFiles = [];
27
+ const filesToCheck = new Set(manifestChunks.map((f)=>path.join(distDir, f)));
33
28
  for (const [parentDir, files] of [
34
29
  [
35
30
  serverDir,
@@ -58,6 +53,7 @@ export async function inlineStaticEnv({ distDir, config, buildId }) {
58
53
  content: newContent
59
54
  });
60
55
  }
56
+ filesToCheck.add(filepath);
61
57
  inlineSema.release();
62
58
  }));
63
59
  }
@@ -80,14 +76,13 @@ export async function inlineStaticEnv({ distDir, config, buildId }) {
80
76
  newHash
81
77
  });
82
78
  const filepath = path.join(clientDir, file);
83
- await fs.promises.rename(filepath, filepath.replace(originalHash, newHash));
79
+ const newFilepath = filepath.replace(originalHash, newHash);
80
+ filesToCheck.delete(filepath);
81
+ filesToCheck.add(newFilepath);
82
+ await fs.promises.rename(filepath, newFilepath);
84
83
  }
85
84
  // update build-manifest and webpack-runtime with new hashes
86
- for (const file of [
87
- path.join(distDir, BUILD_MANIFEST),
88
- path.join(distDir, 'static', webpackRuntimeFile),
89
- path.join(distDir, 'static', buildId, '_buildManifest.js')
90
- ]){
85
+ for (let file of filesToCheck){
91
86
  const content = await fs.promises.readFile(file, 'utf-8');
92
87
  let newContent = content;
93
88
  for (const { originalHash, newHash } of hashChanges){
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/lib/inline-static-env.ts"],"sourcesContent":["import fs from 'fs'\nimport path from 'path'\nimport crypto from 'crypto'\nimport { promisify } from 'util'\nimport globOriginal from 'next/dist/compiled/glob'\nimport { Sema } from 'next/dist/compiled/async-sema'\nimport type { NextConfigComplete } from '../server/config-shared'\nimport { BUILD_MANIFEST } from '../shared/lib/constants'\nimport { getNextConfigEnv, getStaticEnv } from './static-env'\n\nconst glob = promisify(globOriginal)\n\nexport async function inlineStaticEnv({\n distDir,\n config,\n buildId,\n}: {\n distDir: string\n buildId: string\n config: NextConfigComplete\n}) {\n const nextConfigEnv = getNextConfigEnv(config)\n const staticEnv = getStaticEnv(config)\n\n const serverDir = path.join(distDir, 'server')\n const serverChunks = await glob('**/*.js', {\n cwd: serverDir,\n })\n const clientDir = path.join(distDir, 'static')\n const clientChunks = await glob('**/*.js', {\n cwd: clientDir,\n })\n const webpackRuntimeFile = clientChunks.find((item) =>\n item.match(/webpack-[a-z0-9]{16}/)\n )\n\n if (!webpackRuntimeFile) {\n throw new Error(`Invariant failed to find webpack runtime chunk`)\n }\n\n const inlineSema = new Sema(8)\n const nextConfigEnvKeys = Object.keys(nextConfigEnv).map((item) =>\n item.split('process.env.').pop()\n )\n\n const builtRegEx = new RegExp(\n `[\\\\w]{1,}(\\\\.env)?\\\\.(?:NEXT_PUBLIC_[\\\\w]{1,}${nextConfigEnvKeys.length ? '|' + nextConfigEnvKeys.join('|') : ''})`,\n 'g'\n )\n const changedClientFiles: Array<{ file: string; content: string }> = []\n\n for (const [parentDir, files] of [\n [serverDir, serverChunks],\n [clientDir, clientChunks],\n ] as const) {\n await Promise.all(\n files.map(async (file) => {\n await inlineSema.acquire()\n const filepath = path.join(parentDir, file)\n const content = await fs.promises.readFile(filepath, 'utf8')\n const newContent = content.replace(builtRegEx, (match) => {\n let normalizedMatch = `process.env.${match.split('.').pop()}`\n\n if (staticEnv[normalizedMatch]) {\n return JSON.stringify(staticEnv[normalizedMatch])\n }\n return match\n })\n\n await fs.promises.writeFile(filepath, newContent)\n\n if (content !== newContent && parentDir === clientDir) {\n changedClientFiles.push({ file, content: newContent })\n }\n inlineSema.release()\n })\n )\n }\n const hashChanges: Array<{\n originalHash: string\n newHash: string\n }> = []\n\n // hashes need updating for any changed client files\n for (const { file, content } of changedClientFiles) {\n // hash is 16 chars currently for all client chunks\n const originalHash = file.match(/([a-z0-9]{16})\\./)?.[1] || ''\n\n if (!originalHash) {\n throw new Error(\n `Invariant: client chunk changed but failed to detect hash ${file}`\n )\n }\n const newHash = crypto\n .createHash('sha256')\n .update(content)\n .digest('hex')\n .substring(0, 16)\n\n hashChanges.push({ originalHash, newHash })\n const filepath = path.join(clientDir, file)\n await fs.promises.rename(filepath, filepath.replace(originalHash, newHash))\n }\n\n // update build-manifest and webpack-runtime with new hashes\n for (const file of [\n path.join(distDir, BUILD_MANIFEST),\n path.join(distDir, 'static', webpackRuntimeFile),\n path.join(distDir, 'static', buildId, '_buildManifest.js'),\n ]) {\n const content = await fs.promises.readFile(file, 'utf-8')\n let newContent = content\n\n for (const { originalHash, newHash } of hashChanges) {\n newContent = newContent.replaceAll(originalHash, newHash)\n }\n if (content !== newContent) {\n await fs.promises.writeFile(file, newContent)\n }\n }\n}\n"],"names":["fs","path","crypto","promisify","globOriginal","Sema","BUILD_MANIFEST","getNextConfigEnv","getStaticEnv","glob","inlineStaticEnv","distDir","config","buildId","nextConfigEnv","staticEnv","serverDir","join","serverChunks","cwd","clientDir","clientChunks","webpackRuntimeFile","find","item","match","Error","inlineSema","nextConfigEnvKeys","Object","keys","map","split","pop","builtRegEx","RegExp","length","changedClientFiles","parentDir","files","Promise","all","file","acquire","filepath","content","promises","readFile","newContent","replace","normalizedMatch","JSON","stringify","writeFile","push","release","hashChanges","originalHash","newHash","createHash","update","digest","substring","rename","replaceAll"],"mappings":"AAAA,OAAOA,QAAQ,KAAI;AACnB,OAAOC,UAAU,OAAM;AACvB,OAAOC,YAAY,SAAQ;AAC3B,SAASC,SAAS,QAAQ,OAAM;AAChC,OAAOC,kBAAkB,0BAAyB;AAClD,SAASC,IAAI,QAAQ,gCAA+B;AAEpD,SAASC,cAAc,QAAQ,0BAAyB;AACxD,SAASC,gBAAgB,EAAEC,YAAY,QAAQ,eAAc;AAE7D,MAAMC,OAAON,UAAUC;AAEvB,OAAO,eAAeM,gBAAgB,EACpCC,OAAO,EACPC,MAAM,EACNC,OAAO,EAKR;IACC,MAAMC,gBAAgBP,iBAAiBK;IACvC,MAAMG,YAAYP,aAAaI;IAE/B,M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,OAAO,EAAE,IAAIF,YAAa;YACnDR,aAAaA,WAAWgB,UAAU,CAACP,cAAcC;QACnD;QACA,IAAIb,YAAYG,YAAY;YAC1B,MAAMhD,GAAG8C,QAAQ,CAACO,SAAS,CAACX,MAAMM;QACpC;IACF;AACF"}
1
+ {"version":3,"sources":["../../src/lib/inline-static-env.ts"],"sourcesContent":["import fs from 'fs'\nimport path from 'path'\nimport crypto from 'crypto'\nimport { promisify } from 'util'\nimport globOriginal from 'next/dist/compiled/glob'\nimport { Sema } from 'next/dist/compiled/async-sema'\nimport type { NextConfigComplete } from '../server/config-shared'\nimport { getNextConfigEnv, getStaticEnv } from './static-env'\n\nconst glob = promisify(globOriginal)\n\nexport async function inlineStaticEnv({\n distDir,\n config,\n}: {\n distDir: string\n config: NextConfigComplete\n}) {\n const nextConfigEnv = getNextConfigEnv(config)\n const staticEnv = getStaticEnv(config)\n\n const serverDir = path.join(distDir, 'server')\n const serverChunks = await glob('**/*.{js,json,js.map}', {\n cwd: serverDir,\n })\n const clientDir = path.join(distDir, 'static')\n const clientChunks = await glob('**/*.{js,json,js.map}', {\n cwd: clientDir,\n })\n const manifestChunks = await glob('*.{js,json,js.map}', {\n cwd: distDir,\n })\n\n const inlineSema = new Sema(8)\n const nextConfigEnvKeys = Object.keys(nextConfigEnv).map((item) =>\n item.split('process.env.').pop()\n )\n\n const builtRegEx = new RegExp(\n `[\\\\w]{1,}(\\\\.env)?\\\\.(?:NEXT_PUBLIC_[\\\\w]{1,}${nextConfigEnvKeys.length ? '|' + nextConfigEnvKeys.join('|') : ''})`,\n 'g'\n )\n const changedClientFiles: Array<{ file: string; content: string }> = []\n const filesToCheck = new Set<string>(\n manifestChunks.map((f) => path.join(distDir, f))\n )\n\n for (const [parentDir, files] of [\n [serverDir, serverChunks],\n [clientDir, clientChunks],\n ] as const) {\n await Promise.all(\n files.map(async (file) => {\n await inlineSema.acquire()\n const filepath = path.join(parentDir, file)\n const content = await fs.promises.readFile(filepath, 'utf8')\n const newContent = content.replace(builtRegEx, (match) => {\n let normalizedMatch = `process.env.${match.split('.').pop()}`\n\n if (staticEnv[normalizedMatch]) {\n return JSON.stringify(staticEnv[normalizedMatch])\n }\n return match\n })\n\n await fs.promises.writeFile(filepath, newContent)\n\n if (content !== newContent && parentDir === clientDir) {\n changedClientFiles.push({ file, content: newContent })\n }\n filesToCheck.add(filepath)\n inlineSema.release()\n })\n )\n }\n const hashChanges: Array<{\n originalHash: string\n newHash: string\n }> = []\n\n // hashes need updating for any changed client files\n for (const { file, content } of changedClientFiles) {\n // hash is 16 chars currently for all client chunks\n const originalHash = file.match(/([a-z0-9]{16})\\./)?.[1] || ''\n\n if (!originalHash) {\n throw new Error(\n `Invariant: client chunk changed but failed to detect hash ${file}`\n )\n }\n const newHash = crypto\n .createHash('sha256')\n .update(content)\n .digest('hex')\n .substring(0, 16)\n\n hashChanges.push({ originalHash, newHash })\n\n const filepath = path.join(clientDir, file)\n const newFilepath = filepath.replace(originalHash, newHash)\n\n filesToCheck.delete(filepath)\n filesToCheck.add(newFilepath)\n\n await fs.promises.rename(filepath, newFilepath)\n }\n\n // update build-manifest and webpack-runtime with new hashes\n for (let file of filesToCheck) {\n const content = await fs.promises.readFile(file, 'utf-8')\n let newContent = content\n\n for (const { originalHash, newHash } of hashChanges) {\n newContent = newContent.replaceAll(originalHash, newHash)\n }\n if (content !== newContent) {\n await fs.promises.writeFile(file, newContent)\n }\n }\n}\n"],"names":["fs","path","crypto","promisify","globOriginal","Sema","getNextConfigEnv","getStaticEnv","glob","inlineStaticEnv","distDir","config","nextConfigEnv","staticEnv","serverDir","join","serverChunks","cwd","clientDir","clientChunks","manifestChunks","inlineSema","nextConfigEnvKeys","Object","keys","map","item","split","pop","builtRegEx","RegExp","length","changedClientFiles","filesToCheck","Set","f","parentDir","files","Promise","all","file","acquire","filepath","content","promises","readFile","newContent","replace","match","normalizedMatch","JSON","stringify","writeFile","push","add","release","hashChanges","originalHash","Error","newHash","createHash","update","digest","substring","newFilepath","delete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,OAAO,CAACU,cAAcE;QAEnD1B,aAAagC,MAAM,CAACvB;QACpBT,aAAaqB,GAAG,CAACU;QAEjB,MAAMhE,GAAG4C,QAAQ,CAACsB,MAAM,CAACxB,UAAUsB;IACrC;IAEA,4DAA4D;IAC5D,KAAK,IAAIxB,QAAQP,aAAc;QAC7B,MAAMU,UAAU,MAAM3C,GAAG4C,QAAQ,CAACC,QAAQ,CAACL,MAAM;QACjD,IAAIM,aAAaH;QAEjB,KAAK,MAAM,EAAEc,YAAY,EAAEE,OAAO,EAAE,IAAIH,YAAa;YACnDV,aAAaA,WAAWqB,UAAU,CAACV,cAAcE;QACnD;QACA,IAAIhB,YAAYG,YAAY;YAC1B,MAAM9C,GAAG4C,QAAQ,CAACQ,SAAS,CAACZ,MAAMM;QACpC;IACF;AACF"}
@@ -83,7 +83,7 @@ export async function createHotReloaderTurbopack(opts, serverFields, distDir, re
83
83
  }
84
84
  const hasRewrites = opts.fsChecker.rewrites.afterFiles.length > 0 || opts.fsChecker.rewrites.beforeFiles.length > 0 || opts.fsChecker.rewrites.fallback.length > 0;
85
85
  const hotReloaderSpan = trace('hot-reloader', undefined, {
86
- version: "15.3.0-canary.4"
86
+ version: "15.3.0-canary.5"
87
87
  });
88
88
  // Ensure the hotReloaderSpan is flushed immediately as it's the parentSpan for all processing
89
89
  // of the current `next dev` invocation.
@@ -180,7 +180,7 @@ export default class HotReloaderWebpack {
180
180
  this.previewProps = previewProps;
181
181
  this.rewrites = rewrites;
182
182
  this.hotReloaderSpan = trace('hot-reloader', undefined, {
183
- version: "15.3.0-canary.4"
183
+ version: "15.3.0-canary.5"
184
184
  });
185
185
  // Ensure the hotReloaderSpan is flushed immediately as it's the parentSpan for all processing
186
186
  // of the current `next dev` invocation.
@@ -4,7 +4,7 @@ import { bold, purple } from '../../lib/picocolors';
4
4
  import { PHASE_DEVELOPMENT_SERVER, PHASE_PRODUCTION_BUILD } from '../../shared/lib/constants';
5
5
  import loadConfig, { getConfiguredExperimentalFeatures } from '../config';
6
6
  export function logStartInfo({ networkUrl, appUrl, envInfo, experimentalFeatures, maxExperimentalFeatures = Infinity }) {
7
- Log.bootstrap(`${bold(purple(`${Log.prefixes.ready} Next.js ${"15.3.0-canary.4"}`))}${process.env.TURBOPACK ? ' (Turbopack)' : ''}`);
7
+ Log.bootstrap(`${bold(purple(`${Log.prefixes.ready} Next.js ${"15.3.0-canary.5"}`))}${process.env.TURBOPACK ? ' (Turbopack)' : ''}`);
8
8
  if (appUrl) {
9
9
  Log.bootstrap(`- Local: ${appUrl}`);
10
10
  }
@@ -43,7 +43,7 @@ export async function getRequestHandlers({ dir, port, isDev, onDevServerCleanup,
43
43
  export async function startServer(serverOptions) {
44
44
  const { dir, isDev, hostname, minimalMode, allowRetry, keepAliveTimeout, selfSignedCertificate } = serverOptions;
45
45
  let { port } = serverOptions;
46
- process.title = `next-server (v${"15.3.0-canary.4"})`;
46
+ process.title = `next-server (v${"15.3.0-canary.5"})`;
47
47
  let handlersReady = ()=>{};
48
48
  let handlersError = ()=>{};
49
49
  let handlersPromise = new Promise((resolve, reject)=>{
@@ -1,6 +1,6 @@
1
1
  export function isStableBuild() {
2
2
  var _process_env___NEXT_VERSION;
3
- return !((_process_env___NEXT_VERSION = "15.3.0-canary.4") == null ? void 0 : _process_env___NEXT_VERSION.includes('canary')) && !process.env.__NEXT_TEST_MODE && !process.env.NEXT_PRIVATE_LOCAL_DEV;
3
+ return !((_process_env___NEXT_VERSION = "15.3.0-canary.5") == null ? void 0 : _process_env___NEXT_VERSION.includes('canary')) && !process.env.__NEXT_TEST_MODE && !process.env.NEXT_PRIVATE_LOCAL_DEV;
4
4
  }
5
5
  export class CanaryOnlyError extends Error {
6
6
  constructor(arg){
@@ -1,6 +1,5 @@
1
1
  import type { NextConfigComplete } from '../server/config-shared';
2
- export declare function inlineStaticEnv({ distDir, config, buildId, }: {
2
+ export declare function inlineStaticEnv({ distDir, config, }: {
3
3
  distDir: string;
4
- buildId: string;
5
4
  config: NextConfigComplete;
6
5
  }): Promise<void>;
@@ -14,7 +14,6 @@ const _crypto = /*#__PURE__*/ _interop_require_default(require("crypto"));
14
14
  const _util = require("util");
15
15
  const _glob = /*#__PURE__*/ _interop_require_default(require("next/dist/compiled/glob"));
16
16
  const _asyncsema = require("next/dist/compiled/async-sema");
17
- const _constants = require("../shared/lib/constants");
18
17
  const _staticenv = require("./static-env");
19
18
  function _interop_require_default(obj) {
20
19
  return obj && obj.__esModule ? obj : {
@@ -22,29 +21,25 @@ function _interop_require_default(obj) {
22
21
  };
23
22
  }
24
23
  const glob = (0, _util.promisify)(_glob.default);
25
- async function inlineStaticEnv({ distDir, config, buildId }) {
24
+ async function inlineStaticEnv({ distDir, config }) {
26
25
  const nextConfigEnv = (0, _staticenv.getNextConfigEnv)(config);
27
26
  const staticEnv = (0, _staticenv.getStaticEnv)(config);
28
27
  const serverDir = _path.default.join(distDir, 'server');
29
- const serverChunks = await glob('**/*.js', {
28
+ const serverChunks = await glob('**/*.{js,json,js.map}', {
30
29
  cwd: serverDir
31
30
  });
32
31
  const clientDir = _path.default.join(distDir, 'static');
33
- const clientChunks = await glob('**/*.js', {
32
+ const clientChunks = await glob('**/*.{js,json,js.map}', {
34
33
  cwd: clientDir
35
34
  });
36
- const webpackRuntimeFile = clientChunks.find((item)=>item.match(/webpack-[a-z0-9]{16}/));
37
- if (!webpackRuntimeFile) {
38
- throw Object.defineProperty(new Error(`Invariant failed to find webpack runtime chunk`), "__NEXT_ERROR_CODE", {
39
- value: "E662",
40
- enumerable: false,
41
- configurable: true
42
- });
43
- }
35
+ const manifestChunks = await glob('*.{js,json,js.map}', {
36
+ cwd: distDir
37
+ });
44
38
  const inlineSema = new _asyncsema.Sema(8);
45
39
  const nextConfigEnvKeys = Object.keys(nextConfigEnv).map((item)=>item.split('process.env.').pop());
46
40
  const builtRegEx = new RegExp(`[\\w]{1,}(\\.env)?\\.(?:NEXT_PUBLIC_[\\w]{1,}${nextConfigEnvKeys.length ? '|' + nextConfigEnvKeys.join('|') : ''})`, 'g');
47
41
  const changedClientFiles = [];
42
+ const filesToCheck = new Set(manifestChunks.map((f)=>_path.default.join(distDir, f)));
48
43
  for (const [parentDir, files] of [
49
44
  [
50
45
  serverDir,
@@ -73,6 +68,7 @@ async function inlineStaticEnv({ distDir, config, buildId }) {
73
68
  content: newContent
74
69
  });
75
70
  }
71
+ filesToCheck.add(filepath);
76
72
  inlineSema.release();
77
73
  }));
78
74
  }
@@ -95,14 +91,13 @@ async function inlineStaticEnv({ distDir, config, buildId }) {
95
91
  newHash
96
92
  });
97
93
  const filepath = _path.default.join(clientDir, file);
98
- await _fs.default.promises.rename(filepath, filepath.replace(originalHash, newHash));
94
+ const newFilepath = filepath.replace(originalHash, newHash);
95
+ filesToCheck.delete(filepath);
96
+ filesToCheck.add(newFilepath);
97
+ await _fs.default.promises.rename(filepath, newFilepath);
99
98
  }
100
99
  // update build-manifest and webpack-runtime with new hashes
101
- for (const file of [
102
- _path.default.join(distDir, _constants.BUILD_MANIFEST),
103
- _path.default.join(distDir, 'static', webpackRuntimeFile),
104
- _path.default.join(distDir, 'static', buildId, '_buildManifest.js')
105
- ]){
100
+ for (let file of filesToCheck){
106
101
  const content = await _fs.default.promises.readFile(file, 'utf-8');
107
102
  let newContent = content;
108
103
  for (const { originalHash, newHash } of hashChanges){
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/lib/inline-static-env.ts"],"sourcesContent":["import fs from 'fs'\nimport path from 'path'\nimport crypto from 'crypto'\nimport { promisify } from 'util'\nimport globOriginal from 'next/dist/compiled/glob'\nimport { Sema } from 'next/dist/compiled/async-sema'\nimport type { NextConfigComplete } from '../server/config-shared'\nimport { BUILD_MANIFEST } from '../shared/lib/constants'\nimport { getNextConfigEnv, getStaticEnv } from './static-env'\n\nconst glob = promisify(globOriginal)\n\nexport async function inlineStaticEnv({\n distDir,\n config,\n buildId,\n}: {\n distDir: string\n buildId: string\n config: NextConfigComplete\n}) {\n const nextConfigEnv = getNextConfigEnv(config)\n const staticEnv = getStaticEnv(config)\n\n const serverDir = path.join(distDir, 'server')\n const serverChunks = await glob('**/*.js', {\n cwd: serverDir,\n })\n const clientDir = path.join(distDir, 'static')\n const clientChunks = await glob('**/*.js', {\n cwd: clientDir,\n })\n const webpackRuntimeFile = clientChunks.find((item) =>\n item.match(/webpack-[a-z0-9]{16}/)\n )\n\n if (!webpackRuntimeFile) {\n throw new Error(`Invariant failed to find webpack runtime chunk`)\n }\n\n const inlineSema = new Sema(8)\n const nextConfigEnvKeys = Object.keys(nextConfigEnv).map((item) =>\n item.split('process.env.').pop()\n )\n\n const builtRegEx = new RegExp(\n `[\\\\w]{1,}(\\\\.env)?\\\\.(?:NEXT_PUBLIC_[\\\\w]{1,}${nextConfigEnvKeys.length ? '|' + nextConfigEnvKeys.join('|') : ''})`,\n 'g'\n )\n const changedClientFiles: Array<{ file: string; content: string }> = []\n\n for (const [parentDir, files] of [\n [serverDir, serverChunks],\n [clientDir, clientChunks],\n ] as const) {\n await Promise.all(\n files.map(async (file) => {\n await inlineSema.acquire()\n const filepath = path.join(parentDir, file)\n const content = await fs.promises.readFile(filepath, 'utf8')\n const newContent = content.replace(builtRegEx, (match) => {\n let normalizedMatch = `process.env.${match.split('.').pop()}`\n\n if (staticEnv[normalizedMatch]) {\n return JSON.stringify(staticEnv[normalizedMatch])\n }\n return match\n })\n\n await fs.promises.writeFile(filepath, newContent)\n\n if (content !== newContent && parentDir === clientDir) {\n changedClientFiles.push({ file, content: newContent })\n }\n inlineSema.release()\n })\n )\n }\n const hashChanges: Array<{\n originalHash: string\n newHash: string\n }> = []\n\n // hashes need updating for any changed client files\n for (const { file, content } of changedClientFiles) {\n // hash is 16 chars currently for all client chunks\n const originalHash = file.match(/([a-z0-9]{16})\\./)?.[1] || ''\n\n if (!originalHash) {\n throw new Error(\n `Invariant: client chunk changed but failed to detect hash ${file}`\n )\n }\n const newHash = crypto\n .createHash('sha256')\n .update(content)\n .digest('hex')\n .substring(0, 16)\n\n hashChanges.push({ originalHash, newHash })\n const filepath = path.join(clientDir, file)\n await fs.promises.rename(filepath, filepath.replace(originalHash, newHash))\n }\n\n // update build-manifest and webpack-runtime with new hashes\n for (const file of [\n path.join(distDir, BUILD_MANIFEST),\n path.join(distDir, 'static', webpackRuntimeFile),\n path.join(distDir, 'static', buildId, '_buildManifest.js'),\n ]) {\n const content = await fs.promises.readFile(file, 'utf-8')\n let newContent = content\n\n for (const { originalHash, newHash } of hashChanges) {\n newContent = newContent.replaceAll(originalHash, newHash)\n }\n if (content !== newContent) {\n await fs.promises.writeFile(file, newContent)\n }\n }\n}\n"],"names":["inlineStaticEnv","glob","promisify","globOriginal","distDir","config","buildId","nextConfigEnv","getNextConfigEnv","staticEnv","getStaticEnv","serverDir","path","join","serverChunks","cwd","clientDir","clientChunks","webpackRuntimeFile","find","item","match","Error","inlineSema","Sema","nextConfigEnvKeys","Object","keys","map","split","pop","builtRegEx","RegExp","length","changedClientFiles","parentDir","files","Promise","all","file","acquire","filepath","content","fs","promises","readFile","newContent","replace","normalizedMatch","JSON","stringify","writeFile","push","release","hashChanges","originalHash","newHash","crypto","createHash","update","digest","substring","rename","BUILD_MANIFEST","replaceAll"],"mappings":";;;;+BAYsBA;;;eAAAA;;;2DAZP;6DACE;+DACE;sBACO;6DACD;2BACJ;2BAEU;2BACgB;;;;;;AAE/C,MAAMC,OAAOC,IAAAA,eAAS,EAACC,aAAY;AAE5B,eAAeH,gBAAgB,EACpCI,OAAO,EACPC,MAAM,EACNC,OAAO,EAKR;IACC,MAAMC,gBAAgBC,IAAAA,2BAAgB,EAACH;IACvC,MAAMI,YAAYC,IAAAA,uBAAY,EAACL;IAE/B,MAAMM,YAAYC,aAAI,CAACC,IAAI,CAACT,SAAS;IACrC,MAAMU,eAAe,MAAMb,KAAK,WAAW;QACzCc,KAAKJ;IACP;IACA,MAAMK,YAAYJ,aAAI,CAACC,IAAI,CAACT,SAAS;IACrC,MAAMa,eAAe,MAAMhB,KAAK,WAAW;QACzCc,KAAKC;IACP;I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S,CAACZ,MAAMO;QACpC;IACF;AACF"}
1
+ {"version":3,"sources":["../../src/lib/inline-static-env.ts"],"sourcesContent":["import fs from 'fs'\nimport path from 'path'\nimport crypto from 'crypto'\nimport { promisify } from 'util'\nimport globOriginal from 'next/dist/compiled/glob'\nimport { Sema } from 'next/dist/compiled/async-sema'\nimport type { NextConfigComplete } from '../server/config-shared'\nimport { getNextConfigEnv, getStaticEnv } from './static-env'\n\nconst glob = promisify(globOriginal)\n\nexport async function inlineStaticEnv({\n distDir,\n config,\n}: {\n distDir: string\n config: NextConfigComplete\n}) {\n const nextConfigEnv = getNextConfigEnv(config)\n const staticEnv = getStaticEnv(config)\n\n const serverDir = path.join(distDir, 'server')\n const serverChunks = await glob('**/*.{js,json,js.map}', {\n cwd: serverDir,\n })\n const clientDir = path.join(distDir, 'static')\n const clientChunks = await glob('**/*.{js,json,js.map}', {\n cwd: clientDir,\n })\n const manifestChunks = await glob('*.{js,json,js.map}', {\n cwd: distDir,\n })\n\n const inlineSema = new Sema(8)\n const nextConfigEnvKeys = Object.keys(nextConfigEnv).map((item) =>\n item.split('process.env.').pop()\n )\n\n const builtRegEx = new RegExp(\n `[\\\\w]{1,}(\\\\.env)?\\\\.(?:NEXT_PUBLIC_[\\\\w]{1,}${nextConfigEnvKeys.length ? '|' + nextConfigEnvKeys.join('|') : ''})`,\n 'g'\n )\n const changedClientFiles: Array<{ file: string; content: string }> = []\n const filesToCheck = new Set<string>(\n manifestChunks.map((f) => path.join(distDir, f))\n )\n\n for (const [parentDir, files] of [\n [serverDir, serverChunks],\n [clientDir, clientChunks],\n ] as const) {\n await Promise.all(\n files.map(async (file) => {\n await inlineSema.acquire()\n const filepath = path.join(parentDir, file)\n const content = await fs.promises.readFile(filepath, 'utf8')\n const newContent = content.replace(builtRegEx, (match) => {\n let normalizedMatch = `process.env.${match.split('.').pop()}`\n\n if (staticEnv[normalizedMatch]) {\n return JSON.stringify(staticEnv[normalizedMatch])\n }\n return match\n })\n\n await fs.promises.writeFile(filepath, newContent)\n\n if (content !== newContent && parentDir === clientDir) {\n changedClientFiles.push({ file, content: newContent })\n }\n filesToCheck.add(filepath)\n inlineSema.release()\n })\n )\n }\n const hashChanges: Array<{\n originalHash: string\n newHash: string\n }> = []\n\n // hashes need updating for any changed client files\n for (const { file, content } of changedClientFiles) {\n // hash is 16 chars currently for all client chunks\n const originalHash = file.match(/([a-z0-9]{16})\\./)?.[1] || ''\n\n if (!originalHash) {\n throw new Error(\n `Invariant: client chunk changed but failed to detect hash ${file}`\n )\n }\n const newHash = crypto\n .createHash('sha256')\n .update(content)\n .digest('hex')\n .substring(0, 16)\n\n hashChanges.push({ originalHash, newHash })\n\n const filepath = path.join(clientDir, file)\n const newFilepath = filepath.replace(originalHash, newHash)\n\n filesToCheck.delete(filepath)\n filesToCheck.add(newFilepath)\n\n await fs.promises.rename(filepath, newFilepath)\n }\n\n // update build-manifest and webpack-runtime with new hashes\n for (let file of filesToCheck) {\n const content = await fs.promises.readFile(file, 'utf-8')\n let newContent = content\n\n for (const { originalHash, newHash } of hashChanges) {\n newContent = newContent.replaceAll(originalHash, newHash)\n }\n if (content !== newContent) {\n await fs.promises.writeFile(file, newContent)\n }\n }\n}\n"],"names":["inlineStaticEnv","glob","promisify","globOriginal","distDir","config","nextConfigEnv","getNextConfigEnv","staticEnv","getStaticEnv","serverDir","path","join","serverChunks","cwd","clientDir","clientChunks","manifestChunks","inlineSema","Sema","nextConfigEnvKeys","Object","keys","map","item","split","pop","builtRegEx","RegExp","length","changedClientFiles","filesToCheck","Set","f","parentDir","files","Promise","all","file","acquire","filepath","content","fs","promises","readFile","newContent","replace","match","normalizedMatch","JSON","stringify","writeFile","push","add","release","hashChanges","originalHash","Error","newHash","crypto","createHash","update","digest","substring","newFilepath","delete","rename","replaceAll"],"mappings":";;;;+BAWsBA;;;eAAAA;;;2DAXP;6DACE;+DACE;sBACO;6DACD;2BACJ;2BAE0B;;;;;;AAE/C,MAAMC,OAAOC,IAAAA,eAAS,EAACC,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c;QAC7B,MAAMU,UAAU,MAAMC,WAAE,CAACC,QAAQ,CAACC,QAAQ,CAACN,MAAM;QACjD,IAAIO,aAAaJ;QAEjB,KAAK,MAAM,EAAEe,YAAY,EAAEE,OAAO,EAAE,IAAIH,YAAa;YACnDV,aAAaA,WAAWsB,UAAU,CAACX,cAAcE;QACnD;QACA,IAAIjB,YAAYI,YAAY;YAC1B,MAAMH,WAAE,CAACC,QAAQ,CAACQ,SAAS,CAACb,MAAMO;QACpC;IACF;AACF"}
@@ -139,7 +139,7 @@ async function createHotReloaderTurbopack(opts, serverFields, distDir, resetFetc
139
139
  }
140
140
  const hasRewrites = opts.fsChecker.rewrites.afterFiles.length > 0 || opts.fsChecker.rewrites.beforeFiles.length > 0 || opts.fsChecker.rewrites.fallback.length > 0;
141
141
  const hotReloaderSpan = (0, _trace.trace)('hot-reloader', undefined, {
142
- version: "15.3.0-canary.4"
142
+ version: "15.3.0-canary.5"
143
143
  });
144
144
  // Ensure the hotReloaderSpan is flushed immediately as it's the parentSpan for all processing
145
145
  // of the current `next dev` invocation.
@@ -256,7 +256,7 @@ class HotReloaderWebpack {
256
256
  this.previewProps = previewProps;
257
257
  this.rewrites = rewrites;
258
258
  this.hotReloaderSpan = (0, _trace.trace)('hot-reloader', undefined, {
259
- version: "15.3.0-canary.4"
259
+ version: "15.3.0-canary.5"
260
260
  });
261
261
  // Ensure the hotReloaderSpan is flushed immediately as it's the parentSpan for all processing
262
262
  // of the current `next dev` invocation.
@@ -67,7 +67,7 @@ function _interop_require_wildcard(obj, nodeInterop) {
67
67
  return newObj;
68
68
  }
69
69
  function logStartInfo({ networkUrl, appUrl, envInfo, experimentalFeatures, maxExperimentalFeatures = Infinity }) {
70
- _log.bootstrap(`${(0, _picocolors.bold)((0, _picocolors.purple)(`${_log.prefixes.ready} Next.js ${"15.3.0-canary.4"}`))}${process.env.TURBOPACK ? ' (Turbopack)' : ''}`);
70
+ _log.bootstrap(`${(0, _picocolors.bold)((0, _picocolors.purple)(`${_log.prefixes.ready} Next.js ${"15.3.0-canary.5"}`))}${process.env.TURBOPACK ? ' (Turbopack)' : ''}`);
71
71
  if (appUrl) {
72
72
  _log.bootstrap(`- Local: ${appUrl}`);
73
73
  }
@@ -111,7 +111,7 @@ async function getRequestHandlers({ dir, port, isDev, onDevServerCleanup, server
111
111
  async function startServer(serverOptions) {
112
112
  const { dir, isDev, hostname, minimalMode, allowRetry, keepAliveTimeout, selfSignedCertificate } = serverOptions;
113
113
  let { port } = serverOptions;
114
- process.title = `next-server (v${"15.3.0-canary.4"})`;
114
+ process.title = `next-server (v${"15.3.0-canary.5"})`;
115
115
  let handlersReady = ()=>{};
116
116
  let handlersError = ()=>{};
117
117
  let handlersPromise = new Promise((resolve, reject)=>{
@@ -22,7 +22,7 @@ _export(exports, {
22
22
  });
23
23
  function isStableBuild() {
24
24
  var _process_env___NEXT_VERSION;
25
- return !((_process_env___NEXT_VERSION = "15.3.0-canary.4") == null ? void 0 : _process_env___NEXT_VERSION.includes('canary')) && !process.env.__NEXT_TEST_MODE && !process.env.NEXT_PRIVATE_LOCAL_DEV;
25
+ return !((_process_env___NEXT_VERSION = "15.3.0-canary.5") == null ? void 0 : _process_env___NEXT_VERSION.includes('canary')) && !process.env.__NEXT_TEST_MODE && !process.env.NEXT_PRIVATE_LOCAL_DEV;
26
26
  }
27
27
  class CanaryOnlyError extends Error {
28
28
  constructor(arg){
@@ -81,7 +81,7 @@ function getAnonymousMeta() {
81
81
  isWsl: _iswsl.default,
82
82
  isCI: _ciinfo.isCI,
83
83
  ciName: _ciinfo.isCI && _ciinfo.name || null,
84
- nextVersion: "15.3.0-canary.4"
84
+ nextVersion: "15.3.0-canary.5"
85
85
  };
86
86
  return traits;
87
87
  }
@@ -11,11 +11,11 @@ Object.defineProperty(exports, "eventCliSessionStopped", {
11
11
  const EVENT_VERSION = 'NEXT_CLI_SESSION_STOPPED';
12
12
  function eventCliSessionStopped(event) {
13
13
  // This should be an invariant, if it fails our build tooling is broken.
14
- if (typeof "15.3.0-canary.4" !== 'string') {
14
+ if (typeof "15.3.0-canary.5" !== 'string') {
15
15
  return [];
16
16
  }
17
17
  const payload = {
18
- nextVersion: "15.3.0-canary.4",
18
+ nextVersion: "15.3.0-canary.5",
19
19
  nodeVersion: process.version,
20
20
  cliCommand: event.cliCommand,
21
21
  durationMilliseconds: event.durationMilliseconds,
@@ -36,12 +36,12 @@ function hasBabelConfig(dir) {
36
36
  function eventCliSession(dir, nextConfig, event) {
37
37
  var _nextConfig_experimental_staleTimes, _nextConfig_experimental_staleTimes1, _nextConfig_experimental_reactCompiler, _nextConfig_experimental_reactCompiler1;
38
38
  // This should be an invariant, if it fails our build tooling is broken.
39
- if (typeof "15.3.0-canary.4" !== 'string') {
39
+ if (typeof "15.3.0-canary.5" !== 'string') {
40
40
  return [];
41
41
  }
42
42
  const { images, i18n } = nextConfig || {};
43
43
  const payload = {
44
- nextVersion: "15.3.0-canary.4",
44
+ nextVersion: "15.3.0-canary.5",
45
45
  nodeVersion: process.version,
46
46
  cliCommand: event.cliCommand,
47
47
  isSrcDir: event.isSrcDir,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "next",
3
- "version": "15.3.0-canary.4",
3
+ "version": "15.3.0-canary.5",
4
4
  "description": "The React Framework",
5
5
  "main": "./dist/server/next.js",
6
6
  "license": "MIT",
@@ -100,7 +100,7 @@
100
100
  ]
101
101
  },
102
102
  "dependencies": {
103
- "@next/env": "15.3.0-canary.4",
103
+ "@next/env": "15.3.0-canary.5",
104
104
  "@swc/counter": "0.1.3",
105
105
  "@swc/helpers": "0.5.15",
106
106
  "busboy": "1.6.0",
@@ -132,14 +132,14 @@
132
132
  },
133
133
  "optionalDependencies": {
134
134
  "sharp": "^0.33.5",
135
- "@next/swc-darwin-arm64": "15.3.0-canary.4",
136
- "@next/swc-darwin-x64": "15.3.0-canary.4",
137
- "@next/swc-linux-arm64-gnu": "15.3.0-canary.4",
138
- "@next/swc-linux-arm64-musl": "15.3.0-canary.4",
139
- "@next/swc-linux-x64-gnu": "15.3.0-canary.4",
140
- "@next/swc-linux-x64-musl": "15.3.0-canary.4",
141
- "@next/swc-win32-arm64-msvc": "15.3.0-canary.4",
142
- "@next/swc-win32-x64-msvc": "15.3.0-canary.4"
135
+ "@next/swc-darwin-arm64": "15.3.0-canary.5",
136
+ "@next/swc-darwin-x64": "15.3.0-canary.5",
137
+ "@next/swc-linux-arm64-gnu": "15.3.0-canary.5",
138
+ "@next/swc-linux-arm64-musl": "15.3.0-canary.5",
139
+ "@next/swc-linux-x64-gnu": "15.3.0-canary.5",
140
+ "@next/swc-linux-x64-musl": "15.3.0-canary.5",
141
+ "@next/swc-win32-arm64-msvc": "15.3.0-canary.5",
142
+ "@next/swc-win32-x64-msvc": "15.3.0-canary.5"
143
143
  },
144
144
  "devDependencies": {
145
145
  "@ampproject/toolbox-optimizer": "2.8.3",
@@ -172,11 +172,11 @@
172
172
  "@jest/types": "29.5.0",
173
173
  "@mswjs/interceptors": "0.23.0",
174
174
  "@napi-rs/triples": "1.2.0",
175
- "@next/font": "15.3.0-canary.4",
176
- "@next/polyfill-module": "15.3.0-canary.4",
177
- "@next/polyfill-nomodule": "15.3.0-canary.4",
178
- "@next/react-refresh-utils": "15.3.0-canary.4",
179
- "@next/swc": "15.3.0-canary.4",
175
+ "@next/font": "15.3.0-canary.5",
176
+ "@next/polyfill-module": "15.3.0-canary.5",
177
+ "@next/polyfill-nomodule": "15.3.0-canary.5",
178
+ "@next/react-refresh-utils": "15.3.0-canary.5",
179
+ "@next/swc": "15.3.0-canary.5",
180
180
  "@opentelemetry/api": "1.6.0",
181
181
  "@playwright/test": "1.41.2",
182
182
  "@storybook/addon-a11y": "8.6.0",