Unverified Commit 4385ed36 authored by Will Binns-Smith's avatar Will Binns-Smith Committed by GitHub

Turbopack: Reorganize runtime files into shared/runtime directory (#89461)

This change moves runtime code that does not use a module system and is concatenated by Rust into a dedicated `runtime/` directory so it's not confused with other code. 

It also codifies this in a README and instructs agents to read nearby READMEs so they enforce this convention.

**This change only moves code and does not refactor any further.** Snapshot updates reflect the new file paths in the generated runtime code.

**Test Plan:** CI, existing tests
parent aac4ebb7
......@@ -39,6 +39,17 @@ The main Next.js framework lives in `packages/next/`. This is what gets publishe
- `packages/font/` - `next/font` implementation
- `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
```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="./dev-protocol.d.ts" />
/// <reference path="./dev-extensions.ts" />
/// <reference path="../../../shared/runtime/dev-globals.d.ts" />
/// <reference path="../../../shared/runtime/dev-protocol.d.ts" />
interface TurbopackDevContext extends TurbopackBrowserBaseContext<HotModule> {
k: RefreshContext
......
......@@ -7,7 +7,7 @@
/* 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" />
declare var BACKEND: RuntimeBackend
......@@ -9,7 +9,7 @@
/* 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
declare var TURBOPACK_ASSET_SUFFIX: string
......
......@@ -7,7 +7,7 @@
/* 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() {
// TURBOPACK_ASSET_SUFFIX is set in web workers
......
......@@ -7,7 +7,7 @@
/* 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
;(() => {
......
/* eslint-disable @typescript-eslint/no-unused-vars */
/// <reference path="./hmr-types.d.ts" />
/// <reference path="../shared/runtime-utils.ts" />
/// <reference path="../shared-node/base-externals-utils.ts" />
/// <reference path="../shared-node/node-externals-utils.ts" />
/// <reference path="../shared-node/node-wasm-utils.ts" />
/// <reference path="../hmr-types.d.ts" />
/// <reference path="../../shared/runtime/runtime-utils.ts" />
/// <reference path="../../shared-node/base-externals-utils.ts" />
/// <reference path="../../shared-node/node-externals-utils.ts" />
/// <reference path="../../shared-node/node-wasm-utils.ts" />
enum SourceType {
/**
......
/// <reference path="../shared/runtime-utils.ts" />
/// <reference path="../shared/runtime/runtime-utils.ts" />
/// A 'base' utilities to support runtime can have externals.
/// Currently this is for node.js / edge runtime both.
......
/* eslint-disable @typescript-eslint/no-unused-vars */
/// <reference path="../shared/runtime-utils.ts" />
/// <reference path="../shared/runtime/runtime-utils.ts" />
function readWebAssemblyAsResponse(path: string) {
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
......
{
"extends": "../tsconfig.json",
"compilerOptions": {
"composite": true,
"outDir": "./dist"
},
"include": ["./**/*"],
"references": []
}
......@@ -4,5 +4,5 @@
// environment, we need WebWorker for WebAssembly types
"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(
let shared_runtime_utils_code = embed_static_code(
asset_context,
rcstr!("shared/runtime-utils.ts"),
rcstr!("shared/runtime/runtime-utils.ts"),
generate_source_map,
);
......
......@@ -18,7 +18,7 @@ pub async fn get_nodejs_runtime_code(
let shared_runtime_utils_code = embed_static_code(
asset_context,
rcstr!("shared/runtime-utils.ts"),
rcstr!("shared/runtime/runtime-utils.ts"),
generate_source_map,
);
let shared_base_external_utils_code = embed_static_code(
......@@ -38,7 +38,7 @@ pub async fn get_nodejs_runtime_code(
);
let runtime_code = embed_static_code(
asset_context,
rcstr!("nodejs/runtime.ts"),
rcstr!("nodejs/runtime/runtime-base.ts"),
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]="5770f9e6-b0e5-5a25-603c-089a0fc1f085")}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]="fb146561-85a5-d065-1fad-6e704781120f")}catch(e){}}();
(globalThis["TURBOPACK"] || (globalThis["TURBOPACK"] = [])).push([
"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)"]}
......@@ -521,7 +521,7 @@ function applyModuleFactoryName(factory) {
* It will be appended to the runtime code of each runtime right after the
* shared runtime utils.
*/ /* 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
const browserContextPrototype = Context.prototype;
var SourceType = /*#__PURE__*/ function(SourceType) {
......@@ -797,9 +797,8 @@ function loadWebAssemblyModule(chunkPath, edgeModule) {
return BACKEND.loadWebAssemblyModule(1, this.m.id, chunkPath, edgeModule);
}
contextPrototype.u = loadWebAssemblyModule;
/// <reference path="./dev-globals.d.ts" />
/// <reference path="./dev-protocol.d.ts" />
/// <reference path="./dev-extensions.ts" />
/// <reference path="../../../shared/runtime/dev-globals.d.ts" />
/// <reference path="../../../shared/runtime/dev-protocol.d.ts" />
const devContextPrototype = Context.prototype;
/**
* This file contains runtime types and functions that are shared between all
......@@ -1657,7 +1656,7 @@ globalThis.TURBOPACK_CHUNK_UPDATE_LISTENERS ??= [];
*
* It will be appended to the base runtime code.
*/ /* 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() {
// TURBOPACK_ASSET_SUFFIX is set in web workers
return (self.TURBOPACK_ASSET_SUFFIX ?? document?.currentScript?.getAttribute?.('src')?.replace(/^(.*(?=\?)|^.*$)/, '')) || '';
......@@ -1920,5 +1919,5 @@ chunkListsToRegister.forEach(registerChunkList);
})();
//# debugId=5770f9e6-b0e5-5a25-603c-089a0fc1f085
//# debugId=fb146561-85a5-d065-1fad-6e704781120f
//# sourceMappingURL=aaf3a_crates_turbopack-tests_tests_snapshot_debug-ids_browser_input_index_0151fefb.js.map
\ No newline at end of file
......@@ -503,7 +503,7 @@ function applyModuleFactoryName(factory) {
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.
/// 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.
......@@ -565,7 +565,7 @@ const ABSOLUTE_ROOT = path.resolve(__filename, relativePathToDistRoot);
return ABSOLUTE_ROOT;
}
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) {
const { createReadStream } = require('fs');
const { Readable } = require('stream');
......@@ -586,11 +586,11 @@ async function instantiateWebAssemblyFromPath(path, importsObj) {
const { instance } = await WebAssembly.instantiateStreaming(response, importsObj);
return instance.exports;
}
/* eslint-disable @typescript-eslint/no-unused-vars */ /// <reference path="./hmr-types.d.ts" />
/// <reference path="../shared/runtime-utils.ts" />
/// <reference path="../shared-node/base-externals-utils.ts" />
/// <reference path="../shared-node/node-externals-utils.ts" />
/// <reference path="../shared-node/node-wasm-utils.ts" />
/* eslint-disable @typescript-eslint/no-unused-vars */ /// <reference path="../hmr-types.d.ts" />
/// <reference path="../../shared/runtime/runtime-utils.ts" />
/// <reference path="../../shared-node/base-externals-utils.ts" />
/// <reference path="../../shared-node/node-externals-utils.ts" />
/// <reference path="../../shared-node/node-wasm-utils.ts" />
var SourceType = /*#__PURE__*/ function(SourceType) {
/**
* The module was instantiated because it was included in an evaluated chunk's
......
......@@ -503,7 +503,7 @@ function applyModuleFactoryName(factory) {
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.
/// 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.
......@@ -565,7 +565,7 @@ const ABSOLUTE_ROOT = path.resolve(__filename, relativePathToDistRoot);
return ABSOLUTE_ROOT;
}
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) {
const { createReadStream } = require('fs');
const { Readable } = require('stream');
......@@ -586,11 +586,11 @@ async function instantiateWebAssemblyFromPath(path, importsObj) {
const { instance } = await WebAssembly.instantiateStreaming(response, importsObj);
return instance.exports;
}
/* eslint-disable @typescript-eslint/no-unused-vars */ /// <reference path="./hmr-types.d.ts" />
/// <reference path="../shared/runtime-utils.ts" />
/// <reference path="../shared-node/base-externals-utils.ts" />
/// <reference path="../shared-node/node-externals-utils.ts" />
/// <reference path="../shared-node/node-wasm-utils.ts" />
/* eslint-disable @typescript-eslint/no-unused-vars */ /// <reference path="../hmr-types.d.ts" />
/// <reference path="../../shared/runtime/runtime-utils.ts" />
/// <reference path="../../shared-node/base-externals-utils.ts" />
/// <reference path="../../shared-node/node-externals-utils.ts" />
/// <reference path="../../shared-node/node-wasm-utils.ts" />
var SourceType = /*#__PURE__*/ function(SourceType) {
/**
* The module was instantiated because it was included in an evaluated chunk's
......
......@@ -520,7 +520,7 @@ function applyModuleFactoryName(factory) {
* It will be appended to the runtime code of each runtime right after the
* shared runtime utils.
*/ /* 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
const browserContextPrototype = Context.prototype;
var SourceType = /*#__PURE__*/ function(SourceType) {
......@@ -796,9 +796,8 @@ function loadWebAssemblyModule(chunkPath, edgeModule) {
return BACKEND.loadWebAssemblyModule(1, this.m.id, chunkPath, edgeModule);
}
contextPrototype.u = loadWebAssemblyModule;
/// <reference path="./dev-globals.d.ts" />
/// <reference path="./dev-protocol.d.ts" />
/// <reference path="./dev-extensions.ts" />
/// <reference path="../../../shared/runtime/dev-globals.d.ts" />
/// <reference path="../../../shared/runtime/dev-protocol.d.ts" />
const devContextPrototype = Context.prototype;
/**
* This file contains runtime types and functions that are shared between all
......@@ -1656,7 +1655,7 @@ globalThis.TURBOPACK_CHUNK_UPDATE_LISTENERS ??= [];
*
* It will be appended to the base runtime code.
*/ /* 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() {
// TURBOPACK_ASSET_SUFFIX is set in web workers
return (self.TURBOPACK_ASSET_SUFFIX ?? document?.currentScript?.getAttribute?.('src')?.replace(/^(.*(?=\?)|^.*$)/, '')) || '';
......
......@@ -768,7 +768,7 @@ function applyModuleFactoryName(factory) {
* It will be appended to the runtime code of each runtime right after the
* shared runtime utils.
*/ /* 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
function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) {
try {
......@@ -1570,7 +1570,7 @@ function _ts_generator(thisArg, body) {
*
* It will be appended to the base runtime code.
*/ /* 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() {
var _self_TURBOPACK_ASSET_SUFFIX;
var _document_currentScript_getAttribute, _document_currentScript_getAttribute1, _document_currentScript, _document;
......
......@@ -520,7 +520,7 @@ function applyModuleFactoryName(factory) {
* It will be appended to the runtime code of each runtime right after the
* shared runtime utils.
*/ /* 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
const browserContextPrototype = Context.prototype;
var SourceType = /*#__PURE__*/ function(SourceType) {
......@@ -796,9 +796,8 @@ function loadWebAssemblyModule(chunkPath, edgeModule) {
return BACKEND.loadWebAssemblyModule(1, this.m.id, chunkPath, edgeModule);
}
contextPrototype.u = loadWebAssemblyModule;
/// <reference path="./dev-globals.d.ts" />
/// <reference path="./dev-protocol.d.ts" />
/// <reference path="./dev-extensions.ts" />
/// <reference path="../../../shared/runtime/dev-globals.d.ts" />
/// <reference path="../../../shared/runtime/dev-protocol.d.ts" />
const devContextPrototype = Context.prototype;
/**
* This file contains runtime types and functions that are shared between all
......@@ -1656,7 +1655,7 @@ globalThis.TURBOPACK_CHUNK_UPDATE_LISTENERS ??= [];
*
* It will be appended to the base runtime code.
*/ /* 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() {
// TURBOPACK_ASSET_SUFFIX is set in web workers
return (self.TURBOPACK_ASSET_SUFFIX ?? document?.currentScript?.getAttribute?.('src')?.replace(/^(.*(?=\?)|^.*$)/, '')) || '';
......
......@@ -520,7 +520,7 @@ function applyModuleFactoryName(factory) {
* It will be appended to the runtime code of each runtime right after the
* shared runtime utils.
*/ /* 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
const browserContextPrototype = Context.prototype;
var SourceType = /*#__PURE__*/ function(SourceType) {
......@@ -796,9 +796,8 @@ function loadWebAssemblyModule(chunkPath, edgeModule) {
return BACKEND.loadWebAssemblyModule(1, this.m.id, chunkPath, edgeModule);
}
contextPrototype.u = loadWebAssemblyModule;
/// <reference path="./dev-globals.d.ts" />
/// <reference path="./dev-protocol.d.ts" />
/// <reference path="./dev-extensions.ts" />
/// <reference path="../../../shared/runtime/dev-globals.d.ts" />
/// <reference path="../../../shared/runtime/dev-protocol.d.ts" />
const devContextPrototype = Context.prototype;
/**
* This file contains runtime types and functions that are shared between all
......@@ -1656,7 +1655,7 @@ globalThis.TURBOPACK_CHUNK_UPDATE_LISTENERS ??= [];
*
* It will be appended to the base runtime code.
*/ /* 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() {
// TURBOPACK_ASSET_SUFFIX is set in web workers
return (self.TURBOPACK_ASSET_SUFFIX ?? document?.currentScript?.getAttribute?.('src')?.replace(/^(.*(?=\?)|^.*$)/, '')) || '';
......
......@@ -520,7 +520,7 @@ function applyModuleFactoryName(factory) {
* It will be appended to the runtime code of each runtime right after the
* shared runtime utils.
*/ /* 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
const browserContextPrototype = Context.prototype;
var SourceType = /*#__PURE__*/ function(SourceType) {
......@@ -796,9 +796,8 @@ function loadWebAssemblyModule(chunkPath, edgeModule) {
return BACKEND.loadWebAssemblyModule(1, this.m.id, chunkPath, edgeModule);
}
contextPrototype.u = loadWebAssemblyModule;
/// <reference path="./dev-globals.d.ts" />
/// <reference path="./dev-protocol.d.ts" />
/// <reference path="./dev-extensions.ts" />
/// <reference path="../../../shared/runtime/dev-globals.d.ts" />
/// <reference path="../../../shared/runtime/dev-protocol.d.ts" />
const devContextPrototype = Context.prototype;
/**
* This file contains runtime types and functions that are shared between all
......@@ -1656,7 +1655,7 @@ globalThis.TURBOPACK_CHUNK_UPDATE_LISTENERS ??= [];
*
* It will be appended to the base runtime code.
*/ /* 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() {
// TURBOPACK_ASSET_SUFFIX is set in web workers
return (self.TURBOPACK_ASSET_SUFFIX ?? document?.currentScript?.getAttribute?.('src')?.replace(/^(.*(?=\?)|^.*$)/, '')) || '';
......
......@@ -520,7 +520,7 @@ function applyModuleFactoryName(factory) {
* It will be appended to the runtime code of each runtime right after the
* shared runtime utils.
*/ /* 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
const browserContextPrototype = Context.prototype;
var SourceType = /*#__PURE__*/ function(SourceType) {
......@@ -796,9 +796,8 @@ function loadWebAssemblyModule(chunkPath, edgeModule) {
return BACKEND.loadWebAssemblyModule(1, this.m.id, chunkPath, edgeModule);
}
contextPrototype.u = loadWebAssemblyModule;
/// <reference path="./dev-globals.d.ts" />
/// <reference path="./dev-protocol.d.ts" />
/// <reference path="./dev-extensions.ts" />
/// <reference path="../../../shared/runtime/dev-globals.d.ts" />
/// <reference path="../../../shared/runtime/dev-protocol.d.ts" />
const devContextPrototype = Context.prototype;
/**
* This file contains runtime types and functions that are shared between all
......@@ -1656,7 +1655,7 @@ globalThis.TURBOPACK_CHUNK_UPDATE_LISTENERS ??= [];
*
* It will be appended to the base runtime code.
*/ /* 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() {
// TURBOPACK_ASSET_SUFFIX is set in web workers
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