Unverified Commit d69ce482 authored by Niklas Mischkulnig's avatar Niklas Mischkulnig Committed by GitHub

Turbopack: support targeting even older browsers (#91563)

https://github.com/yowainwright/es-check/issues/403

- [x] Emit the arrow function conditionally if the target is new enough
parent 495d50f1
......@@ -2,7 +2,7 @@ import { nextTestSetup } from 'e2e-utils'
import { execSync } from 'child_process'
const dependencies = {
'es-check': '9.6.1',
'es-check': '9.6.4',
browserslist: '4.28.1',
}
......@@ -74,4 +74,27 @@ describe('escheck-output', () => {
expect(esCheckOutput).toContain('info: ✓ ES-Check passed!')
})
})
// Webpack doesn't properly downlevel
;(process.env.IS_TURBOPACK_TEST ? describe : describe.skip)('ancient', () => {
let browserslist = ['ios >= 9']
const { next } = nextTestSetup({
files: __dirname,
dependencies,
packageJson: {
browserslist,
},
})
it('should downlevel JS', () => {
let esCheckOutput = execSync(
`node_modules/.bin/es-check checkBrowser ".next/static/**/*.js" --browserslistQuery="${browserslist.join(', ')}" --noCache`,
{ cwd: next.testDir, encoding: 'utf8' }
)
console.log(esCheckOutput)
expect(esCheckOutput).toContain('info: ✓ ES-Check passed!')
})
})
})
......@@ -353,9 +353,83 @@ impl EdgeWorkerEnvironment {
}
// TODO preset_env_base::Version implements Serialize/Deserialize incorrectly
#[derive(Debug)]
#[turbo_tasks::value(transparent, serialization = "none")]
pub struct RuntimeVersions(#[turbo_tasks(trace_ignore)] pub Versions);
#[turbo_tasks::value_impl]
impl RuntimeVersions {
/// Whether the environment supports arrow functions.
#[turbo_tasks::function]
pub fn supports_arrow_functions(&self) -> Vc<bool> {
// https://github.com/babel/babel/blob/b0e3517dc566880e76b5f1f4dcf7fcecba58337d/packages/babel-compat-data/data/plugins.json#L363-L376
// "chrome": "47",
// "opera": "34",
// "edge": "13",
// "firefox": "43",
// "safari": "10",
// "node": "6",
// "deno": "1",
// "ios": "10",
// "samsung": "5",
// "rhino": "1.7.13",
// "opera_mobile": "34",
// "electron": "0.36"
let data = &self.0;
let supported = data.chrome.is_none_or(|v| v.major >= 47)
&& data.opera.is_none_or(|v| v.major >= 34)
&& data.edge.is_none_or(|v| v.major >= 13)
&& data.firefox.is_none_or(|v| v.major >= 43)
&& data.safari.is_none_or(|v| v.major >= 10)
&& data.node.is_none_or(|v| v.major >= 6)
&& data.deno.is_none_or(|v| v.major >= 1)
&& data.ios.is_none_or(|v| v.major >= 10)
&& data.samsung.is_none_or(|v| v.major >= 5)
&& data.rhino.is_none_or(|v| {
v.major > 1
|| (v.major == 1 && v.minor > 7)
|| (v.major == 1 && v.minor == 7 && v.patch >= 13)
})
&& data.opera_mobile.is_none_or(|v| v.major >= 34)
&& data.electron.is_none_or(|v| v.major > 0 || v.minor >= 36);
Vc::cell(supported)
}
/// Whether the environment supports block scoping (let/const).
#[turbo_tasks::function]
pub fn supports_block_scoping(&self) -> Vc<bool> {
// https://github.com/babel/babel/blob/b0e3517dc566880e76b5f1f4dcf7fcecba58337d/packages/babel-compat-data/data/plugins.json#L538
// "chrome": "50",
// "opera": "37",
// "edge": "14",
// "firefox": "53",
// "safari": "11",
// "node": "6",
// "deno": "1",
// "ios": "11",
// "samsung": "5",
// "opera_mobile": "37",
// "electron": "1.1"
let data = &self.0;
let supported = data.chrome.is_none_or(|v| v.major >= 50)
&& data.opera.is_none_or(|v| v.major >= 37)
&& data.edge.is_none_or(|v| v.major >= 14)
&& data.firefox.is_none_or(|v| v.major >= 53)
&& data.safari.is_none_or(|v| v.major >= 11)
&& data.node.is_none_or(|v| v.major >= 6)
&& data.deno.is_none_or(|v| v.major >= 1)
&& data.ios.is_none_or(|v| v.major >= 11)
&& data.samsung.is_none_or(|v| v.major >= 5)
&& data.opera_mobile.is_none_or(|v| v.major >= 37)
&& data
.electron
.is_none_or(|v| v.major > 1 || (v.major == 1 && v.minor >= 1));
Vc::cell(supported)
}
}
#[turbo_tasks::function]
pub async fn get_current_nodejs_version(env: Vc<Box<dyn ProcessEnv>>) -> Result<Vc<RcStr>> {
let path_read = env.read(rcstr!("PATH")).await?;
......
......@@ -23,8 +23,8 @@ use turbopack_core::{
};
use turbopack_ecmascript::{
chunk::{
EcmascriptChunkItemContent, EcmascriptChunkPlaceable, EcmascriptExports,
ecmascript_chunk_item,
EcmascriptChunkItemContent, EcmascriptChunkItemOptions, EcmascriptChunkPlaceable,
EcmascriptExports, ecmascript_chunk_item,
},
parse::generate_js_source_map,
runtime_functions::{TURBOPACK_EXPORT_VALUE, TURBOPACK_IMPORT},
......@@ -367,6 +367,14 @@ impl EcmascriptChunkPlaceable for EcmascriptCssModule {
} else {
None
},
options: EcmascriptChunkItemOptions {
supports_arrow_functions: *chunking_context
.environment()
.runtime_versions()
.supports_arrow_functions()
.await?,
..Default::default()
},
..Default::default()
}
.cell())
......
......@@ -90,17 +90,26 @@ pub async fn get_browser_runtime_code(
let chunk_loading_global = chunk_loading_global.await?;
let chunk_lists_global = format!("{}_CHUNK_LISTS", &*chunk_loading_global);
if *environment
.runtime_versions()
.supports_arrow_functions()
.await?
{
code += "(() => {\n";
} else {
code += "(function(){\n";
}
writedoc!(
code,
r#"
(() => {{
if (!Array.isArray(globalThis[{}])) {{
return;
}}
const CHUNK_BASE_PATH = {};
const RELATIVE_ROOT_PATH = {};
const RUNTIME_PUBLIC_PATH = {};
var CHUNK_BASE_PATH = {};
var RELATIVE_ROOT_PATH = {};
var RUNTIME_PUBLIC_PATH = {};
"#,
StringifyJs(&chunk_loading_global),
StringifyJs(chunk_base_path),
......@@ -113,7 +122,7 @@ pub async fn get_browser_runtime_code(
writedoc!(
code,
r#"
const ASSET_SUFFIX = "";
var ASSET_SUFFIX = "";
"#
)?;
}
......@@ -121,7 +130,7 @@ pub async fn get_browser_runtime_code(
writedoc!(
code,
r#"
const ASSET_SUFFIX = {};
var ASSET_SUFFIX = {};
"#,
StringifyJs(suffix.as_str())
)?;
......@@ -133,7 +142,7 @@ pub async fn get_browser_runtime_code(
writedoc!(
code,
r#"
const ASSET_SUFFIX = getAssetSuffixFromScriptSrc();
var ASSET_SUFFIX = getAssetSuffixFromScriptSrc();
"#
)?;
}
......@@ -141,7 +150,7 @@ pub async fn get_browser_runtime_code(
writedoc!(
code,
r#"
const ASSET_SUFFIX = globalThis[{}] || "";
var ASSET_SUFFIX = globalThis[{}] || "";
"#,
StringifyJs(global_name)
)?;
......@@ -153,7 +162,7 @@ pub async fn get_browser_runtime_code(
writedoc!(
code,
r#"
const WORKER_FORWARDED_GLOBALS = {};
var WORKER_FORWARDED_GLOBALS = {};
"#,
StringifyJs(&*worker_forwarded_globals)
)?;
......@@ -207,7 +216,7 @@ pub async fn get_browser_runtime_code(
writedoc!(
code,
r#"
const chunksToRegister = globalThis[{chunk_loading_global}];
var chunksToRegister = globalThis[{chunk_loading_global}];
globalThis[{chunk_loading_global}] = {{ push: registerChunk }};
chunksToRegister.forEach(registerChunk);
"#,
......@@ -217,7 +226,7 @@ pub async fn get_browser_runtime_code(
writedoc!(
code,
r#"
const chunkListsToRegister = globalThis[{chunk_lists_global}] || [];
var chunkListsToRegister = globalThis[{chunk_lists_global}] || [];
globalThis[{chunk_lists_global}] = {{ push: registerChunkList }};
chunkListsToRegister.forEach(registerChunkList);
"#,
......
......@@ -19,8 +19,8 @@ use turbopack_core::{
use crate::{
chunk::{
EcmascriptChunkItemContent, EcmascriptChunkPlaceable, EcmascriptExports,
data::EcmascriptChunkData, ecmascript_chunk_item,
EcmascriptChunkItemContent, EcmascriptChunkItemOptions, EcmascriptChunkPlaceable,
EcmascriptExports, data::EcmascriptChunkData, ecmascript_chunk_item,
},
runtime_functions::{TURBOPACK_EXPORT_VALUE, TURBOPACK_LOAD},
utils::{StringifyJs, StringifyModuleId},
......@@ -161,6 +161,15 @@ impl EcmascriptChunkPlaceable for AsyncLoaderModule {
_async_module_info: Option<Vc<AsyncModuleInfo>>,
estimated: bool,
) -> Result<Vc<EcmascriptChunkItemContent>> {
let options = EcmascriptChunkItemOptions {
supports_arrow_functions: *chunking_context
.environment()
.runtime_versions()
.supports_arrow_functions()
.await?,
..Default::default()
};
if estimated {
let code = formatdoc! {
r#"
......@@ -171,6 +180,7 @@ impl EcmascriptChunkPlaceable for AsyncLoaderModule {
};
return Ok(EcmascriptChunkItemContent {
inner_code: code.into(),
options,
..Default::default()
}
.cell());
......@@ -243,6 +253,7 @@ impl EcmascriptChunkPlaceable for AsyncLoaderModule {
Ok(EcmascriptChunkItemContent {
inner_code: code.into(),
options,
..Default::default()
}
.cell())
......
......@@ -72,6 +72,11 @@ impl EcmascriptChunkItemContent {
chunking_context: Vc<Box<dyn ChunkingContext>>,
async_module_options: Vc<OptionAsyncModuleOptions>,
) -> Result<Vc<Self>> {
let supports_arrow_functions = *chunking_context
.environment()
.runtime_versions()
.supports_arrow_functions()
.await?;
let externals = *chunking_context
.environment()
.supports_commonjs_externals()
......@@ -103,6 +108,7 @@ impl EcmascriptChunkItemContent {
strict: true,
externals,
async_module,
supports_arrow_functions,
..Default::default()
}
} else {
......@@ -113,6 +119,7 @@ impl EcmascriptChunkItemContent {
EcmascriptChunkItemOptions {
strict,
externals,
supports_arrow_functions,
// These things are not available in ESM
module_and_exports: true,
..Default::default()
......@@ -130,11 +137,23 @@ impl EcmascriptChunkItemContent {
for additional_id in self.additional_ids.iter() {
writeln!(code, "{}, ", StringifyJs(&additional_id))?;
}
if self.options.supports_arrow_functions {
code += "((";
} else {
code += "(function(";
}
if self.options.module_and_exports {
code += "((__turbopack_context__, module, exports) => {\n";
code += "__turbopack_context__, module, exports";
} else {
code += "__turbopack_context__";
}
if self.options.supports_arrow_functions {
code += ") => {\n";
} else {
code += "((__turbopack_context__) => {\n";
code += "){\n";
}
if self.options.strict {
code += "\"use strict\";\n\n";
} else {
......@@ -142,11 +161,19 @@ impl EcmascriptChunkItemContent {
}
if self.options.async_module.is_some() {
writeln!(
code,
"return {TURBOPACK_ASYNC_MODULE}(async (__turbopack_handle_async_dependencies__, \
__turbopack_async_result__) => {{ try {{\n"
)?;
write!(code, "return {TURBOPACK_ASYNC_MODULE}")?;
if self.options.supports_arrow_functions {
code += "(async (";
} else {
code += "(async function(";
}
code += "__turbopack_handle_async_dependencies__, __turbopack_async_result__";
if self.options.supports_arrow_functions {
code += ") => {";
} else {
code += "){";
}
code += " try {\n";
}
let source_map = match &self.rewrite_source_path {
......@@ -194,6 +221,8 @@ pub struct EcmascriptChunkItemOptions {
/// Whether this chunk item's module is async (either has a top level await
/// or is importing async modules).
pub async_module: Option<AsyncModuleOptions>,
/// Whether the environment supports arrow functions (e.g. when targeting modern browsers).
pub supports_arrow_functions: bool,
pub placeholder_for_future_extensions: (),
}
......
......@@ -1891,7 +1891,7 @@ async fn process_parse_result(
.await?;
let body = vec![
quote!(
"const e = new Error($msg);" as Stmt,
"var e = new Error($msg);" as Stmt,
msg: Expr = Expr::Lit(msg.into()),
),
quote!("e.code = 'MODULE_UNPARSABLE';" as Stmt),
......@@ -1919,7 +1919,7 @@ async fn process_parse_result(
.await?;
let body = vec![
quote!(
"const e = new Error($msg);" as Stmt,
"var e = new Error($msg);" as Stmt,
msg: Expr = Expr::Lit(msg.into()),
),
quote!("e.code = 'MODULE_UNPARSABLE';" as Stmt),
......
......@@ -72,14 +72,14 @@ impl ImportMetaBinding {
// turbopackHot exposes the HMR API (equivalent to module.hot in CJS).
let turbopack_module: Expr = TURBOPACK_MODULE.into();
quote!(
"const $name = { get url() { return $path }, get turbopackHot() { return $m.hot } };" as Stmt,
"var $name = { get url() { return $path }, get turbopackHot() { return $m.hot } };" as Stmt,
name = meta_ident(),
path: Expr = path,
m: Expr = turbopack_module,
)
} else {
quote!(
"const $name = { get url() { return $path } };" as Stmt,
"var $name = { get url() { return $path } };" as Stmt,
name = meta_ident(),
path: Expr = path,
)
......
......@@ -6,7 +6,7 @@ use swc_core::{
common::DUMMY_SP,
ecma::ast::{
ClassDecl, Decl, DefaultDecl, ExportDecl, ExportDefaultDecl, ExportDefaultExpr, FnDecl,
Ident, ModuleDecl, ModuleItem, Stmt,
Ident, ModuleDecl, ModuleItem, Stmt, VarDecl, VarDeclarator,
},
quote,
};
......@@ -27,11 +27,15 @@ use crate::{
)]
pub struct EsmModuleItem {
pub path: AstPath,
pub supports_block_scoping: bool,
}
impl EsmModuleItem {
pub fn new(path: AstPath) -> Self {
EsmModuleItem { path }
pub fn new(path: AstPath, supports_block_scoping: bool) -> Self {
EsmModuleItem {
path,
supports_block_scoping,
}
}
pub async fn code_generation(
......@@ -39,38 +43,78 @@ impl EsmModuleItem {
_chunking_context: Vc<Box<dyn ChunkingContext>>,
) -> Result<CodeGeneration> {
let mut visitors = Vec::new();
let supports_block_scoping = self.supports_block_scoping;
visitors.push(
create_visitor!(self.path, visit_mut_module_item, |module_item: &mut ModuleItem| {
visitors.push(create_visitor!(
self.path,
visit_mut_module_item,
|module_item: &mut ModuleItem| {
let item = replace(module_item, ModuleItem::Stmt(quote!(";" as Stmt)));
if let ModuleItem::ModuleDecl(module_decl) = item {
match module_decl {
ModuleDecl::ExportDefaultExpr(ExportDefaultExpr { box expr, .. }) => {
let stmt = quote!("const $name = $expr;" as Stmt,
name = Ident::new(magic_identifier::mangle("default export").into(), DUMMY_SP, Default::default()),
expr: Expr = expr
);
*module_item = ModuleItem::Stmt(stmt);
let decl = Decl::Var(Box::new(VarDecl {
span: DUMMY_SP,
ctxt: Default::default(),
kind: if supports_block_scoping {
swc_core::ecma::ast::VarDeclKind::Const
} else {
// This is not entirely correct: this hides TDZ errors with
// circular imports, but there is no way to model this runtime
// behavior well for older browsers.
swc_core::ecma::ast::VarDeclKind::Var
},
declare: false,
decls: vec![VarDeclarator {
span: DUMMY_SP,
name: Ident::new(
magic_identifier::mangle("default export").into(),
DUMMY_SP,
Default::default(),
)
.into(),
init: Some(Box::new(expr)),
definite: false,
}],
}));
*module_item = ModuleItem::Stmt(Stmt::Decl(decl));
}
ModuleDecl::ExportDefaultDecl(ExportDefaultDecl { decl, span }) => {
match decl {
DefaultDecl::Class(class) => {
*module_item = ModuleItem::Stmt(Stmt::Decl(Decl::Class(ClassDecl {
ident: class.ident.unwrap_or_else(|| Ident::new(magic_identifier::mangle("default export").into(), DUMMY_SP, Default::default())),
declare: false,
class: class.class
})))
*module_item =
ModuleItem::Stmt(Stmt::Decl(Decl::Class(ClassDecl {
ident: class.ident.unwrap_or_else(|| {
Ident::new(
magic_identifier::mangle("default export")
.into(),
DUMMY_SP,
Default::default(),
)
}),
declare: false,
class: class.class,
})))
}
DefaultDecl::Fn(fn_expr) => {
*module_item = ModuleItem::Stmt(Stmt::Decl(Decl::Fn(FnDecl {
ident: fn_expr.ident.unwrap_or_else(|| Ident::new(magic_identifier::mangle("default export").into(), DUMMY_SP, Default::default())),
ident: fn_expr.ident.unwrap_or_else(|| {
Ident::new(
magic_identifier::mangle("default export").into(),
DUMMY_SP,
Default::default(),
)
}),
declare: false,
function: fn_expr.function
function: fn_expr.function,
})))
}
DefaultDecl::TsInterfaceDecl(_) => {
// not matching, might happen due to eventual consistency
*module_item = ModuleItem::ModuleDecl(ModuleDecl::ExportDefaultDecl(ExportDefaultDecl { decl, span }));
*module_item =
ModuleItem::ModuleDecl(ModuleDecl::ExportDefaultDecl(
ExportDefaultDecl { decl, span },
));
}
}
}
......@@ -95,8 +139,8 @@ impl EsmModuleItem {
// not matching, might happen due to eventual consistency
*module_item = item;
}
}),
);
}
));
Ok(CodeGeneration::visitors(visitors))
}
......
......@@ -72,7 +72,7 @@ impl ExportsInfoBinding {
Ok(CodeGeneration::hoisted_stmt(
rcstr!("__webpack_exports_info__"),
quote!(
"const $name = $data;" as Stmt,
"var $name = $data;" as Stmt,
name = exports_ident(),
data: Expr = data
),
......
......@@ -151,7 +151,7 @@ impl CachedExternalModule {
CachedExternalType::EcmaScriptViaImport => {
writeln!(
code,
"const mod = await {TURBOPACK_EXTERNAL_IMPORT}({});",
"var mod = await {TURBOPACK_EXTERNAL_IMPORT}({});",
StringifyJs(&self.request())
)?;
}
......@@ -159,18 +159,18 @@ impl CachedExternalModule {
let request = self.request();
writeln!(
code,
"const mod = {TURBOPACK_EXTERNAL_REQUIRE}({}, () => require({}));",
"var mod = {TURBOPACK_EXTERNAL_REQUIRE}({}, () => require({}));",
StringifyJs(&request),
StringifyJs(&request)
)?;
}
CachedExternalType::Global => {
if self.request.is_empty() {
writeln!(code, "const mod = {{}};")?;
writeln!(code, "var mod = {{}};")?;
} else {
writeln!(
code,
"const mod = globalThis[{}];",
"var mod = globalThis[{}];",
StringifyJs(&self.request)
)?;
}
......@@ -183,7 +183,7 @@ impl CachedExternalModule {
let url = &self.request[at_index + 1..];
// Wrap the loading and variable access in a try-catch block
writeln!(code, "let mod;")?;
writeln!(code, "var mod;")?;
writeln!(code, "try {{")?;
// First load the URL
......@@ -226,7 +226,7 @@ impl CachedExternalModule {
got: {}');",
StringifyJs(&self.request)
)?;
writeln!(code, "const mod = undefined;")?;
writeln!(code, "var mod = undefined;")?;
}
}
}
......
......@@ -868,6 +868,12 @@ async fn analyze_ecmascript_module_internal(
let span = tracing::trace_span!("exports");
let (webpack_runtime, webpack_entry, webpack_chunks) = async {
let supports_block_scoping = *compile_time_info
.environment()
.runtime_versions()
.supports_block_scoping()
.await?;
let (webpack_runtime, webpack_entry, webpack_chunks, mut esm_exports) =
set_handler_and_globals(&handler, globals, || {
// TODO migrate to effects
......@@ -877,6 +883,7 @@ async fn analyze_ecmascript_module_internal(
&mut analysis,
analyze_mode,
&var_graph,
supports_block_scoping,
);
// ModuleReferencesVisitor has already called analysis.add_esm_reexport_reference
// for any references in esm_exports
......@@ -3929,6 +3936,7 @@ struct ModuleReferencesVisitor<'a> {
webpack_entry: bool,
webpack_chunks: Vec<Lit>,
var_graph: &'a VarGraph,
supports_block_scoping: bool,
}
impl<'a> ModuleReferencesVisitor<'a> {
......@@ -3938,6 +3946,7 @@ impl<'a> ModuleReferencesVisitor<'a> {
analysis: &'a mut AnalyzeEcmascriptModuleResultBuilder,
analyze_mode: AnalyzeMode,
var_graph: &'a VarGraph,
supports_block_scoping: bool,
) -> Self {
Self {
analyze_mode,
......@@ -3950,6 +3959,7 @@ impl<'a> ModuleReferencesVisitor<'a> {
webpack_entry: false,
webpack_chunks: Vec::new(),
var_graph,
supports_block_scoping,
}
}
}
......@@ -4025,8 +4035,10 @@ impl VisitAstPath for ModuleReferencesVisitor<'_> {
ast_path: &mut AstNodePath<AstParentNodeRef<'r>>,
) {
if self.analyze_mode.is_code_gen() {
self.analysis
.add_code_gen(EsmModuleItem::new(as_parent_path(ast_path).into()));
self.analysis.add_code_gen(EsmModuleItem::new(
as_parent_path(ast_path).into(),
self.supports_block_scoping,
));
}
export.visit_children_with_ast_path(self, ast_path);
}
......@@ -4109,8 +4121,10 @@ impl VisitAstPath for ModuleReferencesVisitor<'_> {
}
if self.analyze_mode.is_code_gen() {
self.analysis
.add_code_gen(EsmModuleItem::new(as_parent_path(ast_path).into()));
self.analysis.add_code_gen(EsmModuleItem::new(
as_parent_path(ast_path).into(),
self.supports_block_scoping,
));
}
export.visit_children_with_ast_path(self, ast_path);
}
......@@ -4153,8 +4167,10 @@ impl VisitAstPath for ModuleReferencesVisitor<'_> {
}
};
if self.analyze_mode.is_code_gen() {
self.analysis
.add_code_gen(EsmModuleItem::new(as_parent_path(ast_path).into()));
self.analysis.add_code_gen(EsmModuleItem::new(
as_parent_path(ast_path).into(),
self.supports_block_scoping,
));
}
export.visit_children_with_ast_path(self, ast_path);
}
......@@ -4173,8 +4189,10 @@ impl VisitAstPath for ModuleReferencesVisitor<'_> {
),
);
if self.analyze_mode.is_code_gen() {
self.analysis
.add_code_gen(EsmModuleItem::new(as_parent_path(ast_path).into()));
self.analysis.add_code_gen(EsmModuleItem::new(
as_parent_path(ast_path).into(),
self.supports_block_scoping,
));
}
export.visit_children_with_ast_path(self, ast_path);
}
......@@ -4204,8 +4222,10 @@ impl VisitAstPath for ModuleReferencesVisitor<'_> {
}
}
if self.analyze_mode.is_code_gen() {
self.analysis
.add_code_gen(EsmModuleItem::new(as_parent_path(ast_path).into()));
self.analysis.add_code_gen(EsmModuleItem::new(
as_parent_path(ast_path).into(),
self.supports_block_scoping,
));
}
export.visit_children_with_ast_path(self, ast_path);
}
......@@ -4254,7 +4274,8 @@ impl VisitAstPath for ModuleReferencesVisitor<'_> {
}
}
if self.analyze_mode.is_code_gen() {
self.analysis.add_code_gen(EsmModuleItem::new(path));
self.analysis
.add_code_gen(EsmModuleItem::new(path, self.supports_block_scoping));
}
}
......
......@@ -195,6 +195,11 @@ impl EcmascriptChunkPlaceable for SideEffectsModule {
} else {
None
},
supports_arrow_functions: *chunking_context
.environment()
.runtime_versions()
.supports_arrow_functions()
.await?,
..Default::default()
},
additional_ids: Default::default(),
......
......@@ -20,8 +20,8 @@ use turbopack_core::{
use super::worker_type::WorkerType;
use crate::{
chunk::{
EcmascriptChunkItemContent, EcmascriptChunkPlaceable, EcmascriptExports,
data::EcmascriptChunkData, ecmascript_chunk_item,
EcmascriptChunkItemContent, EcmascriptChunkItemOptions, EcmascriptChunkPlaceable,
EcmascriptExports, data::EcmascriptChunkData, ecmascript_chunk_item,
},
runtime_functions::{TURBOPACK_CREATE_WORKER, TURBOPACK_EXPORT_VALUE},
utils::StringifyJs,
......@@ -201,6 +201,14 @@ impl EcmascriptChunkPlaceable for WorkerLoaderModule {
estimated: bool,
) -> Result<Vc<EcmascriptChunkItemContent>> {
let this = self.await?;
let options = EcmascriptChunkItemOptions {
supports_arrow_functions: *chunking_context
.environment()
.runtime_versions()
.supports_arrow_functions()
.await?,
..Default::default()
};
if estimated {
// In estimation mode we cannot call into chunking context APIs
......@@ -217,6 +225,7 @@ impl EcmascriptChunkPlaceable for WorkerLoaderModule {
worker_path = StringifyJs(&"a_fake_path_for_size_estimation"),
}
.into(),
options,
..Default::default()
}
.cell());
......@@ -290,6 +299,7 @@ impl EcmascriptChunkPlaceable for WorkerLoaderModule {
Ok(EcmascriptChunkItemContent {
inner_code: code.into(),
options,
..Default::default()
}
.cell())
......
......@@ -54,7 +54,7 @@ impl Asset for ProcessEnvAsset {
// values. We need to inject literal values (to emulate webpack's
// DefinePlugin), so create a new regular object out of the old env.
let mut code = RopeBuilder::default();
code += "const env = process.env = {...process.env};\n\n";
code += "var env = process.env = {...process.env};\n\n";
for (name, val) in &*env {
// It's assumed the env has passed through an EmbeddableProcessEnv, so the value
......
......@@ -64,10 +64,10 @@ impl EcmascriptBuildNodeRuntimeChunk {
writedoc!(
code,
r#"
const RUNTIME_PUBLIC_PATH = {};
const RELATIVE_ROOT_PATH = {};
const ASSET_PREFIX = {};
const WORKER_FORWARDED_GLOBALS = {};
var RUNTIME_PUBLIC_PATH = {};
var RELATIVE_ROOT_PATH = {};
var ASSET_PREFIX = {};
var WORKER_FORWARDED_GLOBALS = {};
"#,
StringifyJs(runtime_public_path),
StringifyJs(output_root_to_root_path.as_str()),
......@@ -83,7 +83,7 @@ impl EcmascriptBuildNodeRuntimeChunk {
// Apply forwarded globals from workerData if running in a worker thread
if (typeof require !== 'undefined') {{
try {{
const {{ workerData }} = require('worker_threads');
var {{ workerData }} = require('worker_threads');
if (workerData?.__turbopack_globals__) {{
Object.assign(globalThis, workerData.__turbopack_globals__);
// Remove internal data so it's not visible to user code
......
......@@ -11,8 +11,8 @@ use turbopack_core::{
};
use turbopack_ecmascript::{
chunk::{
EcmascriptChunkItemContent, EcmascriptChunkPlaceable, EcmascriptExports,
ecmascript_chunk_item,
EcmascriptChunkItemContent, EcmascriptChunkItemOptions, EcmascriptChunkPlaceable,
EcmascriptExports, ecmascript_chunk_item,
},
runtime_functions::{TURBOPACK_EXPORT_URL, TURBOPACK_EXPORT_VALUE},
utils::StringifyJs,
......@@ -135,6 +135,14 @@ impl EcmascriptChunkPlaceable for StaticUrlJsModule {
Ok(EcmascriptChunkItemContent {
inner_code: inner_code.into(),
options: EcmascriptChunkItemOptions {
supports_arrow_functions: *chunking_context
.environment()
.runtime_versions()
.supports_arrow_functions()
.await?,
..Default::default()
},
..Default::default()
}
.cell())
......
import { a, b, c, default as d } from './root'
import { a, b, c, default as d, e, e_var } from './root'
expect(a()).toBe('a')
if (process.env.NODE_ENV === 'production') {
......@@ -7,6 +7,8 @@ if (process.env.NODE_ENV === 'production') {
expect(Object(c).b()).toBe('b')
}
expect(() => d).toThrow()
expect(() => e).toThrow()
expect(e_var).toBeUndefined()
export function test() {
expect(d).toBe(d)
......
......@@ -5,6 +5,8 @@ import * as cc from './module'
export { cc }
export * from './module'
export default 'd'
export const e = 'e'
export var e_var = 'e'
export function a() {
return 'a'
}
......
const RUNTIME_PUBLIC_PATH = "output/[turbopack]_runtime.js";
const RELATIVE_ROOT_PATH = "../../../../../../..";
const ASSET_PREFIX = "/";
const WORKER_FORWARDED_GLOBALS = [];
var RUNTIME_PUBLIC_PATH = "output/[turbopack]_runtime.js";
var RELATIVE_ROOT_PATH = "../../../../../../..";
var ASSET_PREFIX = "/";
var WORKER_FORWARDED_GLOBALS = [];
// Dummy runtime
\ No newline at end of file
const RUNTIME_PUBLIC_PATH = "output/[turbopack]_runtime.js";
const RELATIVE_ROOT_PATH = "../../../../../../..";
const ASSET_PREFIX = "/";
const WORKER_FORWARDED_GLOBALS = [];
var RUNTIME_PUBLIC_PATH = "output/[turbopack]_runtime.js";
var RELATIVE_ROOT_PATH = "../../../../../../..";
var ASSET_PREFIX = "/";
var WORKER_FORWARDED_GLOBALS = [];
// Dummy runtime
\ No newline at end of file
......@@ -3,7 +3,6 @@
"use strict";
return __turbopack_context__.a(async (__turbopack_handle_async_dependencies__, __turbopack_async_result__) => { try {
__turbopack_context__.s([
"close",
()=>close,
......@@ -31,7 +30,6 @@ __turbopack_async_result__();
"use strict";
return __turbopack_context__.a(async (__turbopack_handle_async_dependencies__, __turbopack_async_result__) => { try {
__turbopack_context__.s([
"createUser",
()=>createUser
......
......@@ -2,6 +2,6 @@
"version": 3,
"sources": [],
"sections": [
{"offset": {"line": 6, "column": 0}, "map": {"version":3,"sources":["turbopack:///[project]/turbopack/crates/turbopack-tests/tests/snapshot/basic/top-level-await/input/db-connection.js"],"sourcesContent":["const connectToDB = async (url) => {\n console.log('connecting to db', url)\n await new Promise((r) => setTimeout(r, 1000))\n}\n\n// This is a top-level-await\nawait connectToDB('my-sql://example.com')\n\nexport const dbCall = async (data) => {\n console.log('dbCall', data)\n // This is a normal await, because it's in an async function\n await new Promise((r) => setTimeout(r, 100))\n return 'fake data'\n}\n\nexport const close = () => {\n console.log('closes the DB connection')\n}\n"],"names":["connectToDB","url","console","log","Promise","r","setTimeout","dbCall","data","close"],"mappings":";;;;;;AAAA,MAAMA,cAAc,OAAOC;IACzBC,QAAQC,GAAG,CAAC,oBAAoBF;IAChC,MAAM,IAAIG,QAAQ,CAACC,IAAMC,WAAWD,GAAG;AACzC;AAEA,4BAA4B;AAC5B,MAAML,YAAY;AAEX,MAAMO,SAAS,OAAOC;IAC3BN,QAAQC,GAAG,CAAC,UAAUK;IACtB,4DAA4D;IAC5D,MAAM,IAAIJ,QAAQ,CAACC,IAAMC,WAAWD,GAAG;IACvC,OAAO;AACT;AAEO,MAAMI,QAAQ;IACnBP,QAAQC,GAAG,CAAC;AACd"}},
{"offset": {"line": 34, "column": 0}, "map": {"version":3,"sources":["turbopack:///[project]/turbopack/crates/turbopack-tests/tests/snapshot/basic/top-level-await/input/UserAPI.js"],"sourcesContent":["import { dbCall } from './db-connection.js'\n\nexport const createUser = async (name) => {\n const command = `CREATE USER ${name}`\n // This is a normal await, because it's in an async function\n await dbCall({ command })\n}\n"],"names":["createUser","name","command"],"mappings":";;;;AAAA;;;;;;AAEO,MAAMA,aAAa,OAAOC;IAC/B,MAAMC,UAAU,CAAC,YAAY,EAAED,MAAM;IACrC,4DAA4D;IAC5D,MAAM,IAAA,iOAAM,EAAC;QAAEC;IAAQ;AACzB"}}]
{"offset": {"line": 5, "column": 0}, "map": {"version":3,"sources":["turbopack:///[project]/turbopack/crates/turbopack-tests/tests/snapshot/basic/top-level-await/input/db-connection.js"],"sourcesContent":["const connectToDB = async (url) => {\n console.log('connecting to db', url)\n await new Promise((r) => setTimeout(r, 1000))\n}\n\n// This is a top-level-await\nawait connectToDB('my-sql://example.com')\n\nexport const dbCall = async (data) => {\n console.log('dbCall', data)\n // This is a normal await, because it's in an async function\n await new Promise((r) => setTimeout(r, 100))\n return 'fake data'\n}\n\nexport const close = () => {\n console.log('closes the DB connection')\n}\n"],"names":["connectToDB","url","console","log","Promise","r","setTimeout","dbCall","data","close"],"mappings":";;;;;;AAAA,MAAMA,cAAc,OAAOC;IACzBC,QAAQC,GAAG,CAAC,oBAAoBF;IAChC,MAAM,IAAIG,QAAQ,CAACC,IAAMC,WAAWD,GAAG;AACzC;AAEA,4BAA4B;AAC5B,MAAML,YAAY;AAEX,MAAMO,SAAS,OAAOC;IAC3BN,QAAQC,GAAG,CAAC,UAAUK;IACtB,4DAA4D;IAC5D,MAAM,IAAIJ,QAAQ,CAACC,IAAMC,WAAWD,GAAG;IACvC,OAAO;AACT;AAEO,MAAMI,QAAQ;IACnBP,QAAQC,GAAG,CAAC;AACd"}},
{"offset": {"line": 32, "column": 0}, "map": {"version":3,"sources":["turbopack:///[project]/turbopack/crates/turbopack-tests/tests/snapshot/basic/top-level-await/input/UserAPI.js"],"sourcesContent":["import { dbCall } from './db-connection.js'\n\nexport const createUser = async (name) => {\n const command = `CREATE USER ${name}`\n // This is a normal await, because it's in an async function\n await dbCall({ command })\n}\n"],"names":["createUser","name","command"],"mappings":";;;;AAAA;;;;;;AAEO,MAAMA,aAAa,OAAOC;IAC/B,MAAMC,UAAU,CAAC,YAAY,EAAED,MAAM;IACrC,4DAA4D;IAC5D,MAAM,IAAA,iOAAM,EAAC;QAAEC;IAAQ;AACzB"}}]
}
\ No newline at end of file
(globalThis["TURBOPACK"] || (globalThis["TURBOPACK"] = [])).push(["output/1do3_crates_turbopack-tests_tests_snapshot_basic_ts-parse-error_input_04t2r94._.js",
"[project]/turbopack/crates/turbopack-tests/tests/snapshot/basic/ts-parse-error/input/other.ts [test] (ecmascript)", ((__turbopack_context__, module, exports) => {
const e = new Error("Could not parse module '[project]/turbopack/crates/turbopack-tests/tests/snapshot/basic/ts-parse-error/input/other.ts'\n\nCannot assign to this");
var e = new Error("Could not parse module '[project]/turbopack/crates/turbopack-tests/tests/snapshot/basic/ts-parse-error/input/other.ts'\n\nCannot assign to this");
e.code = 'MODULE_UNPARSABLE';
throw e;
}),
......
(globalThis["TURBOPACK"] || (globalThis["TURBOPACK"] = [])).push(["output/turbopack_crates_turbopack-tests_tests_snapshot_comptime_typeof_input_1y4b353._.js",
"[project]/turbopack/crates/turbopack-tests/tests/snapshot/comptime/typeof/input/cjs.js [test] (ecmascript)", ((__turbopack_context__, module, exports) => {
const __TURBOPACK__import$2e$meta__ = {
var __TURBOPACK__import$2e$meta__ = {
get url () {
return `file://${__turbopack_context__.P("turbopack/crates/turbopack-tests/tests/snapshot/comptime/typeof/input/cjs.js")}`;
}
......@@ -22,7 +22,7 @@ console.log(/*TURBOPACK member replacement*/ __turbopack_context__.t);
__turbopack_context__.s([]);
var __TURBOPACK__imported__module__$5b$project$5d2f$turbopack$2f$crates$2f$turbopack$2d$tests$2f$tests$2f$snapshot$2f$comptime$2f$typeof$2f$input$2f$dep$2e$js__$5b$test$5d$__$28$ecmascript$29$__ = __turbopack_context__.i("[project]/turbopack/crates/turbopack-tests/tests/snapshot/comptime/typeof/input/dep.js [test] (ecmascript)");
const __TURBOPACK__import$2e$meta__ = {
var __TURBOPACK__import$2e$meta__ = {
get url () {
return `file://${__turbopack_context__.P("turbopack/crates/turbopack-tests/tests/snapshot/comptime/typeof/input/esm-automatic.js")}`;
}
......@@ -40,7 +40,7 @@ console.log(/*TURBOPACK member replacement*/ __turbopack_context__.z);
"use strict";
__turbopack_context__.s([]);
const __TURBOPACK__import$2e$meta__ = {
var __TURBOPACK__import$2e$meta__ = {
get url () {
return `file://${__turbopack_context__.P("turbopack/crates/turbopack-tests/tests/snapshot/comptime/typeof/input/esm-specified.mjs")}`;
}
......
{
"version": 3,
"sources": [],
"debugId": "161bf1fe-ca33-d8de-b14a-ddace1bb63c7",
"debugId": "9cce6140-a664-1990-1f64-3699b6ffe1e3",
"sections": [
{"offset": {"line": 15, "column": 0}, "map": {"version":3,"sources":["turbopack:///[turbopack]/shared/runtime/runtime-utils.ts"],"sourcesContent":["/**\n * This file contains runtime types and functions that are shared between all\n * TurboPack ECMAScript runtimes.\n *\n * It will be prepended to the runtime code of each runtime.\n */\n\n/* eslint-disable @typescript-eslint/no-unused-vars */\n\n/// <reference path=\"./runtime-types.d.ts\" />\n\ntype EsmNamespaceObject = Record<string, any>\n\n/**\n * Describes why a module was instantiated.\n * Shared between browser and Node.js runtimes.\n */\nenum SourceType {\n /**\n * The module was instantiated because it was included in an evaluated chunk's\n * runtime.\n * SourceData is a ChunkPath.\n */\n Runtime = 0,\n /**\n * The module was instantiated because a parent module imported it.\n * SourceData is a ModuleId.\n */\n Parent = 1,\n /**\n * The module was instantiated because it was included in a chunk's hot module\n * update.\n * SourceData is an array of ModuleIds or undefined.\n */\n Update = 2,\n}\n\ntype SourceData = ChunkPath | ModuleId | ModuleId[] | undefined\n\n// @ts-ignore Defined in `dev-base.ts`\ndeclare function getOrInstantiateModuleFromParent<M>(\n id: ModuleId,\n sourceModule: M\n): M\n\n// @ts-ignore Defined in `hmr-runtime.ts` (dev mode only)\ndeclare let devModuleCache: Record<ModuleId, any> | undefined\n\n/**\n * Flag indicating which module object type to create when a module is merged. Set to `true`\n * by each runtime that uses ModuleWithDirection (browser dev-base.ts, nodejs dev-base.ts,\n * nodejs build-base.ts). Browser production (build-base.ts) leaves it as `false` since it\n * uses plain Module objects.\n */\nlet createModuleWithDirectionFlag = false\n\nconst REEXPORTED_OBJECTS = new WeakMap<Module, ReexportedObjects>()\n\n/**\n * Constructs the `__turbopack_context__` object for a module.\n */\nfunction Context(\n this: TurbopackBaseContext<Module>,\n module: Module,\n exports: Exports\n) {\n this.m = module\n // We need to store this here instead of accessing it from the module object to:\n // 1. Make it available to factories directly, since we rewrite `this` to\n // `__turbopack_context__.e` in CJS modules.\n // 2. Support async modules which rewrite `module.exports` to a promise, so we\n // can still access the original exports object from functions like\n // `esmExport`\n // Ideally we could find a new approach for async modules and drop this property altogether.\n this.e = exports\n}\nconst contextPrototype = Context.prototype as TurbopackBaseContext<Module>\n\ntype ModuleContextMap = Record<ModuleId, ModuleContextEntry>\n\ninterface ModuleContextEntry {\n id: () => ModuleId\n module: () => any\n}\n\ninterface ModuleContext {\n // require call\n (moduleId: string): Exports | EsmNamespaceObject\n\n // async import call\n import(moduleId: string): Promise<Exports | EsmNamespaceObject>\n\n keys(): ModuleId[]\n\n resolve(moduleId: string): ModuleId\n}\n\ntype GetOrInstantiateModuleFromParent<M extends Module> = (\n moduleId: M['id'],\n parentModule: M\n) => M\n\ndeclare function getOrInstantiateRuntimeModule(\n chunkPath: ChunkPath,\n moduleId: ModuleId\n): Module\n\nconst hasOwnProperty = Object.prototype.hasOwnProperty\nconst toStringTag = typeof Symbol !== 'undefined' && Symbol.toStringTag\n\nfunction defineProp(\n obj: any,\n name: PropertyKey,\n options: PropertyDescriptor & ThisType<any>\n) {\n if (!hasOwnProperty.call(obj, name)) Object.defineProperty(obj, name, options)\n}\n\nfunction getOverwrittenModule(\n moduleCache: ModuleCache<Module>,\n id: ModuleId\n): Module {\n let module = moduleCache[id]\n if (!module) {\n if (createModuleWithDirectionFlag) {\n // set in development modes for hmr support\n module = createModuleWithDirection(id)\n } else {\n module = createModuleObject(id)\n }\n moduleCache[id] = module\n }\n return module\n}\n\n/**\n * Creates the module object. Only done here to ensure all module objects have the same shape.\n */\nfunction createModuleObject(id: ModuleId): Module {\n return {\n exports: {},\n error: undefined,\n id,\n namespaceObject: undefined,\n }\n}\n\nfunction createModuleWithDirection(id: ModuleId): ModuleWithDirection {\n return {\n exports: {},\n error: undefined,\n id,\n namespaceObject: undefined,\n parents: [],\n children: [],\n }\n}\n\ntype BindingTag = 0\nconst BindingTag_Value = 0 as BindingTag\n\n// an arbitrary sequence of bindings as\n// - a prop name\n// - BindingTag_Value, a value to be bound directly, or\n// - 1 or 2 functions to bind as getters and sdetters\ntype EsmBindings = Array<\n string | BindingTag | (() => unknown) | ((v: unknown) => void) | unknown\n>\n\n/**\n * Adds the getters to the exports object.\n */\nfunction esm(exports: Exports, bindings: EsmBindings) {\n defineProp(exports, '__esModule', { value: true })\n if (toStringTag) defineProp(exports, toStringTag, { value: 'Module' })\n let i = 0\n while (i < bindings.length) {\n const propName = bindings[i++] as string\n const tagOrFunction = bindings[i++]\n if (typeof tagOrFunction === 'number') {\n if (tagOrFunction === BindingTag_Value) {\n defineProp(exports, propName, {\n value: bindings[i++],\n enumerable: true,\n writable: false,\n })\n } else {\n throw new Error(`unexpected tag: ${tagOrFunction}`)\n }\n } else {\n const getterFn = tagOrFunction as () => unknown\n if (typeof bindings[i] === 'function') {\n const setterFn = bindings[i++] as (v: unknown) => void\n defineProp(exports, propName, {\n get: getterFn,\n set: setterFn,\n enumerable: true,\n })\n } else {\n defineProp(exports, propName, {\n get: getterFn,\n enumerable: true,\n })\n }\n }\n }\n Object.seal(exports)\n}\n\n/**\n * Makes the module an ESM with exports\n */\nfunction esmExport(\n this: TurbopackBaseContext<Module>,\n bindings: EsmBindings,\n id: ModuleId | undefined\n) {\n let module: Module\n let exports: Module['exports']\n if (id != null) {\n module = getOverwrittenModule(this.c, id)\n exports = module.exports\n } else {\n module = this.m\n exports = this.e\n }\n module.namespaceObject = exports\n esm(exports, bindings)\n}\ncontextPrototype.s = esmExport\n\ntype ReexportedObjects = Record<PropertyKey, unknown>[]\nfunction ensureDynamicExports(\n module: Module,\n exports: Exports\n): ReexportedObjects {\n let reexportedObjects: ReexportedObjects | undefined =\n REEXPORTED_OBJECTS.get(module)\n\n if (!reexportedObjects) {\n REEXPORTED_OBJECTS.set(module, (reexportedObjects = []))\n module.exports = module.namespaceObject = new Proxy(exports, {\n get(target, prop) {\n if (\n hasOwnProperty.call(target, prop) ||\n prop === 'default' ||\n prop === '__esModule'\n ) {\n return Reflect.get(target, prop)\n }\n for (const obj of reexportedObjects!) {\n const value = Reflect.get(obj, prop)\n if (value !== undefined) return value\n }\n return undefined\n },\n ownKeys(target) {\n const keys = Reflect.ownKeys(target)\n for (const obj of reexportedObjects!) {\n for (const key of Reflect.ownKeys(obj)) {\n if (key !== 'default' && !keys.includes(key)) keys.push(key)\n }\n }\n return keys\n },\n })\n }\n return reexportedObjects\n}\n\n/**\n * Dynamically exports properties from an object\n */\nfunction dynamicExport(\n this: TurbopackBaseContext<Module>,\n object: Record<string, any>,\n id: ModuleId | undefined\n) {\n let module: Module\n let exports: Exports\n if (id != null) {\n module = getOverwrittenModule(this.c, id)\n exports = module.exports\n } else {\n module = this.m\n exports = this.e\n }\n const reexportedObjects = ensureDynamicExports(module, exports)\n\n if (typeof object === 'object' && object !== null) {\n reexportedObjects.push(object)\n }\n}\ncontextPrototype.j = dynamicExport\n\nfunction exportValue(\n this: TurbopackBaseContext<Module>,\n value: any,\n id: ModuleId | undefined\n) {\n let module: Module\n if (id != null) {\n module = getOverwrittenModule(this.c, id)\n } else {\n module = this.m\n }\n module.exports = value\n}\ncontextPrototype.v = exportValue\n\nfunction exportNamespace(\n this: TurbopackBaseContext<Module>,\n namespace: any,\n id: ModuleId | undefined\n) {\n let module: Module\n if (id != null) {\n module = getOverwrittenModule(this.c, id)\n } else {\n module = this.m\n }\n module.exports = module.namespaceObject = namespace\n}\ncontextPrototype.n = exportNamespace\n\nfunction createGetter(obj: Record<string | symbol, any>, key: string | symbol) {\n return () => obj[key]\n}\n\n/**\n * @returns prototype of the object\n */\nconst getProto: (obj: any) => any = Object.getPrototypeOf\n ? (obj) => Object.getPrototypeOf(obj)\n : (obj) => obj.__proto__\n\n/** Prototypes that are not expanded for exports */\nconst LEAF_PROTOTYPES = [null, getProto({}), getProto([]), getProto(getProto)]\n\n/**\n * @param raw\n * @param ns\n * @param allowExportDefault\n * * `false`: will have the raw module as default export\n * * `true`: will have the default property as default export\n */\nfunction interopEsm(\n raw: Exports,\n ns: EsmNamespaceObject,\n allowExportDefault?: boolean\n) {\n const bindings: EsmBindings = []\n let defaultLocation = -1\n for (\n let current = raw;\n (typeof current === 'object' || typeof current === 'function') &&\n !LEAF_PROTOTYPES.includes(current);\n current = getProto(current)\n ) {\n for (const key of Object.getOwnPropertyNames(current)) {\n bindings.push(key, createGetter(raw, key))\n if (defaultLocation === -1 && key === 'default') {\n defaultLocation = bindings.length - 1\n }\n }\n }\n\n // this is not really correct\n // we should set the `default` getter if the imported module is a `.cjs file`\n if (!(allowExportDefault && defaultLocation >= 0)) {\n // Replace the binding with one for the namespace itself in order to preserve iteration order.\n if (defaultLocation >= 0) {\n // Replace the getter with the value\n bindings.splice(defaultLocation, 1, BindingTag_Value, raw)\n } else {\n bindings.push('default', BindingTag_Value, raw)\n }\n }\n\n esm(ns, bindings)\n return ns\n}\n\nfunction createNS(raw: Module['exports']): EsmNamespaceObject {\n if (typeof raw === 'function') {\n return function (this: any, ...args: any[]) {\n return raw.apply(this, args)\n }\n } else {\n return Object.create(null)\n }\n}\n\nfunction esmImport(\n this: TurbopackBaseContext<Module>,\n id: ModuleId\n): Exclude<Module['namespaceObject'], undefined> {\n const module = getOrInstantiateModuleFromParent(id, this.m)\n\n // any ES module has to have `module.namespaceObject` defined.\n if (module.namespaceObject) return module.namespaceObject\n\n // only ESM can be an async module, so we don't need to worry about exports being a promise here.\n const raw = module.exports\n return (module.namespaceObject = interopEsm(\n raw,\n createNS(raw),\n raw && (raw as any).__esModule\n ))\n}\ncontextPrototype.i = esmImport\n\nfunction asyncLoader(\n this: TurbopackBaseContext<Module>,\n moduleId: ModuleId\n): Promise<Exports> {\n const loader = this.r(moduleId) as (\n importFunction: EsmImport\n ) => Promise<Exports>\n return loader(esmImport.bind(this))\n}\ncontextPrototype.A = asyncLoader\n\n// Add a simple runtime require so that environments without one can still pass\n// `typeof require` CommonJS checks so that exports are correctly registered.\nconst runtimeRequire =\n // @ts-ignore\n typeof require === 'function'\n ? // @ts-ignore\n require\n : function require() {\n throw new Error('Unexpected use of runtime require')\n }\ncontextPrototype.t = runtimeRequire\n\nfunction commonJsRequire(\n this: TurbopackBaseContext<Module>,\n id: ModuleId\n): Exports {\n return getOrInstantiateModuleFromParent(id, this.m).exports\n}\ncontextPrototype.r = commonJsRequire\n\n/**\n * Remove fragments and query parameters since they are never part of the context map keys\n *\n * This matches how we parse patterns at resolving time. Arguably we should only do this for\n * strings passed to `import` but the resolve does it for `import` and `require` and so we do\n * here as well.\n */\nfunction parseRequest(request: string): string {\n // Per the URI spec fragments can contain `?` characters, so we should trim it off first\n // https://datatracker.ietf.org/doc/html/rfc3986#section-3.5\n const hashIndex = request.indexOf('#')\n if (hashIndex !== -1) {\n request = request.substring(0, hashIndex)\n }\n\n const queryIndex = request.indexOf('?')\n if (queryIndex !== -1) {\n request = request.substring(0, queryIndex)\n }\n\n return request\n}\n/**\n * `require.context` and require/import expression runtime.\n */\nfunction moduleContext(map: ModuleContextMap): ModuleContext {\n function moduleContext(id: string): Exports {\n id = parseRequest(id)\n if (hasOwnProperty.call(map, id)) {\n return map[id].module()\n }\n\n const e = new Error(`Cannot find module '${id}'`)\n ;(e as any).code = 'MODULE_NOT_FOUND'\n throw e\n }\n\n moduleContext.keys = (): string[] => {\n return Object.keys(map)\n }\n\n moduleContext.resolve = (id: string): ModuleId => {\n id = parseRequest(id)\n if (hasOwnProperty.call(map, id)) {\n return map[id].id()\n }\n\n const e = new Error(`Cannot find module '${id}'`)\n ;(e as any).code = 'MODULE_NOT_FOUND'\n throw e\n }\n\n moduleContext.import = async (id: string) => {\n return await (moduleContext(id) as Promise<Exports>)\n }\n\n return moduleContext\n}\ncontextPrototype.f = moduleContext\n\n/**\n * Returns the path of a chunk defined by its data.\n */\nfunction getChunkPath(chunkData: ChunkData): ChunkPath {\n return typeof chunkData === 'string' ? chunkData : chunkData.path\n}\n\nfunction isPromise<T = any>(maybePromise: any): maybePromise is Promise<T> {\n return (\n maybePromise != null &&\n typeof maybePromise === 'object' &&\n 'then' in maybePromise &&\n typeof maybePromise.then === 'function'\n )\n}\n\nfunction isAsyncModuleExt<T extends {}>(obj: T): obj is AsyncModuleExt & T {\n return turbopackQueues in obj\n}\n\nfunction createPromise<T>() {\n let resolve: (value: T | PromiseLike<T>) => void\n let reject: (reason?: any) => void\n\n const promise = new Promise<T>((res, rej) => {\n reject = rej\n resolve = res\n })\n\n return {\n promise,\n resolve: resolve!,\n reject: reject!,\n }\n}\n\n// Load the CompressedmoduleFactories of a chunk into the `moduleFactories` Map.\n// The CompressedModuleFactories format is\n// - 1 or more module ids\n// - a module factory function\n// So walking this is a little complex but the flat structure is also fast to\n// traverse, we can use `typeof` operators to distinguish the two cases.\nfunction installCompressedModuleFactories(\n chunkModules: CompressedModuleFactories,\n offset: number,\n moduleFactories: ModuleFactories,\n newModuleId?: (id: ModuleId) => void\n) {\n let i = offset\n while (i < chunkModules.length) {\n let end = i + 1\n // Find our factory function\n while (\n end < chunkModules.length &&\n typeof chunkModules[end] !== 'function'\n ) {\n end++\n }\n if (end === chunkModules.length) {\n throw new Error('malformed chunk format, expected a factory function')\n }\n\n // Install the factory for each module ID that doesn't already have one.\n // When some IDs in this group already have a factory, reuse that existing\n // group factory for the missing IDs to keep all IDs in the group consistent.\n // Otherwise, install the factory from this chunk.\n const moduleFactoryFn = chunkModules[end] as Function\n let existingGroupFactory: Function | undefined = undefined\n for (let j = i; j < end; j++) {\n const id = chunkModules[j] as ModuleId\n const existingFactory = moduleFactories.get(id)\n if (existingFactory) {\n existingGroupFactory = existingFactory\n break\n }\n }\n const factoryToInstall = existingGroupFactory ?? moduleFactoryFn\n\n let didInstallFactory = false\n for (let j = i; j < end; j++) {\n const id = chunkModules[j] as ModuleId\n if (!moduleFactories.has(id)) {\n if (!didInstallFactory) {\n if (factoryToInstall === moduleFactoryFn) {\n applyModuleFactoryName(moduleFactoryFn)\n }\n didInstallFactory = true\n }\n moduleFactories.set(id, factoryToInstall)\n newModuleId?.(id)\n }\n }\n i = end + 1 // end is pointing at the last factory advance to the next id or the end of the array.\n }\n}\n\n// everything below is adapted from webpack\n// https://github.com/webpack/webpack/blob/6be4065ade1e252c1d8dcba4af0f43e32af1bdc1/lib/runtime/AsyncModuleRuntimeModule.js#L13\n\nconst turbopackQueues = Symbol('turbopack queues')\nconst turbopackExports = Symbol('turbopack exports')\nconst turbopackError = Symbol('turbopack error')\n\nconst enum QueueStatus {\n Unknown = -1,\n Unresolved = 0,\n Resolved = 1,\n}\n\ntype AsyncQueueFn = (() => void) & { queueCount: number }\ntype AsyncQueue = AsyncQueueFn[] & {\n status: QueueStatus\n}\n\nfunction resolveQueue(queue?: AsyncQueue) {\n if (queue && queue.status !== QueueStatus.Resolved) {\n queue.status = QueueStatus.Resolved\n queue.forEach((fn) => fn.queueCount--)\n queue.forEach((fn) => (fn.queueCount-- ? fn.queueCount++ : fn()))\n }\n}\n\ntype Dep = Exports | AsyncModulePromise | Promise<Exports>\n\ntype AsyncModuleExt = {\n [turbopackQueues]: (fn: (queue: AsyncQueue) => void) => void\n [turbopackExports]: Exports\n [turbopackError]?: any\n}\n\ntype AsyncModulePromise<T = Exports> = Promise<T> & AsyncModuleExt\n\nfunction wrapDeps(deps: Dep[]): AsyncModuleExt[] {\n return deps.map((dep): AsyncModuleExt => {\n if (dep !== null && typeof dep === 'object') {\n if (isAsyncModuleExt(dep)) return dep\n if (isPromise(dep)) {\n const queue: AsyncQueue = Object.assign([], {\n status: QueueStatus.Unresolved,\n })\n\n const obj: AsyncModuleExt = {\n [turbopackExports]: {},\n [turbopackQueues]: (fn: (queue: AsyncQueue) => void) => fn(queue),\n }\n\n dep.then(\n (res) => {\n obj[turbopackExports] = res\n resolveQueue(queue)\n },\n (err) => {\n obj[turbopackError] = err\n resolveQueue(queue)\n }\n )\n\n return obj\n }\n }\n\n return {\n [turbopackExports]: dep,\n [turbopackQueues]: () => {},\n }\n })\n}\n\nfunction asyncModule(\n this: TurbopackBaseContext<Module>,\n body: (\n handleAsyncDependencies: (\n deps: Dep[]\n ) => Exports[] | Promise<() => Exports[]>,\n asyncResult: (err?: any) => void\n ) => void,\n hasAwait: boolean\n) {\n const module = this.m\n const queue: AsyncQueue | undefined = hasAwait\n ? Object.assign([], { status: QueueStatus.Unknown })\n : undefined\n\n const depQueues: Set<AsyncQueue> = new Set()\n\n const { resolve, reject, promise: rawPromise } = createPromise<Exports>()\n\n const promise: AsyncModulePromise = Object.assign(rawPromise, {\n [turbopackExports]: module.exports,\n [turbopackQueues]: (fn) => {\n queue && fn(queue)\n depQueues.forEach(fn)\n promise['catch'](() => {})\n },\n } satisfies AsyncModuleExt)\n\n const attributes: PropertyDescriptor = {\n get(): any {\n return promise\n },\n set(v: any) {\n // Calling `esmExport` leads to this.\n if (v !== promise) {\n promise[turbopackExports] = v\n }\n },\n }\n\n Object.defineProperty(module, 'exports', attributes)\n Object.defineProperty(module, 'namespaceObject', attributes)\n\n function handleAsyncDependencies(deps: Dep[]) {\n const currentDeps = wrapDeps(deps)\n\n const getResult = () =>\n currentDeps.map((d) => {\n if (d[turbopackError]) throw d[turbopackError]\n return d[turbopackExports]\n })\n\n const { promise, resolve } = createPromise<() => Exports[]>()\n\n const fn: AsyncQueueFn = Object.assign(() => resolve(getResult), {\n queueCount: 0,\n })\n\n function fnQueue(q: AsyncQueue) {\n if (q !== queue && !depQueues.has(q)) {\n depQueues.add(q)\n if (q && q.status === QueueStatus.Unresolved) {\n fn.queueCount++\n q.push(fn)\n }\n }\n }\n\n currentDeps.map((dep) => dep[turbopackQueues](fnQueue))\n\n return fn.queueCount ? promise : getResult()\n }\n\n function asyncResult(err?: any) {\n if (err) {\n reject((promise[turbopackError] = err))\n } else {\n resolve(promise[turbopackExports])\n }\n\n resolveQueue(queue)\n }\n\n body(handleAsyncDependencies, asyncResult)\n\n if (queue && queue.status === QueueStatus.Unknown) {\n queue.status = QueueStatus.Unresolved\n }\n}\ncontextPrototype.a = asyncModule\n\n/**\n * A pseudo \"fake\" URL object to resolve to its relative path.\n *\n * When UrlRewriteBehavior is set to relative, calls to the `new URL()` will construct url without base using this\n * runtime function to generate context-agnostic urls between different rendering context, i.e ssr / client to avoid\n * hydration mismatch.\n *\n * This is based on webpack's existing implementation:\n * https://github.com/webpack/webpack/blob/87660921808566ef3b8796f8df61bd79fc026108/lib/runtime/RelativeUrlRuntimeModule.js\n */\nconst relativeURL = function relativeURL(this: any, inputUrl: string) {\n const realUrl = new URL(inputUrl, 'x:/')\n const values: Record<string, any> = {}\n for (const key in realUrl) values[key] = (realUrl as any)[key]\n values.href = inputUrl\n values.pathname = inputUrl.replace(/[?#].*/, '')\n values.origin = values.protocol = ''\n values.toString = values.toJSON = (..._args: Array<any>) => inputUrl\n for (const key in values)\n Object.defineProperty(this, key, {\n enumerable: true,\n configurable: true,\n value: values[key],\n })\n}\nrelativeURL.prototype = URL.prototype\ncontextPrototype.U = relativeURL\n\n/**\n * Utility function to ensure all variants of an enum are handled.\n */\nfunction invariant(never: never, computeMessage: (arg: any) => string): never {\n throw new Error(`Invariant: ${computeMessage(never)}`)\n}\n\n/**\n * Constructs an error message for when a module factory is not available.\n */\nfunction factoryNotAvailableMessage(\n moduleId: ModuleId,\n sourceType: SourceType,\n sourceData: SourceData\n): string {\n let instantiationReason: string\n switch (sourceType) {\n case SourceType.Runtime:\n instantiationReason = `as a runtime entry of chunk ${sourceData}`\n break\n case SourceType.Parent:\n instantiationReason = `because it was required from module ${sourceData}`\n break\n case SourceType.Update:\n instantiationReason = 'because of an HMR update'\n break\n default:\n invariant(\n sourceType,\n (sourceType) => `Unknown source type: ${sourceType}`\n )\n }\n return `Module ${moduleId} was instantiated ${instantiationReason}, but the module factory is not available.`\n}\n\n/**\n * A stub function to make `require` available but non-functional in ESM.\n */\nfunction requireStub(_moduleId: ModuleId): never {\n throw new Error('dynamic usage of require is not supported')\n}\ncontextPrototype.z = requireStub\n\n// Make `globalThis` available to the module in a way that cannot be shadowed by a local variable.\ncontextPrototype.g = globalThis\n\ntype ContextConstructor<M> = {\n new (module: Module, exports: Exports): TurbopackBaseContext<M>\n}\n\nfunction applyModuleFactoryName(factory: Function) {\n // Give the module factory a nice name to improve stack traces.\n Object.defineProperty(factory, 'name', {\n value: 'module evaluation',\n })\n}\n"],"names":["SourceType","createModuleWithDirectionFlag","REEXPORTED_OBJECTS","WeakMap","Context","module","exports","m","e","contextPrototype","prototype","hasOwnProperty","Object","toStringTag","Symbol","defineProp","obj","name","options","call","defineProperty","getOverwrittenModule","moduleCache","id","createModuleWithDirection","createModuleObject","error","undefined","namespaceObject","parents","children","BindingTag_Value","esm","bindings","value","i","length","propName","tagOrFunction","enumerable","writable","Error","getterFn","setterFn","get","set","seal","esmExport","c","s","ensureDynamicExports","reexportedObjects","Proxy","target","prop","Reflect","ownKeys","keys","key","includes","push","dynamicExport","object","j","exportValue","v","exportNamespace","namespace","n","createGetter","getProto","getPrototypeOf","__proto__","LEAF_PROTOTYPES","interopEsm","raw","ns","allowExportDefault","defaultLocation","current","getOwnPropertyNames","splice","createNS","args","apply","create","esmImport","getOrInstantiateModuleFromParent","__esModule","asyncLoader","moduleId","loader","r","bind","A","runtimeRequire","require","require1","t","commonJsRequire","parseRequest","request","hashIndex","indexOf","substring","queryIndex","moduleContext","map","code","resolve","import","f","getChunkPath","chunkData","path","isPromise","maybePromise","then","isAsyncModuleExt","turbopackQueues","createPromise","reject","promise","Promise","res","rej","installCompressedModuleFactories","chunkModules","offset","moduleFactories","newModuleId","end","moduleFactoryFn","existingGroupFactory","existingFactory","factoryToInstall","didInstallFactory","has","applyModuleFactoryName","turbopackExports","turbopackError","resolveQueue","queue","status","forEach","fn","queueCount","wrapDeps","deps","dep","assign","err","asyncModule","body","hasAwait","depQueues","Set","rawPromise","attributes","handleAsyncDependencies","currentDeps","getResult","d","fnQueue","q","add","asyncResult","a","relativeURL","inputUrl","realUrl","URL","values","href","pathname","replace","origin","protocol","toString","toJSON","_args","configurable","U","invariant","never","computeMessage","factoryNotAvailableMessage","sourceType","sourceData","instantiationReason","requireStub","_moduleId","z","g","globalThis","factory"],"mappings":"AAAA;;;;;CAKC,GAED,oDAAoD,GAEpD,6CAA6C;AAI7C;;;CAGC,GACD,IAAA,AAAKA,oCAAAA;IACH;;;;GAIC;IAED;;;GAGC;IAED;;;;GAIC;W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AI,EAAEsC,KAAK;QAC/BnB,YAAY;QACZ8I,cAAc;QACdnJ,OAAO0I,MAAM,CAAClH,IAAI;IACpB;AACJ;AACA8G,YAAY9J,SAAS,GAAGiK,IAAIjK,SAAS;AACrCD,iBAAiB6K,CAAC,GAAGd;AAErB;;CAEC,GACD,SAASe,UAAUC,KAAY,EAAEC,cAAoC;IACnE,MAAM,IAAIhJ,MAAM,CAAC,WAAW,EAAEgJ,eAAeD,QAAQ;AACvD;AAEA;;CAEC,GACD,SAASE,2BACPhG,QAAkB,EAClBiG,UAAsB,EACtBC,UAAsB;IAEtB,IAAIC;IACJ,OAAQF;QACN;YACEE,sBAAsB,CAAC,4BAA4B,EAAED,YAAY;YACjE;QACF;YACEC,sBAAsB,CAAC,oCAAoC,EAAED,YAAY;YACzE;QACF;YACEC,sBAAsB;YACtB;QACF;YACEN,UACEI,YACA,CAACA,aAAe,CAAC,qBAAqB,EAAEA,YAAY;IAE1D;IACA,OAAO,CAAC,OAAO,EAAEjG,SAAS,kBAAkB,EAAEmG,oBAAoB,0CAA0C,CAAC;AAC/G;AAEA;;CAEC,GACD,SAASC,YAAYC,SAAmB;IACtC,MAAM,IAAItJ,MAAM;AAClB;AACAhC,iBAAiBuL,CAAC,GAAGF;AAErB,kGAAkG;AAClGrL,iBAAiBwL,CAAC,GAAGC;AAMrB,SAASxD,uBAAuByD,OAAiB;IAC/C,+DAA+D;IAC/DvL,OAAOQ,cAAc,CAAC+K,SAAS,QAAQ;QACrCjK,OAAO;IACT;AACF","ignoreList":[0]}},
{"offset": {"line": 591, "column": 0}, "map": {"version":3,"sources":["turbopack:///[turbopack]/browser/runtime/base/runtime-base.ts"],"sourcesContent":["/**\n * This file contains runtime types and functions that are shared between all\n * Turbopack *browser* ECMAScript runtimes.\n *\n * It will be appended to the runtime code of each runtime right after the\n * shared runtime utils.\n */\n\n/* eslint-disable @typescript-eslint/no-unused-vars */\n\n/// <reference path=\"../base/globals.d.ts\" />\n/// <reference path=\"../../../shared/runtime/runtime-utils.ts\" />\n\n// Used in WebWorkers to tell the runtime about the chunk suffix\ndeclare var TURBOPACK_ASSET_SUFFIX: string\n// Used in WebWorkers to tell the runtime about the current chunk url since it\n// can't be detected via `document.currentScript`. Note it's stored in reversed\n// order to use `push` and `pop`\ndeclare var TURBOPACK_NEXT_CHUNK_URLS: ChunkUrl[] | undefined\n\n// Injected by rust code\ndeclare var CHUNK_BASE_PATH: string\ndeclare var ASSET_SUFFIX: string\ndeclare var WORKER_FORWARDED_GLOBALS: string[]\n\ninterface TurbopackBrowserBaseContext<M> extends TurbopackBaseContext<M> {\n R: ResolvePathFromModule\n}\n\nconst browserContextPrototype =\n Context.prototype as TurbopackBrowserBaseContext<unknown>\n\n// Provided by build or dev base\ndeclare function instantiateModule(\n id: ModuleId,\n sourceType: SourceType,\n sourceData: SourceData\n): Module\n\ntype RuntimeParams = {\n otherChunks: ChunkData[]\n runtimeModuleIds: ModuleId[]\n}\n\ntype ChunkRegistrationChunk =\n | ChunkPath\n | { getAttribute: (name: string) => string | null }\n | undefined\n\ntype ChunkRegistration = [\n chunkPath: ChunkRegistrationChunk,\n ...([RuntimeParams] | CompressedModuleFactories),\n]\n\ntype ChunkList = {\n script: ChunkRegistrationChunk\n chunks: ChunkData[]\n source: 'entry' | 'dynamic'\n}\n\ninterface RuntimeBackend {\n registerChunk: (\n chunkPath: ChunkPath | ChunkScript,\n params?: RuntimeParams\n ) => void\n /**\n * Returns the same Promise for the same chunk URL.\n */\n loadChunkCached: (sourceType: SourceType, chunkUrl: ChunkUrl) => Promise<void>\n loadWebAssembly: (\n sourceType: SourceType,\n sourceData: SourceData,\n wasmChunkPath: ChunkPath,\n edgeModule: () => WebAssembly.Module,\n importsObj: WebAssembly.Imports\n ) => Promise<Exports>\n loadWebAssemblyModule: (\n sourceType: SourceType,\n sourceData: SourceData,\n wasmChunkPath: ChunkPath,\n edgeModule: () => WebAssembly.Module\n ) => Promise<WebAssembly.Module>\n}\n\ninterface DevRuntimeBackend {\n reloadChunk?: (chunkUrl: ChunkUrl) => Promise<void>\n unloadChunk?: (chunkUrl: ChunkUrl) => void\n restart: () => void\n}\n\nconst moduleFactories: ModuleFactories = new Map()\ncontextPrototype.M = moduleFactories\n\nconst availableModules: Map<ModuleId, Promise<any> | true> = new Map()\n\nconst availableModuleChunks: Map<ChunkPath, Promise<any> | true> = new Map()\n\nfunction loadChunk(\n this: TurbopackBrowserBaseContext<Module>,\n chunkData: ChunkData\n): Promise<void> {\n return loadChunkInternal(SourceType.Parent, this.m.id, chunkData)\n}\nbrowserContextPrototype.l = loadChunk\n\nfunction loadInitialChunk(chunkPath: ChunkPath, chunkData: ChunkData) {\n return loadChunkInternal(SourceType.Runtime, chunkPath, chunkData)\n}\n\nasync function loadChunkInternal(\n sourceType: SourceType,\n sourceData: SourceData,\n chunkData: ChunkData\n): Promise<void> {\n if (typeof chunkData === 'string') {\n return loadChunkPath(sourceType, sourceData, chunkData)\n }\n\n const includedList = chunkData.included || []\n const modulesPromises = includedList.map((included) => {\n if (moduleFactories.has(included)) return true\n return availableModules.get(included)\n })\n if (modulesPromises.length > 0 && modulesPromises.every((p) => p)) {\n // When all included items are already loaded or loading, we can skip loading ourselves\n await Promise.all(modulesPromises)\n return\n }\n\n const includedModuleChunksList = chunkData.moduleChunks || []\n const moduleChunksPromises = includedModuleChunksList\n .map((included) => {\n // TODO(alexkirsz) Do we need this check?\n // if (moduleFactories[included]) return true;\n return availableModuleChunks.get(included)\n })\n .filter((p) => p)\n\n let promise: Promise<unknown>\n if (moduleChunksPromises.length > 0) {\n // Some module chunks are already loaded or loading.\n\n if (moduleChunksPromises.length === includedModuleChunksList.length) {\n // When all included module chunks are already loaded or loading, we can skip loading ourselves\n await Promise.all(moduleChunksPromises)\n return\n }\n\n const moduleChunksToLoad: Set<ChunkPath> = new Set()\n for (const moduleChunk of includedModuleChunksList) {\n if (!availableModuleChunks.has(moduleChunk)) {\n moduleChunksToLoad.add(moduleChunk)\n }\n }\n\n for (const moduleChunkToLoad of moduleChunksToLoad) {\n const promise = loadChunkPath(sourceType, sourceData, moduleChunkToLoad)\n\n availableModuleChunks.set(moduleChunkToLoad, promise)\n\n moduleChunksPromises.push(promise)\n }\n\n promise = Promise.all(moduleChunksPromises)\n } else {\n promise = loadChunkPath(sourceType, sourceData, chunkData.path)\n\n // Mark all included module chunks as loading if they are not already loaded or loading.\n for (const includedModuleChunk of includedModuleChunksList) {\n if (!availableModuleChunks.has(includedModuleChunk)) {\n availableModuleChunks.set(includedModuleChunk, promise)\n }\n }\n }\n\n for (const included of includedList) {\n if (!availableModules.has(included)) {\n // It might be better to race old and new promises, but it's rare that the new promise will be faster than a request started earlier.\n // In production it's even more rare, because the chunk optimization tries to deduplicate modules anyway.\n availableModules.set(included, promise)\n }\n }\n\n await promise\n}\n\nconst loadedChunk = Promise.resolve(undefined)\nconst instrumentedBackendLoadChunks = new WeakMap<\n Promise<any>,\n Promise<any> | typeof loadedChunk\n>()\n// Do not make this async. React relies on referential equality of the returned Promise.\nfunction loadChunkByUrl(\n this: TurbopackBrowserBaseContext<Module>,\n chunkUrl: ChunkUrl\n) {\n return loadChunkByUrlInternal(SourceType.Parent, this.m.id, chunkUrl)\n}\nbrowserContextPrototype.L = loadChunkByUrl\n\n// Do not make this async. React relies on referential equality of the returned Promise.\nfunction loadChunkByUrlInternal(\n sourceType: SourceType,\n sourceData: SourceData,\n chunkUrl: ChunkUrl\n): Promise<any> {\n const thenable = BACKEND.loadChunkCached(sourceType, chunkUrl)\n let entry = instrumentedBackendLoadChunks.get(thenable)\n if (entry === undefined) {\n const resolve = instrumentedBackendLoadChunks.set.bind(\n instrumentedBackendLoadChunks,\n thenable,\n loadedChunk\n )\n entry = thenable.then(resolve).catch((cause) => {\n let loadReason: string\n switch (sourceType) {\n case SourceType.Runtime:\n loadReason = `as a runtime dependency of chunk ${sourceData}`\n break\n case SourceType.Parent:\n loadReason = `from module ${sourceData}`\n break\n case SourceType.Update:\n loadReason = 'from an HMR update'\n break\n default:\n invariant(\n sourceType,\n (sourceType) => `Unknown source type: ${sourceType}`\n )\n }\n let error = new Error(\n `Failed to load chunk ${chunkUrl} ${loadReason}${\n cause ? `: ${cause}` : ''\n }`,\n cause ? { cause } : undefined\n )\n error.name = 'ChunkLoadError'\n throw error\n })\n instrumentedBackendLoadChunks.set(thenable, entry)\n }\n\n return entry\n}\n\n// Do not make this async. React relies on referential equality of the returned Promise.\nfunction loadChunkPath(\n sourceType: SourceType,\n sourceData: SourceData,\n chunkPath: ChunkPath\n): Promise<void> {\n const url = getChunkRelativeUrl(chunkPath)\n return loadChunkByUrlInternal(sourceType, sourceData, url)\n}\n\n/**\n * Returns an absolute url to an asset.\n */\nfunction resolvePathFromModule(\n this: TurbopackBaseContext<Module>,\n moduleId: string\n): string {\n const exported = this.r(moduleId)\n return exported?.default ?? exported\n}\nbrowserContextPrototype.R = resolvePathFromModule\n\n/**\n * no-op for browser\n * @param modulePath\n */\nfunction resolveAbsolutePath(modulePath?: string): string {\n return `/ROOT/${modulePath ?? ''}`\n}\nbrowserContextPrototype.P = resolveAbsolutePath\n\n/**\n * Exports a URL with the static suffix appended.\n */\nfunction exportUrl(\n this: TurbopackBrowserBaseContext<Module>,\n url: string,\n id: ModuleId | undefined\n) {\n exportValue.call(this, `${url}${ASSET_SUFFIX}`, id)\n}\nbrowserContextPrototype.q = exportUrl\n\n/**\n * Creates a worker by instantiating the given WorkerConstructor with the\n * appropriate URL and options.\n *\n * The entrypoint is a pre-compiled worker runtime file. The params configure\n * which module chunks to load and which module to run as the entry point.\n *\n * The params are a JSON array of the following structure:\n * `[TURBOPACK_NEXT_CHUNK_URLS, ASSET_SUFFIX, ...WORKER_FORWARDED_GLOBALS values]`\n *\n * @param WorkerConstructor The Worker or SharedWorker constructor\n * @param entrypoint URL path to the worker entrypoint chunk\n * @param moduleChunks list of module chunk paths to load\n * @param workerOptions options to pass to the Worker constructor (optional)\n */\nfunction createWorker(\n WorkerConstructor: { new (url: URL, options?: object): Worker },\n entrypoint: ChunkPath,\n moduleChunks: ChunkPath[],\n workerOptions?: object\n): Worker {\n const isSharedWorker = WorkerConstructor.name === 'SharedWorker'\n\n const chunkUrls = moduleChunks\n .map((chunk) => getChunkRelativeUrl(chunk))\n .reverse()\n const params: unknown[] = [chunkUrls, ASSET_SUFFIX]\n for (const globalName of WORKER_FORWARDED_GLOBALS) {\n params.push((globalThis as Record<string, unknown>)[globalName])\n }\n\n const url = new URL(getChunkRelativeUrl(entrypoint), location.origin)\n const paramsJson = JSON.stringify(params)\n if (isSharedWorker) {\n url.searchParams.set('params', paramsJson)\n } else {\n url.hash = '#params=' + encodeURIComponent(paramsJson)\n }\n\n // Remove type: \"module\" from options since our worker entrypoint is not a module\n const options = workerOptions\n ? { ...workerOptions, type: undefined }\n : undefined\n return new WorkerConstructor(url, options)\n}\nbrowserContextPrototype.b = createWorker\n\n/**\n * Instantiates a runtime module.\n */\nfunction instantiateRuntimeModule(\n moduleId: ModuleId,\n chunkPath: ChunkPath\n): Module {\n return instantiateModule(moduleId, SourceType.Runtime, chunkPath)\n}\n/**\n * Returns the URL relative to the origin where a chunk can be fetched from.\n */\nfunction getChunkRelativeUrl(chunkPath: ChunkPath | ChunkListPath): ChunkUrl {\n return `${CHUNK_BASE_PATH}${chunkPath\n .split('/')\n .map((p) => encodeURIComponent(p))\n .join('/')}${ASSET_SUFFIX}` as ChunkUrl\n}\n\n/**\n * Return the ChunkPath from a ChunkScript.\n */\nfunction getPathFromScript(chunkScript: ChunkPath | ChunkScript): ChunkPath\nfunction getPathFromScript(\n chunkScript: ChunkListPath | ChunkListScript\n): ChunkListPath\nfunction getPathFromScript(\n chunkScript: ChunkPath | ChunkListPath | ChunkScript | ChunkListScript\n): ChunkPath | ChunkListPath {\n if (typeof chunkScript === 'string') {\n return chunkScript as ChunkPath | ChunkListPath\n }\n const chunkUrl = chunkScript.src!\n const src = decodeURIComponent(chunkUrl.replace(/[?#].*$/, ''))\n const path = src.startsWith(CHUNK_BASE_PATH)\n ? src.slice(CHUNK_BASE_PATH.length)\n : src\n return path as ChunkPath | ChunkListPath\n}\n\n/**\n * Return the ChunkUrl from a ChunkScript.\n */\nfunction getUrlFromScript(chunk: ChunkPath | ChunkScript): ChunkUrl {\n if (typeof chunk === 'string') {\n return getChunkRelativeUrl(chunk)\n } else {\n // This is already exactly what we want\n return chunk.src! as ChunkUrl\n }\n}\n\n/**\n * Determine the chunk to register. Note that this function has side-effects!\n */\nfunction getChunkFromRegistration(\n chunk: ChunkRegistrationChunk\n): ChunkPath | CurrentScript {\n if (typeof chunk === 'string') {\n return chunk\n } else if (!chunk) {\n if (typeof TURBOPACK_NEXT_CHUNK_URLS !== 'undefined') {\n return { src: TURBOPACK_NEXT_CHUNK_URLS.pop()! } as CurrentScript\n } else {\n throw new Error('chunk path empty but not in a worker')\n }\n } else {\n return { src: chunk.getAttribute('src')! } as CurrentScript\n }\n}\n\n/**\n * Checks if a given path/URL ends with the given extension,\n * optionally followed by ?query or #fragment.\n */\nfunction endsWithExtension(\n chunkUrlOrPath: ChunkUrl | ChunkPath,\n ext: string\n): boolean {\n // Find where the path ends (before query or fragment)\n const q = chunkUrlOrPath.indexOf('?')\n let end: number\n if (q !== -1) {\n end = q\n } else {\n const h = chunkUrlOrPath.indexOf('#')\n end = h !== -1 ? h : chunkUrlOrPath.length\n }\n // Check if the path portion ends with the extension\n return end >= ext.length && chunkUrlOrPath.startsWith(ext, end - ext.length)\n}\n\nfunction isJs(chunkUrlOrPath: ChunkUrl | ChunkPath): boolean {\n return endsWithExtension(chunkUrlOrPath, '.js')\n}\n\nfunction isCss(chunkUrl: ChunkUrl): boolean {\n return endsWithExtension(chunkUrl, '.css')\n}\n\nfunction loadWebAssembly(\n this: TurbopackBaseContext<Module>,\n chunkPath: ChunkPath,\n edgeModule: () => WebAssembly.Module,\n importsObj: WebAssembly.Imports\n): Promise<Exports> {\n return BACKEND.loadWebAssembly(\n SourceType.Parent,\n this.m.id,\n chunkPath,\n edgeModule,\n importsObj\n )\n}\ncontextPrototype.w = loadWebAssembly\n\nfunction loadWebAssemblyModule(\n this: TurbopackBaseContext<Module>,\n chunkPath: ChunkPath,\n edgeModule: () => WebAssembly.Module\n): Promise<WebAssembly.Module> {\n return BACKEND.loadWebAssemblyModule(\n SourceType.Parent,\n this.m.id,\n chunkPath,\n edgeModule\n )\n}\ncontextPrototype.u = loadWebAssemblyModule\n"],"names":["browserContextPrototype","Context","prototype","moduleFactories","Map","contextPrototype","M","availableModules","availableModuleChunks","loadChunk","chunkData","loadChunkInternal","SourceType","Parent","m","id","l","loadInitialChunk","chunkPath","Runtime","sourceType","sourceData","loadChunkPath","includedList","included","modulesPromises","map","has","get","length","every","p","Promise","all","includedModuleChunksList","moduleChunks","moduleChunksPromises","filter","promise","moduleChunksToLoad","Set","moduleChunk","add","moduleChunkToLoad","set","push","path","includedModuleChunk","loadedChunk","resolve","undefined","instrumentedBackendLoadChunks","WeakMap","loadChunkByUrl","chunkUrl","loadChunkByUrlInternal","L","thenable","BACKEND","loadChunkCached","entry","bind","then","catch","cause","loadReason","Update","invariant","error","Error","name","url","getChunkRelativeUrl","resolvePathFromModule","moduleId","exported","r","default","R","resolveAbsolutePath","modulePath","P","exportUrl","exportValue","call","ASSET_SUFFIX","q","createWorker","WorkerConstructor","entrypoint","workerOptions","isSharedWorker","chunkUrls","chunk","reverse","params","globalName","WORKER_FORWARDED_GLOBALS","globalThis","URL","location","origin","paramsJson","JSON","stringify","searchParams","hash","encodeURIComponent","options","type","b","instantiateRuntimeModule","instantiateModule","CHUNK_BASE_PATH","split","join","getPathFromScript","chunkScript","src","decodeURIComponent","replace","startsWith","slice","getUrlFromScript","getChunkFromRegistration","TURBOPACK_NEXT_CHUNK_URLS","pop","getAttribute","endsWithExtension","chunkUrlOrPath","ext","indexOf","end","h","isJs","isCss","loadWebAssembly","edgeModule","importsObj","w","loadWebAssemblyModule","u"],"mappings":"AAAA;;;;;;CAMC,GAED,oDAAoD,GAEpD,6CAA6C;AAC7C,iEAAiE;AAEjE,gEAAg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C,EACpCC,UAA+B;IAE/B,OAAOhF,QAAQ8E,eAAe,CAC5B5H,WAAWC,MAAM,EACjB,IAAI,CAACC,CAAC,CAACC,EAAE,EACTG,WACAuH,YACAC;AAEJ;AACArI,iBAAiBsI,CAAC,GAAGH;AAErB,SAASI,sBAEP1H,SAAoB,EACpBuH,UAAoC;IAEpC,OAAO/E,QAAQkF,qBAAqB,CAClChI,WAAWC,MAAM,EACjB,IAAI,CAACC,CAAC,CAACC,EAAE,EACTG,WACAuH;AAEJ;AACApI,iBAAiBwI,CAAC,GAAGD","ignoreList":[0]}},
......
;!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]="161bf1fe-ca33-d8de-b14a-ddace1bb63c7")}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]="9cce6140-a664-1990-1f64-3699b6ffe1e3")}catch(e){}}();
(globalThis["TURBOPACK"] || (globalThis["TURBOPACK"] = [])).push([
"output/1i9t_crates_turbopack-tests_tests_snapshot_debug-ids_browser_input_index_19boa0e.js",
{"otherChunks":["output/1do3_crates_turbopack-tests_tests_snapshot_debug-ids_browser_input_index_03ibyvs.js"],"runtimeModuleIds":["[project]/turbopack/crates/turbopack-tests/tests/snapshot/debug-ids/browser/input/index.js [test] (ecmascript)"]}
......@@ -8,11 +8,11 @@ if (!Array.isArray(globalThis["TURBOPACK"])) {
return;
}
const CHUNK_BASE_PATH = "";
const RELATIVE_ROOT_PATH = "../../../../../../..";
const RUNTIME_PUBLIC_PATH = "";
const ASSET_SUFFIX = "";
const WORKER_FORWARDED_GLOBALS = [];
var CHUNK_BASE_PATH = "";
var RELATIVE_ROOT_PATH = "../../../../../../..";
var RUNTIME_PUBLIC_PATH = "";
var ASSET_SUFFIX = "";
var WORKER_FORWARDED_GLOBALS = [];
/**
* This file contains runtime types and functions that are shared between all
* TurboPack ECMAScript runtimes.
......@@ -2218,14 +2218,14 @@ function _eval({ code, url, map }) {
// eslint-disable-next-line no-eval
return eval(code);
}
const chunksToRegister = globalThis["TURBOPACK"];
var chunksToRegister = globalThis["TURBOPACK"];
globalThis["TURBOPACK"] = { push: registerChunk };
chunksToRegister.forEach(registerChunk);
const chunkListsToRegister = globalThis["TURBOPACK_CHUNK_LISTS"] || [];
var chunkListsToRegister = globalThis["TURBOPACK_CHUNK_LISTS"] || [];
globalThis["TURBOPACK_CHUNK_LISTS"] = { push: registerChunkList };
chunkListsToRegister.forEach(registerChunkList);
})();
//# debugId=161bf1fe-ca33-d8de-b14a-ddace1bb63c7
//# debugId=9cce6140-a664-1990-1f64-3699b6ffe1e3
//# sourceMappingURL=1do3_crates_turbopack-tests_tests_snapshot_debug-ids_browser_input_index_19boa0e.js.map
\ No newline at end of file
const RUNTIME_PUBLIC_PATH = "output/[turbopack]_runtime.js";
const RELATIVE_ROOT_PATH = "../../../../../../..";
const ASSET_PREFIX = "/";
const WORKER_FORWARDED_GLOBALS = [];
var RUNTIME_PUBLIC_PATH = "output/[turbopack]_runtime.js";
var RELATIVE_ROOT_PATH = "../../../../../../..";
var ASSET_PREFIX = "/";
var WORKER_FORWARDED_GLOBALS = [];
/**
* This file contains runtime types and functions that are shared between all
* TurboPack ECMAScript runtimes.
......
......@@ -5,7 +5,7 @@
__turbopack_context__.s([]);
var __TURBOPACK__url__external__node$3a$child_process__ = __turbopack_context__.x("node:child_process", ()=>require("node:child_process"), true);
var __TURBOPACK__url__external__node$3a$fs__ = __turbopack_context__.x("node:fs", ()=>require("node:fs"), true);
const __TURBOPACK__import$2e$meta__ = {
var __TURBOPACK__import$2e$meta__ = {
get url () {
return `file://${__turbopack_context__.P("turbopack/crates/turbopack-tests/tests/snapshot/dynamic-request/very-dynamic/input/index.js")}`;
}
......
(globalThis["TURBOPACK"] || (globalThis["TURBOPACK"] = [])).push(["output/turbopack_crates_turbopack-tests_tests_snapshot_env_env_input_13-d6v3._.js",
"[project]/turbopack/crates/turbopack-tests/tests/snapshot/env/env/input/.env/.env.js [test] (ecmascript)", ((__turbopack_context__, module, exports) => {
const env = process.env = {
var env = process.env = {
...process.env
};
env["ALLFOOBAR"] = foobarfoobar;
......
......@@ -2,6 +2,6 @@
"version": 3,
"sources": [],
"sections": [
{"offset": {"line": 3, "column": 0}, "map": {"version":3,"sources":["turbopack:///[project]/turbopack/crates/turbopack-tests/tests/snapshot/env/env/input/.env/.env.js"],"sourcesContent":["const env = process.env = {...process.env};\n\nenv[\"ALLFOOBAR\"] = foobarfoobar;\nenv[\"BARFOO\"] = barfoo;\nenv[\"FOO\"] = foo;\nenv[\"FOOBAR\"] = foobar;\n"],"names":["env","process","foobarfoobar","barfoo","foo","foobar"],"mappings":"AAAA,MAAMA,MAAMC,QAAQD,GAAG,GAAG;IAAC,GAAGC,QAAQD,GAAG;AAAA;AAEzCA,GAAG,CAAC,YAAY,GAAGE;AACnBF,GAAG,CAAC,SAAS,GAAGG;AAChBH,GAAG,CAAC,MAAM,GAAGI;AACbJ,GAAG,CAAC,SAAS,GAAGK"}},
{"offset": {"line": 3, "column": 0}, "map": {"version":3,"sources":["turbopack:///[project]/turbopack/crates/turbopack-tests/tests/snapshot/env/env/input/.env/.env.js"],"sourcesContent":["var env = process.env = {...process.env};\n\nenv[\"ALLFOOBAR\"] = foobarfoobar;\nenv[\"BARFOO\"] = barfoo;\nenv[\"FOO\"] = foo;\nenv[\"FOOBAR\"] = foobar;\n"],"names":["env","process","foobarfoobar","barfoo","foo","foobar"],"mappings":"AAAA,IAAIA,MAAMC,QAAQD,GAAG,GAAG;IAAC,GAAGC,QAAQD,GAAG;AAAA;AAEvCA,GAAG,CAAC,YAAY,GAAGE;AACnBF,GAAG,CAAC,SAAS,GAAGG;AAChBH,GAAG,CAAC,MAAM,GAAGI;AACbJ,GAAG,CAAC,SAAS,GAAGK"}},
{"offset": {"line": 13, "column": 0}, "map": {"version":3,"sources":["turbopack:///[project]/turbopack/crates/turbopack-tests/tests/snapshot/env/env/input/index.js"],"sourcesContent":["console.log(process.env.FOOBAR)\nconsole.log(process.env.BARFOO)\nconsole.log(process.env.ALLFOOBAR)\n"],"names":["console","log","process","env","FOOBAR","BARFOO","ALLFOOBAR"],"mappings":"AAAAA,QAAQC,GAAG,CAACC,QAAQC,GAAG,CAACC,MAAM;AAC9BJ,QAAQC,GAAG,CAACC,QAAQC,GAAG,CAACE,MAAM;AAC9BL,QAAQC,GAAG,CAACC,QAAQC,GAAG,CAACG,SAAS"}}]
}
\ No newline at end of file
(globalThis["TURBOPACK"] || (globalThis["TURBOPACK"] = [])).push(["output/turbopack_crates_turbopack-tests_tests_snapshot_import-meta_cjs_input_1uw7l3k._.js",
"[project]/turbopack/crates/turbopack-tests/tests/snapshot/import-meta/cjs/input/mod.cjs [test] (ecmascript)", ((__turbopack_context__, module, exports) => {
const __TURBOPACK__import$2e$meta__ = {
var __TURBOPACK__import$2e$meta__ = {
get url () {
return `file://${__turbopack_context__.P("turbopack/crates/turbopack-tests/tests/snapshot/import-meta/cjs/input/mod.cjs")}`;
}
......
......@@ -3,7 +3,7 @@
"use strict";
__turbopack_context__.s([]);
const __TURBOPACK__import$2e$meta__ = {
var __TURBOPACK__import$2e$meta__ = {
get url () {
return `file://${__turbopack_context__.P("turbopack/crates/turbopack-tests/tests/snapshot/import-meta/esm-multiple/input/mod.mjs")}`;
}
......
......@@ -3,7 +3,7 @@
"use strict";
__turbopack_context__.s([]);
const __TURBOPACK__import$2e$meta__ = {
var __TURBOPACK__import$2e$meta__ = {
get url () {
return `file://${__turbopack_context__.P("turbopack/crates/turbopack-tests/tests/snapshot/import-meta/esm-mutable/input/mod.mjs")}`;
}
......
......@@ -3,7 +3,7 @@
"use strict";
__turbopack_context__.s([]);
const __TURBOPACK__import$2e$meta__ = {
var __TURBOPACK__import$2e$meta__ = {
get url () {
return `file://${__turbopack_context__.P("turbopack/crates/turbopack-tests/tests/snapshot/import-meta/esm-object/input/mod.mjs")}`;
}
......
......@@ -3,7 +3,7 @@
"use strict";
__turbopack_context__.s([]);
const __TURBOPACK__import$2e$meta__ = {
var __TURBOPACK__import$2e$meta__ = {
get url () {
return `file://${__turbopack_context__.P("turbopack/crates/turbopack-tests/tests/snapshot/import-meta/esm/input/mod.mjs")}`;
}
......
......@@ -6,7 +6,7 @@ __turbopack_context__.q("/static/asset.1z1abqqd69ldl.txt");}),
"use strict";
__turbopack_context__.s([]);
const __TURBOPACK__import$2e$meta__ = {
var __TURBOPACK__import$2e$meta__ = {
get url () {
return `file://${__turbopack_context__.P("turbopack/crates/turbopack-tests/tests/snapshot/import-meta/url/input/mod.mjs")}`;
}
......
......@@ -22,7 +22,7 @@ __turbopack_context__.s([
"foo",
()=>foo
]);
const __TURBOPACK__import$2e$meta__ = {
var __TURBOPACK__import$2e$meta__ = {
get url () {
return `file://${__turbopack_context__.P("turbopack/crates/turbopack-tests/tests/snapshot/imports/ignore-comments/input/index.js")}`;
}
......
(globalThis["TURBOPACK"] || (globalThis["TURBOPACK"] = [])).push(["output/[root-of-the-server]__0vvunn2._.js",
"[externals]/bun:ffi [external] (bun:ffi, cjs)", ((__turbopack_context__, module, exports) => {
const mod = __turbopack_context__.x("bun:ffi", () => require("bun:ffi"));
var mod = __turbopack_context__.x("bun:ffi", () => require("bun:ffi"));
module.exports = mod;
}),
"[externals]/bun:jsc [external] (bun:jsc, cjs)", ((__turbopack_context__, module, exports) => {
const mod = __turbopack_context__.x("bun:jsc", () => require("bun:jsc"));
var mod = __turbopack_context__.x("bun:jsc", () => require("bun:jsc"));
module.exports = mod;
}),
"[externals]/bun:sqlite [external] (bun:sqlite, cjs)", ((__turbopack_context__, module, exports) => {
const mod = __turbopack_context__.x("bun:sqlite", () => require("bun:sqlite"));
var mod = __turbopack_context__.x("bun:sqlite", () => require("bun:sqlite"));
module.exports = mod;
}),
"[externals]/bun:test [external] (bun:test, cjs)", ((__turbopack_context__, module, exports) => {
const mod = __turbopack_context__.x("bun:test", () => require("bun:test"));
var mod = __turbopack_context__.x("bun:test", () => require("bun:test"));
module.exports = mod;
}),
"[externals]/bun:wrap [external] (bun:wrap, cjs)", ((__turbopack_context__, module, exports) => {
const mod = __turbopack_context__.x("bun:wrap", () => require("bun:wrap"));
var mod = __turbopack_context__.x("bun:wrap", () => require("bun:wrap"));
module.exports = mod;
}),
"[externals]/bun [external] (bun, cjs)", ((__turbopack_context__, module, exports) => {
const mod = __turbopack_context__.x("bun", () => require("bun"));
var mod = __turbopack_context__.x("bun", () => require("bun"));
module.exports = mod;
}),
......
const RUNTIME_PUBLIC_PATH = "output/[turbopack]_runtime.js";
const RELATIVE_ROOT_PATH = "../../../../../../..";
const ASSET_PREFIX = "/";
const WORKER_FORWARDED_GLOBALS = [];
var RUNTIME_PUBLIC_PATH = "output/[turbopack]_runtime.js";
var RELATIVE_ROOT_PATH = "../../../../../../..";
var ASSET_PREFIX = "/";
var WORKER_FORWARDED_GLOBALS = [];
/**
* This file contains runtime types and functions that are shared between all
* TurboPack ECMAScript runtimes.
......
......@@ -7,11 +7,11 @@ if (!Array.isArray(globalThis["TURBOPACK"])) {
return;
}
const CHUNK_BASE_PATH = "";
const RELATIVE_ROOT_PATH = "../../../../../../..";
const RUNTIME_PUBLIC_PATH = "";
const ASSET_SUFFIX = "";
const WORKER_FORWARDED_GLOBALS = [];
var CHUNK_BASE_PATH = "";
var RELATIVE_ROOT_PATH = "../../../../../../..";
var RUNTIME_PUBLIC_PATH = "";
var ASSET_SUFFIX = "";
var WORKER_FORWARDED_GLOBALS = [];
/**
* This file contains runtime types and functions that are shared between all
* TurboPack ECMAScript runtimes.
......@@ -2217,10 +2217,10 @@ function _eval({ code, url, map }) {
// eslint-disable-next-line no-eval
return eval(code);
}
const chunksToRegister = globalThis["TURBOPACK"];
var chunksToRegister = globalThis["TURBOPACK"];
globalThis["TURBOPACK"] = { push: registerChunk };
chunksToRegister.forEach(registerChunk);
const chunkListsToRegister = globalThis["TURBOPACK_CHUNK_LISTS"] || [];
var chunkListsToRegister = globalThis["TURBOPACK_CHUNK_LISTS"] || [];
globalThis["TURBOPACK_CHUNK_LISTS"] = { push: registerChunkList };
chunkListsToRegister.forEach(registerChunkList);
})();
......
......@@ -2,16 +2,16 @@
"output/0rv8_turbopack-tests_tests_snapshot_swc_transforms_preset_env_input_index_04jskxh.js",
{"otherChunks":["output/turbopack_crates_turbopack-tests_tests_snapshot_1v9rcb0._.js"],"runtimeModuleIds":["[project]/turbopack/crates/turbopack-tests/tests/snapshot/swc_transforms/preset_env/input/index.js [test] (ecmascript)"]}
]);
(() => {
(function(){
if (!Array.isArray(globalThis["TURBOPACK"])) {
return;
}
const CHUNK_BASE_PATH = "";
const RELATIVE_ROOT_PATH = "../../../../../../..";
const RUNTIME_PUBLIC_PATH = "";
const ASSET_SUFFIX = "";
const WORKER_FORWARDED_GLOBALS = [];
var CHUNK_BASE_PATH = "";
var RELATIVE_ROOT_PATH = "../../../../../../..";
var RUNTIME_PUBLIC_PATH = "";
var ASSET_SUFFIX = "";
var WORKER_FORWARDED_GLOBALS = [];
/**
* This file contains runtime types and functions that are shared between all
* TurboPack ECMAScript runtimes.
......@@ -1887,7 +1887,7 @@ var BACKEND;
return fetch(getChunkRelativeUrl(wasmChunkPath));
}
})();
const chunksToRegister = globalThis["TURBOPACK"];
var chunksToRegister = globalThis["TURBOPACK"];
globalThis["TURBOPACK"] = { push: registerChunk };
chunksToRegister.forEach(registerChunk);
})();
......
(globalThis["TURBOPACK"] || (globalThis["TURBOPACK"] = [])).push(["output/turbopack_crates_turbopack-tests_tests_snapshot_1v9rcb0._.js",
"[project]/turbopack/crates/turbopack-tests/tests/snapshot/swc_transforms/preset_env/input/index.js [test] (ecmascript)", ((__turbopack_context__, module, exports) => {
"[project]/turbopack/crates/turbopack-tests/tests/snapshot/swc_transforms/preset_env/input/index.js [test] (ecmascript)", (function(__turbopack_context__){
"use strict";
var _class_call_check = __turbopack_context__.r("[project]/turbopack/crates/turbopack-tests/tests/snapshot/node_modules/@swc/helpers/_/_class_call_check.js [test] (ecmascript)");
__turbopack_context__.s([
"default",
()=>__TURBOPACK__default__export__
]);
var __TURBOPACK__imported__module__$5b$project$5d2f$turbopack$2f$crates$2f$turbopack$2d$tests$2f$tests$2f$snapshot$2f$node_modules$2f40$swc$2f$helpers$2f$_$2f$_class_call_check$2e$js__$5b$test$5d$__$28$ecmascript$29$__ = __turbopack_context__.i("[project]/turbopack/crates/turbopack-tests/tests/snapshot/node_modules/@swc/helpers/_/_class_call_check.js [test] (ecmascript)");
;
var Foo = function Foo() {
"use strict";
_class_call_check._(this, Foo);
(0, __TURBOPACK__imported__module__$5b$project$5d2f$turbopack$2f$crates$2f$turbopack$2d$tests$2f$tests$2f$snapshot$2f$node_modules$2f40$swc$2f$helpers$2f$_$2f$_class_call_check$2e$js__$5b$test$5d$__$28$ecmascript$29$__["_"])(this, Foo);
};
console.log(Foo, [].includes('foo'));
var __TURBOPACK__default__export__ = 123;
}),
"[project]/turbopack/crates/turbopack-tests/tests/snapshot/node_modules/@swc/helpers/_/_class_call_check.js [test] (ecmascript)", ((__turbopack_context__) => {
"[project]/turbopack/crates/turbopack-tests/tests/snapshot/node_modules/@swc/helpers/_/_class_call_check.js [test] (ecmascript)", (function(__turbopack_context__){
"use strict";
__turbopack_context__.s([
......
......@@ -2,6 +2,6 @@
"version": 3,
"sources": [],
"sections": [
{"offset": {"line": 3, "column": 0}, "map": {"version":3,"sources":["turbopack:///[project]/turbopack/crates/turbopack-tests/tests/snapshot/swc_transforms/preset_env/input/index.js"],"sourcesContent":["class Foo {}\n\nconsole.log(Foo, [].includes('foo'))\n"],"names":["Foo","console","log","includes"],"mappings":";AAAA,IAAA,AAAMA,MAAN,SAAMA;;8BAAAA;;AAENC,QAAQC,GAAG,CAACF,KAAK,EAAE,CAACG,QAAQ,CAAC"}},
{"offset": {"line": 13, "column": 0}, "map": {"version":3,"sources":["turbopack:///[project]/turbopack/crates/turbopack-tests/tests/snapshot/node_modules/@swc/helpers/_/_class_call_check.js"],"sourcesContent":["export function _() {\n return 'purposefully empty stub for @swc/helpers/_/_class_call_check.js'\n}\n"],"names":["_"],"mappings":";;;;AAAO,SAASA;IACd,OAAO;AACT","ignoreList":[0]}}]
{"offset": {"line": 4, "column": 0}, "map": {"version":3,"sources":["turbopack:///[project]/turbopack/crates/turbopack-tests/tests/snapshot/swc_transforms/preset_env/input/index.js"],"sourcesContent":["class Foo {}\n\nconsole.log(Foo, [].includes('foo'))\n\nexport default 123\n"],"names":["Foo","console","log","includes"],"mappings":";;;;;;AAAA,IAAA,AAAMA,MAAN,SAAMA;;2OAAAA;;AAENC,QAAQC,GAAG,CAACF,KAAK,EAAE,CAACG,QAAQ,CAAC;qCAEd"}},
{"offset": {"line": 20, "column": 0}, "map": {"version":3,"sources":["turbopack:///[project]/turbopack/crates/turbopack-tests/tests/snapshot/node_modules/@swc/helpers/_/_class_call_check.js"],"sourcesContent":["export function _() {\n return 'purposefully empty stub for @swc/helpers/_/_class_call_check.js'\n}\n"],"names":["_"],"mappings":";;;;AAAO,SAASA;IACd,OAAO;AACT","ignoreList":[0]}}]
}
\ No newline at end of file
......@@ -7,11 +7,11 @@ if (!Array.isArray(globalThis["TURBOPACK"])) {
return;
}
const CHUNK_BASE_PATH = "";
const RELATIVE_ROOT_PATH = "../../../../../../..";
const RUNTIME_PUBLIC_PATH = "";
const ASSET_SUFFIX = "";
const WORKER_FORWARDED_GLOBALS = [];
var CHUNK_BASE_PATH = "";
var RELATIVE_ROOT_PATH = "../../../../../../..";
var RUNTIME_PUBLIC_PATH = "";
var ASSET_SUFFIX = "";
var WORKER_FORWARDED_GLOBALS = [];
/**
* This file contains runtime types and functions that are shared between all
* TurboPack ECMAScript runtimes.
......@@ -2217,10 +2217,10 @@ function _eval({ code, url, map }) {
// eslint-disable-next-line no-eval
return eval(code);
}
const chunksToRegister = globalThis["TURBOPACK"];
var chunksToRegister = globalThis["TURBOPACK"];
globalThis["TURBOPACK"] = { push: registerChunk };
chunksToRegister.forEach(registerChunk);
const chunkListsToRegister = globalThis["TURBOPACK_CHUNK_LISTS"] || [];
var chunkListsToRegister = globalThis["TURBOPACK_CHUNK_LISTS"] || [];
globalThis["TURBOPACK_CHUNK_LISTS"] = { push: registerChunkList };
chunkListsToRegister.forEach(registerChunkList);
})();
......
......@@ -7,11 +7,11 @@ if (!Array.isArray(globalThis["TURBOPACK"])) {
return;
}
const CHUNK_BASE_PATH = "";
const RELATIVE_ROOT_PATH = "../../../../../../..";
const RUNTIME_PUBLIC_PATH = "";
const ASSET_SUFFIX = "";
const WORKER_FORWARDED_GLOBALS = [];
var CHUNK_BASE_PATH = "";
var RELATIVE_ROOT_PATH = "../../../../../../..";
var RUNTIME_PUBLIC_PATH = "";
var ASSET_SUFFIX = "";
var WORKER_FORWARDED_GLOBALS = [];
/**
* This file contains runtime types and functions that are shared between all
* TurboPack ECMAScript runtimes.
......@@ -2217,10 +2217,10 @@ function _eval({ code, url, map }) {
// eslint-disable-next-line no-eval
return eval(code);
}
const chunksToRegister = globalThis["TURBOPACK"];
var chunksToRegister = globalThis["TURBOPACK"];
globalThis["TURBOPACK"] = { push: registerChunk };
chunksToRegister.forEach(registerChunk);
const chunkListsToRegister = globalThis["TURBOPACK_CHUNK_LISTS"] || [];
var chunkListsToRegister = globalThis["TURBOPACK_CHUNK_LISTS"] || [];
globalThis["TURBOPACK_CHUNK_LISTS"] = { push: registerChunkList };
chunkListsToRegister.forEach(registerChunkList);
})();
......
......@@ -10,7 +10,7 @@ __turbopack_context__.v(function(Ctor, opts) {
}),
"[project]/turbopack/crates/turbopack-tests/tests/snapshot/workers/basic/input/index.js [test] (ecmascript)", ((__turbopack_context__, module, exports) => {
const __TURBOPACK__import$2e$meta__ = {
var __TURBOPACK__import$2e$meta__ = {
get url () {
return `file://${__turbopack_context__.P("turbopack/crates/turbopack-tests/tests/snapshot/workers/basic/input/index.js")}`;
}
......
......@@ -7,11 +7,11 @@ if (!Array.isArray(globalThis["TURBOPACK"])) {
return;
}
const CHUNK_BASE_PATH = "";
const RELATIVE_ROOT_PATH = "../../../../../../..";
const RUNTIME_PUBLIC_PATH = "";
const ASSET_SUFFIX = "";
const WORKER_FORWARDED_GLOBALS = [];
var CHUNK_BASE_PATH = "";
var RELATIVE_ROOT_PATH = "../../../../../../..";
var RUNTIME_PUBLIC_PATH = "";
var ASSET_SUFFIX = "";
var WORKER_FORWARDED_GLOBALS = [];
/**
* This file contains runtime types and functions that are shared between all
* TurboPack ECMAScript runtimes.
......@@ -2217,10 +2217,10 @@ function _eval({ code, url, map }) {
// eslint-disable-next-line no-eval
return eval(code);
}
const chunksToRegister = globalThis["TURBOPACK"];
var chunksToRegister = globalThis["TURBOPACK"];
globalThis["TURBOPACK"] = { push: registerChunk };
chunksToRegister.forEach(registerChunk);
const chunkListsToRegister = globalThis["TURBOPACK_CHUNK_LISTS"] || [];
var chunkListsToRegister = globalThis["TURBOPACK_CHUNK_LISTS"] || [];
globalThis["TURBOPACK_CHUNK_LISTS"] = { push: registerChunkList };
chunkListsToRegister.forEach(registerChunkList);
})();
......
......@@ -7,11 +7,11 @@ if (!Array.isArray(globalThis["TURBOPACK"])) {
return;
}
const CHUNK_BASE_PATH = "";
const RELATIVE_ROOT_PATH = "../../../../../../..";
const RUNTIME_PUBLIC_PATH = "";
const ASSET_SUFFIX = "";
const WORKER_FORWARDED_GLOBALS = [];
var CHUNK_BASE_PATH = "";
var RELATIVE_ROOT_PATH = "../../../../../../..";
var RUNTIME_PUBLIC_PATH = "";
var ASSET_SUFFIX = "";
var WORKER_FORWARDED_GLOBALS = [];
/**
* This file contains runtime types and functions that are shared between all
* TurboPack ECMAScript runtimes.
......@@ -2217,10 +2217,10 @@ function _eval({ code, url, map }) {
// eslint-disable-next-line no-eval
return eval(code);
}
const chunksToRegister = globalThis["TURBOPACK"];
var chunksToRegister = globalThis["TURBOPACK"];
globalThis["TURBOPACK"] = { push: registerChunk };
chunksToRegister.forEach(registerChunk);
const chunkListsToRegister = globalThis["TURBOPACK_CHUNK_LISTS"] || [];
var chunkListsToRegister = globalThis["TURBOPACK_CHUNK_LISTS"] || [];
globalThis["TURBOPACK_CHUNK_LISTS"] = { push: registerChunkList };
chunkListsToRegister.forEach(registerChunkList);
})();
......
......@@ -10,7 +10,7 @@ __turbopack_context__.v(function(Ctor, opts) {
}),
"[project]/turbopack/crates/turbopack-tests/tests/snapshot/workers/shared/input/index.js [test] (ecmascript)", ((__turbopack_context__, module, exports) => {
const __TURBOPACK__import$2e$meta__ = {
var __TURBOPACK__import$2e$meta__ = {
get url () {
return `file://${__turbopack_context__.P("turbopack/crates/turbopack-tests/tests/snapshot/workers/shared/input/index.js")}`;
}
......
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