Commit 7ec94b61 authored by Will Binns-Smith's avatar Will Binns-Smith

Refactor: Reorganize runtime files into shared/runtime directory

This prepares for extracting shared HMR logic by organizing runtime files into a clearer directory structure.

Also updates the AGENTS.md file telling it to read READMEs

This is a pure refactoring with no functional changes. Snapshot updates reflect the new file paths in the generated runtime code.
parent acf1625d
...@@ -39,6 +39,17 @@ The main Next.js framework lives in `packages/next/`. This is what gets publishe ...@@ -39,6 +39,17 @@ The main Next.js framework lives in `packages/next/`. This is what gets publishe
- `packages/font/` - `next/font` implementation - `packages/font/` - `next/font` implementation
- `packages/third-parties/` - Third-party script integrations - `packages/third-parties/` - Third-party script integrations
### README files
Before editing or creating files in any subdirectory (e.g., `packages/*`, `crates/*`), read all `README.md` files in the directory path from the repo root up to and including the target file's directory. This helps identify any local patterns, conventions, and documentation.
**Example:** Before editing `turbopack/crates/turbopack-ecmascript-runtime/js/src/nodejs/runtime/runtime-base.ts`, read:
- `turbopack/README.md` (if exists)
- `turbopack/crates/README.md` (if exists)
- `turbopack/crates/turbopack-ecmascript-runtime/README.md` (if exists)
- `turbopack/crates/turbopack-ecmascript-runtime/js/README.md` (if exists - closest to target file)
## Build Commands ## Build Commands
```bash ```bash
......
# Turbopack Ecmascript Runtime
This package holds the JavaScript code that is injected at runtime for Turbopack to function, such as chunk loading and module factory instantiation. In development, this includes hot module reload (a.k.a. fast refresh) runtime code.
## Turbopack JavaScript runtime code
This Turbopack browser runtime JavaScript code lives as TypeScript files in the following directories named `runtime`:
- `turbopack/crates/turbopack-ecmascript-runtime/js/src/browser/runtime`
- `turbopack/crates/turbopack-ecmascript-runtime/js/src/nodejs/runtime`
- `turbopack/crates/turbopack-ecmascript-runtime/js/src/shared/runtime`
Files in these directories are compiled and concatenated at Rust build-time to form the code that gets executed in browser and Node at runtime. These files are not EcmaScript modules nor CommonJS modules -- instead, the TypeScript uses `<reference>` tags to reference other values and types in scope when the files are concatenated. Other ts code in the runtime crate _can_ use esm though, such as: `turbopack/crates/turbopack-ecmascript-runtime/js/src/browser/dev/hmr-client/`.
/// <reference path="./dev-globals.d.ts" /> /// <reference path="../../../shared/runtime/dev-globals.d.ts" />
/// <reference path="./dev-protocol.d.ts" /> /// <reference path="../../../shared/runtime/dev-protocol.d.ts" />
/// <reference path="./dev-extensions.ts" />
interface TurbopackDevContext extends TurbopackBrowserBaseContext<HotModule> { interface TurbopackDevContext extends TurbopackBrowserBaseContext<HotModule> {
k: RefreshContext k: RefreshContext
......
...@@ -7,7 +7,7 @@ ...@@ -7,7 +7,7 @@
/* eslint-disable @typescript-eslint/no-unused-vars */ /* eslint-disable @typescript-eslint/no-unused-vars */
/// <reference path="../../../shared/runtime-utils.ts" /> /// <reference path="../../../shared/runtime/runtime-utils.ts" />
/// <reference path="../../../shared/require-type.d.ts" /> /// <reference path="../../../shared/require-type.d.ts" />
declare var BACKEND: RuntimeBackend declare var BACKEND: RuntimeBackend
...@@ -9,7 +9,7 @@ ...@@ -9,7 +9,7 @@
/* eslint-disable @typescript-eslint/no-unused-vars */ /* eslint-disable @typescript-eslint/no-unused-vars */
/// <reference path="../base/globals.d.ts" /> /// <reference path="../base/globals.d.ts" />
/// <reference path="../../../shared/runtime-utils.ts" /> /// <reference path="../../../shared/runtime/runtime-utils.ts" />
// Used in WebWorkers to tell the runtime about the chunk suffix // Used in WebWorkers to tell the runtime about the chunk suffix
declare var TURBOPACK_ASSET_SUFFIX: string declare var TURBOPACK_ASSET_SUFFIX: string
......
...@@ -7,7 +7,7 @@ ...@@ -7,7 +7,7 @@
/* eslint-disable @typescript-eslint/no-unused-vars */ /* eslint-disable @typescript-eslint/no-unused-vars */
/// <reference path="../../../browser/runtime/base/runtime-base.ts" /> /// <reference path="../../../browser/runtime/base/runtime-base.ts" />
/// <reference path="../../../shared/runtime-types.d.ts" /> /// <reference path="../../../shared/runtime/runtime-types.d.ts" />
function getAssetSuffixFromScriptSrc() { function getAssetSuffixFromScriptSrc() {
// TURBOPACK_ASSET_SUFFIX is set in web workers // TURBOPACK_ASSET_SUFFIX is set in web workers
......
...@@ -7,7 +7,7 @@ ...@@ -7,7 +7,7 @@
/* eslint-disable @typescript-eslint/no-unused-vars */ /* eslint-disable @typescript-eslint/no-unused-vars */
/// <reference path="../base/dev-protocol.d.ts" /> /// <reference path="../../../shared/runtime/dev-protocol.d.ts" />
let DEV_BACKEND: DevRuntimeBackend let DEV_BACKEND: DevRuntimeBackend
;(() => { ;(() => {
......
/// <reference path="../shared/runtime-utils.ts" /> /// <reference path="../shared/runtime/runtime-utils.ts" />
/// A 'base' utilities to support runtime can have externals. /// A 'base' utilities to support runtime can have externals.
/// Currently this is for node.js / edge runtime both. /// Currently this is for node.js / edge runtime both.
......
/* eslint-disable @typescript-eslint/no-unused-vars */ /* eslint-disable @typescript-eslint/no-unused-vars */
/// <reference path="../shared/runtime-utils.ts" /> /// <reference path="../shared/runtime/runtime-utils.ts" />
function readWebAssemblyAsResponse(path: string) { function readWebAssemblyAsResponse(path: string) {
const { createReadStream } = require('fs') as typeof import('fs') const { createReadStream } = require('fs') as typeof import('fs')
......
/// <reference path="../../../shared/runtime-utils.ts" /> /// <reference path="../runtime/runtime-utils.ts" />
/** /**
* Extensions to the shared runtime types that are specific to the development * Extensions to the shared runtime types that are specific to the development
......
{
"extends": "../tsconfig.json",
"compilerOptions": {
"composite": true,
"outDir": "./dist"
},
"include": ["./**/*"],
"references": []
}
...@@ -4,5 +4,5 @@ ...@@ -4,5 +4,5 @@
// environment, we need WebWorker for WebAssembly types // environment, we need WebWorker for WebAssembly types
"lib": ["ESNext", "WebWorker"] "lib": ["ESNext", "WebWorker"]
}, },
"include": ["*.ts"] "include": ["*.ts", "runtime/runtime-utils.ts", "runtime/runtime-types.d.ts"]
} }
...@@ -30,7 +30,7 @@ pub async fn get_browser_runtime_code( ...@@ -30,7 +30,7 @@ pub async fn get_browser_runtime_code(
let shared_runtime_utils_code = embed_static_code( let shared_runtime_utils_code = embed_static_code(
asset_context, asset_context,
rcstr!("shared/runtime-utils.ts"), rcstr!("shared/runtime/runtime-utils.ts"),
generate_source_map, generate_source_map,
); );
......
...@@ -18,7 +18,7 @@ pub async fn get_nodejs_runtime_code( ...@@ -18,7 +18,7 @@ pub async fn get_nodejs_runtime_code(
let shared_runtime_utils_code = embed_static_code( let shared_runtime_utils_code = embed_static_code(
asset_context, asset_context,
rcstr!("shared/runtime-utils.ts"), rcstr!("shared/runtime/runtime-utils.ts"),
generate_source_map, generate_source_map,
); );
let shared_base_external_utils_code = embed_static_code( let shared_base_external_utils_code = embed_static_code(
...@@ -38,7 +38,7 @@ pub async fn get_nodejs_runtime_code( ...@@ -38,7 +38,7 @@ pub async fn get_nodejs_runtime_code(
); );
let runtime_code = embed_static_code( let runtime_code = embed_static_code(
asset_context, asset_context,
rcstr!("nodejs/runtime.ts"), rcstr!("nodejs/runtime/runtime-base.ts"),
generate_source_map, generate_source_map,
); );
......
;!function(){try { var e="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof global?global:"undefined"!=typeof window?window:"undefined"!=typeof self?self:{},n=(new e.Error).stack;n&&((e._debugIds|| (e._debugIds={}))[n]="bd85f361-1530-0170-a15f-b3e3bd9abe29")}catch(e){}}(); ;!function(){try { var e="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof global?global:"undefined"!=typeof window?window:"undefined"!=typeof self?self:{},n=(new e.Error).stack;n&&((e._debugIds|| (e._debugIds={}))[n]="3b0e82e5-514a-a42c-bfe0-20484e208457")}catch(e){}}();
(globalThis["TURBOPACK"] || (globalThis["TURBOPACK"] = [])).push([ (globalThis["TURBOPACK"] || (globalThis["TURBOPACK"] = [])).push([
"output/ba425_crates_turbopack-tests_tests_snapshot_debug-ids_browser_input_index_0151fefb.js", "output/ba425_crates_turbopack-tests_tests_snapshot_debug-ids_browser_input_index_0151fefb.js",
{"otherChunks":["output/aaf3a_crates_turbopack-tests_tests_snapshot_debug-ids_browser_input_index_0b8736b3.js"],"runtimeModuleIds":["[project]/turbopack/crates/turbopack-tests/tests/snapshot/debug-ids/browser/input/index.js [test] (ecmascript)"]} {"otherChunks":["output/aaf3a_crates_turbopack-tests_tests_snapshot_debug-ids_browser_input_index_0b8736b3.js"],"runtimeModuleIds":["[project]/turbopack/crates/turbopack-tests/tests/snapshot/debug-ids/browser/input/index.js [test] (ecmascript)"]}
...@@ -521,7 +521,7 @@ function applyModuleFactoryName(factory) { ...@@ -521,7 +521,7 @@ function applyModuleFactoryName(factory) {
* It will be appended to the runtime code of each runtime right after the * It will be appended to the runtime code of each runtime right after the
* shared runtime utils. * shared runtime utils.
*/ /* eslint-disable @typescript-eslint/no-unused-vars */ /// <reference path="../base/globals.d.ts" /> */ /* eslint-disable @typescript-eslint/no-unused-vars */ /// <reference path="../base/globals.d.ts" />
/// <reference path="../../../shared/runtime-utils.ts" /> /// <reference path="../../../shared/runtime/runtime-utils.ts" />
// Used in WebWorkers to tell the runtime about the chunk suffix // Used in WebWorkers to tell the runtime about the chunk suffix
const browserContextPrototype = Context.prototype; const browserContextPrototype = Context.prototype;
var SourceType = /*#__PURE__*/ function(SourceType) { var SourceType = /*#__PURE__*/ function(SourceType) {
...@@ -788,9 +788,8 @@ function loadWebAssemblyModule(chunkPath, edgeModule) { ...@@ -788,9 +788,8 @@ function loadWebAssemblyModule(chunkPath, edgeModule) {
return BACKEND.loadWebAssemblyModule(1, this.m.id, chunkPath, edgeModule); return BACKEND.loadWebAssemblyModule(1, this.m.id, chunkPath, edgeModule);
} }
contextPrototype.u = loadWebAssemblyModule; contextPrototype.u = loadWebAssemblyModule;
/// <reference path="./dev-globals.d.ts" /> /// <reference path="../../../shared/runtime/dev-globals.d.ts" />
/// <reference path="./dev-protocol.d.ts" /> /// <reference path="../../../shared/runtime/dev-protocol.d.ts" />
/// <reference path="./dev-extensions.ts" />
const devContextPrototype = Context.prototype; const devContextPrototype = Context.prototype;
/** /**
* This file contains runtime types and functions that are shared between all * This file contains runtime types and functions that are shared between all
...@@ -1648,7 +1647,7 @@ globalThis.TURBOPACK_CHUNK_UPDATE_LISTENERS ??= []; ...@@ -1648,7 +1647,7 @@ globalThis.TURBOPACK_CHUNK_UPDATE_LISTENERS ??= [];
* *
* It will be appended to the base runtime code. * It will be appended to the base runtime code.
*/ /* eslint-disable @typescript-eslint/no-unused-vars */ /// <reference path="../../../browser/runtime/base/runtime-base.ts" /> */ /* eslint-disable @typescript-eslint/no-unused-vars */ /// <reference path="../../../browser/runtime/base/runtime-base.ts" />
/// <reference path="../../../shared/runtime-types.d.ts" /> /// <reference path="../../../shared/runtime/runtime-types.d.ts" />
function getAssetSuffixFromScriptSrc() { function getAssetSuffixFromScriptSrc() {
// TURBOPACK_ASSET_SUFFIX is set in web workers // TURBOPACK_ASSET_SUFFIX is set in web workers
return (self.TURBOPACK_ASSET_SUFFIX ?? document?.currentScript?.getAttribute?.('src')?.replace(/^(.*(?=\?)|^.*$)/, '')) || ''; return (self.TURBOPACK_ASSET_SUFFIX ?? document?.currentScript?.getAttribute?.('src')?.replace(/^(.*(?=\?)|^.*$)/, '')) || '';
...@@ -1911,5 +1910,5 @@ chunkListsToRegister.forEach(registerChunkList); ...@@ -1911,5 +1910,5 @@ chunkListsToRegister.forEach(registerChunkList);
})(); })();
//# debugId=bd85f361-1530-0170-a15f-b3e3bd9abe29 //# debugId=3b0e82e5-514a-a42c-bfe0-20484e208457
//# sourceMappingURL=aaf3a_crates_turbopack-tests_tests_snapshot_debug-ids_browser_input_index_0151fefb.js.map //# sourceMappingURL=aaf3a_crates_turbopack-tests_tests_snapshot_debug-ids_browser_input_index_0151fefb.js.map
\ No newline at end of file
...@@ -502,7 +502,7 @@ function applyModuleFactoryName(factory) { ...@@ -502,7 +502,7 @@ function applyModuleFactoryName(factory) {
value: 'module evaluation' value: 'module evaluation'
}); });
} }
/// <reference path="../shared/runtime-utils.ts" /> /// <reference path="../shared/runtime/runtime-utils.ts" />
/// A 'base' utilities to support runtime can have externals. /// A 'base' utilities to support runtime can have externals.
/// Currently this is for node.js / edge runtime both. /// Currently this is for node.js / edge runtime both.
/// If a fn requires node.js specific behavior, it should be placed in `node-external-utils` instead. /// If a fn requires node.js specific behavior, it should be placed in `node-external-utils` instead.
...@@ -564,7 +564,7 @@ const ABSOLUTE_ROOT = path.resolve(__filename, relativePathToDistRoot); ...@@ -564,7 +564,7 @@ const ABSOLUTE_ROOT = path.resolve(__filename, relativePathToDistRoot);
return ABSOLUTE_ROOT; return ABSOLUTE_ROOT;
} }
Context.prototype.P = resolveAbsolutePath; Context.prototype.P = resolveAbsolutePath;
/* eslint-disable @typescript-eslint/no-unused-vars */ /// <reference path="../shared/runtime-utils.ts" /> /* eslint-disable @typescript-eslint/no-unused-vars */ /// <reference path="../shared/runtime/runtime-utils.ts" />
function readWebAssemblyAsResponse(path) { function readWebAssemblyAsResponse(path) {
const { createReadStream } = require('fs'); const { createReadStream } = require('fs');
const { Readable } = require('stream'); const { Readable } = require('stream');
......
...@@ -502,7 +502,7 @@ function applyModuleFactoryName(factory) { ...@@ -502,7 +502,7 @@ function applyModuleFactoryName(factory) {
value: 'module evaluation' value: 'module evaluation'
}); });
} }
/// <reference path="../shared/runtime-utils.ts" /> /// <reference path="../shared/runtime/runtime-utils.ts" />
/// A 'base' utilities to support runtime can have externals. /// A 'base' utilities to support runtime can have externals.
/// Currently this is for node.js / edge runtime both. /// Currently this is for node.js / edge runtime both.
/// If a fn requires node.js specific behavior, it should be placed in `node-external-utils` instead. /// If a fn requires node.js specific behavior, it should be placed in `node-external-utils` instead.
...@@ -564,7 +564,7 @@ const ABSOLUTE_ROOT = path.resolve(__filename, relativePathToDistRoot); ...@@ -564,7 +564,7 @@ const ABSOLUTE_ROOT = path.resolve(__filename, relativePathToDistRoot);
return ABSOLUTE_ROOT; return ABSOLUTE_ROOT;
} }
Context.prototype.P = resolveAbsolutePath; Context.prototype.P = resolveAbsolutePath;
/* eslint-disable @typescript-eslint/no-unused-vars */ /// <reference path="../shared/runtime-utils.ts" /> /* eslint-disable @typescript-eslint/no-unused-vars */ /// <reference path="../shared/runtime/runtime-utils.ts" />
function readWebAssemblyAsResponse(path) { function readWebAssemblyAsResponse(path) {
const { createReadStream } = require('fs'); const { createReadStream } = require('fs');
const { Readable } = require('stream'); const { Readable } = require('stream');
......
...@@ -520,7 +520,7 @@ function applyModuleFactoryName(factory) { ...@@ -520,7 +520,7 @@ function applyModuleFactoryName(factory) {
* It will be appended to the runtime code of each runtime right after the * It will be appended to the runtime code of each runtime right after the
* shared runtime utils. * shared runtime utils.
*/ /* eslint-disable @typescript-eslint/no-unused-vars */ /// <reference path="../base/globals.d.ts" /> */ /* eslint-disable @typescript-eslint/no-unused-vars */ /// <reference path="../base/globals.d.ts" />
/// <reference path="../../../shared/runtime-utils.ts" /> /// <reference path="../../../shared/runtime/runtime-utils.ts" />
// Used in WebWorkers to tell the runtime about the chunk suffix // Used in WebWorkers to tell the runtime about the chunk suffix
const browserContextPrototype = Context.prototype; const browserContextPrototype = Context.prototype;
var SourceType = /*#__PURE__*/ function(SourceType) { var SourceType = /*#__PURE__*/ function(SourceType) {
...@@ -787,9 +787,8 @@ function loadWebAssemblyModule(chunkPath, edgeModule) { ...@@ -787,9 +787,8 @@ function loadWebAssemblyModule(chunkPath, edgeModule) {
return BACKEND.loadWebAssemblyModule(1, this.m.id, chunkPath, edgeModule); return BACKEND.loadWebAssemblyModule(1, this.m.id, chunkPath, edgeModule);
} }
contextPrototype.u = loadWebAssemblyModule; contextPrototype.u = loadWebAssemblyModule;
/// <reference path="./dev-globals.d.ts" /> /// <reference path="../../../shared/runtime/dev-globals.d.ts" />
/// <reference path="./dev-protocol.d.ts" /> /// <reference path="../../../shared/runtime/dev-protocol.d.ts" />
/// <reference path="./dev-extensions.ts" />
const devContextPrototype = Context.prototype; const devContextPrototype = Context.prototype;
/** /**
* This file contains runtime types and functions that are shared between all * This file contains runtime types and functions that are shared between all
...@@ -1647,7 +1646,7 @@ globalThis.TURBOPACK_CHUNK_UPDATE_LISTENERS ??= []; ...@@ -1647,7 +1646,7 @@ globalThis.TURBOPACK_CHUNK_UPDATE_LISTENERS ??= [];
* *
* It will be appended to the base runtime code. * It will be appended to the base runtime code.
*/ /* eslint-disable @typescript-eslint/no-unused-vars */ /// <reference path="../../../browser/runtime/base/runtime-base.ts" /> */ /* eslint-disable @typescript-eslint/no-unused-vars */ /// <reference path="../../../browser/runtime/base/runtime-base.ts" />
/// <reference path="../../../shared/runtime-types.d.ts" /> /// <reference path="../../../shared/runtime/runtime-types.d.ts" />
function getAssetSuffixFromScriptSrc() { function getAssetSuffixFromScriptSrc() {
// TURBOPACK_ASSET_SUFFIX is set in web workers // TURBOPACK_ASSET_SUFFIX is set in web workers
return (self.TURBOPACK_ASSET_SUFFIX ?? document?.currentScript?.getAttribute?.('src')?.replace(/^(.*(?=\?)|^.*$)/, '')) || ''; return (self.TURBOPACK_ASSET_SUFFIX ?? document?.currentScript?.getAttribute?.('src')?.replace(/^(.*(?=\?)|^.*$)/, '')) || '';
......
...@@ -768,7 +768,7 @@ function applyModuleFactoryName(factory) { ...@@ -768,7 +768,7 @@ function applyModuleFactoryName(factory) {
* It will be appended to the runtime code of each runtime right after the * It will be appended to the runtime code of each runtime right after the
* shared runtime utils. * shared runtime utils.
*/ /* eslint-disable @typescript-eslint/no-unused-vars */ /// <reference path="../base/globals.d.ts" /> */ /* eslint-disable @typescript-eslint/no-unused-vars */ /// <reference path="../base/globals.d.ts" />
/// <reference path="../../../shared/runtime-utils.ts" /> /// <reference path="../../../shared/runtime/runtime-utils.ts" />
// Used in WebWorkers to tell the runtime about the chunk suffix // Used in WebWorkers to tell the runtime about the chunk suffix
function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) { function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) {
try { try {
...@@ -1510,7 +1510,7 @@ function _ts_generator(thisArg, body) { ...@@ -1510,7 +1510,7 @@ function _ts_generator(thisArg, body) {
* *
* It will be appended to the base runtime code. * It will be appended to the base runtime code.
*/ /* eslint-disable @typescript-eslint/no-unused-vars */ /// <reference path="../../../browser/runtime/base/runtime-base.ts" /> */ /* eslint-disable @typescript-eslint/no-unused-vars */ /// <reference path="../../../browser/runtime/base/runtime-base.ts" />
/// <reference path="../../../shared/runtime-types.d.ts" /> /// <reference path="../../../shared/runtime/runtime-types.d.ts" />
function getAssetSuffixFromScriptSrc() { function getAssetSuffixFromScriptSrc() {
var _self_TURBOPACK_ASSET_SUFFIX; var _self_TURBOPACK_ASSET_SUFFIX;
var _document_currentScript_getAttribute, _document_currentScript_getAttribute1, _document_currentScript, _document; var _document_currentScript_getAttribute, _document_currentScript_getAttribute1, _document_currentScript, _document;
......
...@@ -520,7 +520,7 @@ function applyModuleFactoryName(factory) { ...@@ -520,7 +520,7 @@ function applyModuleFactoryName(factory) {
* It will be appended to the runtime code of each runtime right after the * It will be appended to the runtime code of each runtime right after the
* shared runtime utils. * shared runtime utils.
*/ /* eslint-disable @typescript-eslint/no-unused-vars */ /// <reference path="../base/globals.d.ts" /> */ /* eslint-disable @typescript-eslint/no-unused-vars */ /// <reference path="../base/globals.d.ts" />
/// <reference path="../../../shared/runtime-utils.ts" /> /// <reference path="../../../shared/runtime/runtime-utils.ts" />
// Used in WebWorkers to tell the runtime about the chunk suffix // Used in WebWorkers to tell the runtime about the chunk suffix
const browserContextPrototype = Context.prototype; const browserContextPrototype = Context.prototype;
var SourceType = /*#__PURE__*/ function(SourceType) { var SourceType = /*#__PURE__*/ function(SourceType) {
...@@ -787,9 +787,8 @@ function loadWebAssemblyModule(chunkPath, edgeModule) { ...@@ -787,9 +787,8 @@ function loadWebAssemblyModule(chunkPath, edgeModule) {
return BACKEND.loadWebAssemblyModule(1, this.m.id, chunkPath, edgeModule); return BACKEND.loadWebAssemblyModule(1, this.m.id, chunkPath, edgeModule);
} }
contextPrototype.u = loadWebAssemblyModule; contextPrototype.u = loadWebAssemblyModule;
/// <reference path="./dev-globals.d.ts" /> /// <reference path="../../../shared/runtime/dev-globals.d.ts" />
/// <reference path="./dev-protocol.d.ts" /> /// <reference path="../../../shared/runtime/dev-protocol.d.ts" />
/// <reference path="./dev-extensions.ts" />
const devContextPrototype = Context.prototype; const devContextPrototype = Context.prototype;
/** /**
* This file contains runtime types and functions that are shared between all * This file contains runtime types and functions that are shared between all
...@@ -1647,7 +1646,7 @@ globalThis.TURBOPACK_CHUNK_UPDATE_LISTENERS ??= []; ...@@ -1647,7 +1646,7 @@ globalThis.TURBOPACK_CHUNK_UPDATE_LISTENERS ??= [];
* *
* It will be appended to the base runtime code. * It will be appended to the base runtime code.
*/ /* eslint-disable @typescript-eslint/no-unused-vars */ /// <reference path="../../../browser/runtime/base/runtime-base.ts" /> */ /* eslint-disable @typescript-eslint/no-unused-vars */ /// <reference path="../../../browser/runtime/base/runtime-base.ts" />
/// <reference path="../../../shared/runtime-types.d.ts" /> /// <reference path="../../../shared/runtime/runtime-types.d.ts" />
function getAssetSuffixFromScriptSrc() { function getAssetSuffixFromScriptSrc() {
// TURBOPACK_ASSET_SUFFIX is set in web workers // TURBOPACK_ASSET_SUFFIX is set in web workers
return (self.TURBOPACK_ASSET_SUFFIX ?? document?.currentScript?.getAttribute?.('src')?.replace(/^(.*(?=\?)|^.*$)/, '')) || ''; return (self.TURBOPACK_ASSET_SUFFIX ?? document?.currentScript?.getAttribute?.('src')?.replace(/^(.*(?=\?)|^.*$)/, '')) || '';
......
...@@ -520,7 +520,7 @@ function applyModuleFactoryName(factory) { ...@@ -520,7 +520,7 @@ function applyModuleFactoryName(factory) {
* It will be appended to the runtime code of each runtime right after the * It will be appended to the runtime code of each runtime right after the
* shared runtime utils. * shared runtime utils.
*/ /* eslint-disable @typescript-eslint/no-unused-vars */ /// <reference path="../base/globals.d.ts" /> */ /* eslint-disable @typescript-eslint/no-unused-vars */ /// <reference path="../base/globals.d.ts" />
/// <reference path="../../../shared/runtime-utils.ts" /> /// <reference path="../../../shared/runtime/runtime-utils.ts" />
// Used in WebWorkers to tell the runtime about the chunk suffix // Used in WebWorkers to tell the runtime about the chunk suffix
const browserContextPrototype = Context.prototype; const browserContextPrototype = Context.prototype;
var SourceType = /*#__PURE__*/ function(SourceType) { var SourceType = /*#__PURE__*/ function(SourceType) {
...@@ -787,9 +787,8 @@ function loadWebAssemblyModule(chunkPath, edgeModule) { ...@@ -787,9 +787,8 @@ function loadWebAssemblyModule(chunkPath, edgeModule) {
return BACKEND.loadWebAssemblyModule(1, this.m.id, chunkPath, edgeModule); return BACKEND.loadWebAssemblyModule(1, this.m.id, chunkPath, edgeModule);
} }
contextPrototype.u = loadWebAssemblyModule; contextPrototype.u = loadWebAssemblyModule;
/// <reference path="./dev-globals.d.ts" /> /// <reference path="../../../shared/runtime/dev-globals.d.ts" />
/// <reference path="./dev-protocol.d.ts" /> /// <reference path="../../../shared/runtime/dev-protocol.d.ts" />
/// <reference path="./dev-extensions.ts" />
const devContextPrototype = Context.prototype; const devContextPrototype = Context.prototype;
/** /**
* This file contains runtime types and functions that are shared between all * This file contains runtime types and functions that are shared between all
...@@ -1647,7 +1646,7 @@ globalThis.TURBOPACK_CHUNK_UPDATE_LISTENERS ??= []; ...@@ -1647,7 +1646,7 @@ globalThis.TURBOPACK_CHUNK_UPDATE_LISTENERS ??= [];
* *
* It will be appended to the base runtime code. * It will be appended to the base runtime code.
*/ /* eslint-disable @typescript-eslint/no-unused-vars */ /// <reference path="../../../browser/runtime/base/runtime-base.ts" /> */ /* eslint-disable @typescript-eslint/no-unused-vars */ /// <reference path="../../../browser/runtime/base/runtime-base.ts" />
/// <reference path="../../../shared/runtime-types.d.ts" /> /// <reference path="../../../shared/runtime/runtime-types.d.ts" />
function getAssetSuffixFromScriptSrc() { function getAssetSuffixFromScriptSrc() {
// TURBOPACK_ASSET_SUFFIX is set in web workers // TURBOPACK_ASSET_SUFFIX is set in web workers
return (self.TURBOPACK_ASSET_SUFFIX ?? document?.currentScript?.getAttribute?.('src')?.replace(/^(.*(?=\?)|^.*$)/, '')) || ''; return (self.TURBOPACK_ASSET_SUFFIX ?? document?.currentScript?.getAttribute?.('src')?.replace(/^(.*(?=\?)|^.*$)/, '')) || '';
......
...@@ -520,7 +520,7 @@ function applyModuleFactoryName(factory) { ...@@ -520,7 +520,7 @@ function applyModuleFactoryName(factory) {
* It will be appended to the runtime code of each runtime right after the * It will be appended to the runtime code of each runtime right after the
* shared runtime utils. * shared runtime utils.
*/ /* eslint-disable @typescript-eslint/no-unused-vars */ /// <reference path="../base/globals.d.ts" /> */ /* eslint-disable @typescript-eslint/no-unused-vars */ /// <reference path="../base/globals.d.ts" />
/// <reference path="../../../shared/runtime-utils.ts" /> /// <reference path="../../../shared/runtime/runtime-utils.ts" />
// Used in WebWorkers to tell the runtime about the chunk suffix // Used in WebWorkers to tell the runtime about the chunk suffix
const browserContextPrototype = Context.prototype; const browserContextPrototype = Context.prototype;
var SourceType = /*#__PURE__*/ function(SourceType) { var SourceType = /*#__PURE__*/ function(SourceType) {
...@@ -787,9 +787,8 @@ function loadWebAssemblyModule(chunkPath, edgeModule) { ...@@ -787,9 +787,8 @@ function loadWebAssemblyModule(chunkPath, edgeModule) {
return BACKEND.loadWebAssemblyModule(1, this.m.id, chunkPath, edgeModule); return BACKEND.loadWebAssemblyModule(1, this.m.id, chunkPath, edgeModule);
} }
contextPrototype.u = loadWebAssemblyModule; contextPrototype.u = loadWebAssemblyModule;
/// <reference path="./dev-globals.d.ts" /> /// <reference path="../../../shared/runtime/dev-globals.d.ts" />
/// <reference path="./dev-protocol.d.ts" /> /// <reference path="../../../shared/runtime/dev-protocol.d.ts" />
/// <reference path="./dev-extensions.ts" />
const devContextPrototype = Context.prototype; const devContextPrototype = Context.prototype;
/** /**
* This file contains runtime types and functions that are shared between all * This file contains runtime types and functions that are shared between all
...@@ -1647,7 +1646,7 @@ globalThis.TURBOPACK_CHUNK_UPDATE_LISTENERS ??= []; ...@@ -1647,7 +1646,7 @@ globalThis.TURBOPACK_CHUNK_UPDATE_LISTENERS ??= [];
* *
* It will be appended to the base runtime code. * It will be appended to the base runtime code.
*/ /* eslint-disable @typescript-eslint/no-unused-vars */ /// <reference path="../../../browser/runtime/base/runtime-base.ts" /> */ /* eslint-disable @typescript-eslint/no-unused-vars */ /// <reference path="../../../browser/runtime/base/runtime-base.ts" />
/// <reference path="../../../shared/runtime-types.d.ts" /> /// <reference path="../../../shared/runtime/runtime-types.d.ts" />
function getAssetSuffixFromScriptSrc() { function getAssetSuffixFromScriptSrc() {
// TURBOPACK_ASSET_SUFFIX is set in web workers // TURBOPACK_ASSET_SUFFIX is set in web workers
return (self.TURBOPACK_ASSET_SUFFIX ?? document?.currentScript?.getAttribute?.('src')?.replace(/^(.*(?=\?)|^.*$)/, '')) || ''; return (self.TURBOPACK_ASSET_SUFFIX ?? document?.currentScript?.getAttribute?.('src')?.replace(/^(.*(?=\?)|^.*$)/, '')) || '';
......
...@@ -520,7 +520,7 @@ function applyModuleFactoryName(factory) { ...@@ -520,7 +520,7 @@ function applyModuleFactoryName(factory) {
* It will be appended to the runtime code of each runtime right after the * It will be appended to the runtime code of each runtime right after the
* shared runtime utils. * shared runtime utils.
*/ /* eslint-disable @typescript-eslint/no-unused-vars */ /// <reference path="../base/globals.d.ts" /> */ /* eslint-disable @typescript-eslint/no-unused-vars */ /// <reference path="../base/globals.d.ts" />
/// <reference path="../../../shared/runtime-utils.ts" /> /// <reference path="../../../shared/runtime/runtime-utils.ts" />
// Used in WebWorkers to tell the runtime about the chunk suffix // Used in WebWorkers to tell the runtime about the chunk suffix
const browserContextPrototype = Context.prototype; const browserContextPrototype = Context.prototype;
var SourceType = /*#__PURE__*/ function(SourceType) { var SourceType = /*#__PURE__*/ function(SourceType) {
...@@ -787,9 +787,8 @@ function loadWebAssemblyModule(chunkPath, edgeModule) { ...@@ -787,9 +787,8 @@ function loadWebAssemblyModule(chunkPath, edgeModule) {
return BACKEND.loadWebAssemblyModule(1, this.m.id, chunkPath, edgeModule); return BACKEND.loadWebAssemblyModule(1, this.m.id, chunkPath, edgeModule);
} }
contextPrototype.u = loadWebAssemblyModule; contextPrototype.u = loadWebAssemblyModule;
/// <reference path="./dev-globals.d.ts" /> /// <reference path="../../../shared/runtime/dev-globals.d.ts" />
/// <reference path="./dev-protocol.d.ts" /> /// <reference path="../../../shared/runtime/dev-protocol.d.ts" />
/// <reference path="./dev-extensions.ts" />
const devContextPrototype = Context.prototype; const devContextPrototype = Context.prototype;
/** /**
* This file contains runtime types and functions that are shared between all * This file contains runtime types and functions that are shared between all
...@@ -1647,7 +1646,7 @@ globalThis.TURBOPACK_CHUNK_UPDATE_LISTENERS ??= []; ...@@ -1647,7 +1646,7 @@ globalThis.TURBOPACK_CHUNK_UPDATE_LISTENERS ??= [];
* *
* It will be appended to the base runtime code. * It will be appended to the base runtime code.
*/ /* eslint-disable @typescript-eslint/no-unused-vars */ /// <reference path="../../../browser/runtime/base/runtime-base.ts" /> */ /* eslint-disable @typescript-eslint/no-unused-vars */ /// <reference path="../../../browser/runtime/base/runtime-base.ts" />
/// <reference path="../../../shared/runtime-types.d.ts" /> /// <reference path="../../../shared/runtime/runtime-types.d.ts" />
function getAssetSuffixFromScriptSrc() { function getAssetSuffixFromScriptSrc() {
// TURBOPACK_ASSET_SUFFIX is set in web workers // TURBOPACK_ASSET_SUFFIX is set in web workers
return (self.TURBOPACK_ASSET_SUFFIX ?? document?.currentScript?.getAttribute?.('src')?.replace(/^(.*(?=\?)|^.*$)/, '')) || ''; return (self.TURBOPACK_ASSET_SUFFIX ?? document?.currentScript?.getAttribute?.('src')?.replace(/^(.*(?=\?)|^.*$)/, '')) || '';
......
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