Unverified Commit 39f5d797 authored by Tobias Koppers's avatar Tobias Koppers Committed by GitHub

Optimize strict module factory chunks (#98421)

### What?

Reduce Turbopack ECMAScript chunk size by emitting strict module
factories in a shared strict-mode scope instead of repeating `"use
strict"` in every factory.

The chunk format now chooses among the existing flat representation, a
mixed representation with flat non-strict factories plus a nested strict
array, and an all-strict representation that wraps the complete chunk in
a strict IIFE. Each factory is generated through the existing single
code path; the production minimizer removes its redundant directive when
the factory is created inside a strict wrapper. Browser and Node.js
emitters share the mode selection and serialization implementation,
while the runtime remains compatible with the existing flat format.

### Why?

ECMAScript modules are always strict, so large chunks currently repeat
the same directive across many factories. Moving strictness to the scope
where those factories are created removes redundant bytes without
copying arrays or changing strict/sloppy execution semantics.

For `bench/basic-app`, this reduces total raw JavaScript by 16,831 bytes
(0.161%). Partitioning factories changes compression behavior, resulting
in a 1,286-byte (0.051%) gzip increase across all JavaScript; format
selection therefore remains based on emitted raw bytes.

### How?

- Determine each chunk item's strictness from the already-collected
chunk metadata.
- Generate every factory once with its normal directive, then rely on
the minimizer to remove redundant directives inside strict wrappers.
- Compare the expected minified directive bytes removed with the exact
wrapper bytes added and keep small chunks in the existing flat format.
- Keep non-strict factories flat in mixed chunks and append strict
factories as an array produced by a strict IIFE.
- Wrap the complete registration/export in a strict IIFE when every
factory is strict, keeping those factories flat and avoiding a nested
array entirely.
- Use the shorter arrow IIFE when the target supports it, with a
function IIFE fallback for older targets.
- Preserve source-map sections, scope-hoisted module IDs, factory
naming, and ordering within each partition.
- Add focused strict, sloppy, mixed, all-strict, old-target, and
below-threshold coverage and update affected Turbopack snapshots.

### Verification

- `cargo nextest run -p turbopack-tests -E 'test(snapshot)'`
- `cargo clippy -p turbopack-ecmascript -p turbopack-browser -p
turbopack-nodejs`
- `pnpm build-all`
- `pnpm --dir turbopack/crates/turbopack-ecmascript-runtime/js
check:nodejs`
- `bench/basic-app` production Turbopack build, repeated to confirm
deterministic size totals

<!-- NEXT_JS_LLM -->


<!-- fleet 528ffe69-eb27-466b-a132-842272a782cf -->

---------
Co-authored-by: 's avatarvercel-fleet-prod[bot] <318278635+vercel-fleet-prod[bot]@users.noreply.github.com>
Co-authored-by: 's avatarTobias Koppers <1365881+sokra@users.noreply.github.com>
parent df1502c7
...@@ -634,10 +634,10 @@ async fn module_hash( ...@@ -634,10 +634,10 @@ async fn module_hash(
} else { } else {
None None
}; };
let code = chunk_item.code(async_info); let factory = chunk_item.code(async_info).await?;
RcStr::from(deterministic_hash( RcStr::from(deterministic_hash(
"", "",
(ident_str, code.source_code_hash().await?), (ident_str, factory.code.to_code().source_code_hash().await?),
HashAlgorithm::Xxh3Hash128Hex, HashAlgorithm::Xxh3Hash128Hex,
)) ))
} else { } else {
......
...@@ -14,7 +14,10 @@ use turbopack_core::{ ...@@ -14,7 +14,10 @@ use turbopack_core::{
version::{MergeableVersionedContent, Version, VersionedContent, VersionedContentMerger}, version::{MergeableVersionedContent, Version, VersionedContent, VersionedContentMerger},
}; };
use turbopack_ecmascript::{ use turbopack_ecmascript::{
chunk::{EcmascriptChunkContent, EcmascriptChunkContentEntries}, chunk::{
EcmascriptChunkContent, EcmascriptChunkContentEntries, strict_chunk_wrapper,
strict_factory_mode, write_module_factories,
},
hmr::{ hmr::{
EcmascriptHmrChunkContent, merger::EcmascriptChunkContentMerger, EcmascriptHmrChunkContent, merger::EcmascriptChunkContentMerger,
version::EcmascriptChunkVersion, version::EcmascriptChunkVersion,
...@@ -85,6 +88,22 @@ impl EcmascriptBrowserChunkContent { ...@@ -85,6 +88,22 @@ impl EcmascriptBrowserChunkContent {
*this.chunking_context.debug_ids_enabled().await?, *this.chunking_context.debug_ids_enabled().await?,
); );
let supports_arrow_functions = *this
.chunking_context
.environment()
.runtime_versions()
.supports_arrow_functions()
.await?;
let content = this.content.await?;
let chunk_items = content.chunk_item_code_module_ids_and_paths().await?;
let strict_factory_mode = strict_factory_mode(&chunk_items, supports_arrow_functions);
let strict_chunk_wrapper =
strict_chunk_wrapper(strict_factory_mode, supports_arrow_functions);
if let Some((prefix, _)) = strict_chunk_wrapper {
code += prefix;
}
// When a chunk is executed, it will either register itself with the current // When a chunk is executed, it will either register itself with the current
// instance of the runtime, or it will push itself onto the list of pending // instance of the runtime, or it will push itself onto the list of pending
// chunks (using the configured chunk loading global variable). // chunks (using the configured chunk loading global variable).
...@@ -100,17 +119,18 @@ impl EcmascriptBrowserChunkContent { ...@@ -100,17 +119,18 @@ impl EcmascriptBrowserChunkContent {
r#"(globalThis[{chunk_loading_global}] || (globalThis[{chunk_loading_global}] = [])).push([{script_or_path},"#, r#"(globalThis[{chunk_loading_global}] || (globalThis[{chunk_loading_global}] = [])).push([{script_or_path},"#,
chunk_loading_global = StringifyJs(&chunk_loading_global), chunk_loading_global = StringifyJs(&chunk_loading_global),
)?; )?;
write_module_factories(
&mut code,
&chunk_items,
strict_factory_mode,
supports_arrow_functions,
)?;
write!(code, "\n]);")?;
let content = this.content.await?; if let Some((_, suffix)) = strict_chunk_wrapper {
let chunk_items = content.chunk_item_code_module_ids_and_paths().await?; code += suffix;
for (id, item_code, _) in &chunk_items {
write!(code, "\n{}, ", StringifyJs(id))?;
code.push_code(item_code);
write!(code, ",")?;
} }
write!(code, "\n]);")?;
let mut code = code.build(); let mut code = code.build();
if let MinifyType::Minify { mangle } = *this.chunking_context.minify_type().await? { if let MinifyType::Minify { mangle } = *this.chunking_context.minify_type().await? {
......
...@@ -88,11 +88,15 @@ type ModuleCache<M> = Record<ModuleId, M> ...@@ -88,11 +88,15 @@ type ModuleCache<M> = Record<ModuleId, M>
// TODO properly type values here // TODO properly type values here
type ModuleFactories = Map<ModuleId, Function> type ModuleFactories = Map<ModuleId, Function>
/** /**
* This is an alternating, non-empty arrow of module factory functions and module ids * This is an alternating, non-empty array of module factory functions and module ids
* `[id1, id2..., factory1, id3, factory2, id4, id5, factory3]` * `[id1, id2..., factory1, id3, factory2, id4, id5, factory3]`
* There can be multiple ids to support scope hoisted merged modules * There can be multiple ids to support scope hoisted merged modules.
* The strict mode module factories of a chunk can be prepended as a nested array,
* which the chunk creates inside a `"use strict"` IIFE.
*/ */
type CompressedModuleFactories = Array<ModuleId | Function> type CompressedModuleFactories = Array<
ModuleId | Function | Array<ModuleId | Function>
>
type RelativeURL = (inputUrl: string) => void type RelativeURL = (inputUrl: string) => void
type ResolvePathFromModule = (moduleId: string) => string type ResolvePathFromModule = (moduleId: string) => string
......
...@@ -578,12 +578,9 @@ function getChunkPath(chunkData: ChunkData): ChunkPath { ...@@ -578,12 +578,9 @@ function getChunkPath(chunkData: ChunkData): ChunkPath {
return typeof chunkData === 'string' ? chunkData : chunkData.path return typeof chunkData === 'string' ? chunkData : chunkData.path
} }
// Load the CompressedmoduleFactories of a chunk into the `moduleFactories` Map. // Load the CompressedModuleFactories of a chunk into the `moduleFactories` Map.
// The CompressedModuleFactories format is // The flat format alternates one or more module IDs with their factory function.
// - 1 or more module ids // Strict factories can be prepended as a nested array.
// - a module factory function
// So walking this is a little complex but the flat structure is also fast to
// traverse, we can use `typeof` operators to distinguish the two cases.
function installCompressedModuleFactories( function installCompressedModuleFactories(
chunkModules: CompressedModuleFactories, chunkModules: CompressedModuleFactories,
offset: number, offset: number,
...@@ -591,6 +588,16 @@ function installCompressedModuleFactories( ...@@ -591,6 +588,16 @@ function installCompressedModuleFactories(
newModuleId?: (id: ModuleId) => void newModuleId?: (id: ModuleId) => void
) { ) {
let i = offset let i = offset
const strictFactories = chunkModules[i]
if (Array.isArray(strictFactories)) {
installCompressedModuleFactories(
strictFactories,
0,
moduleFactories,
newModuleId
)
i++
}
while (i < chunkModules.length) { while (i < chunkModules.length) {
let end = i + 1 let end = i + 1
// Find our factory function // Find our factory function
...@@ -634,7 +641,7 @@ function installCompressedModuleFactories( ...@@ -634,7 +641,7 @@ function installCompressedModuleFactories(
newModuleId?.(id) newModuleId?.(id)
} }
} }
i = end + 1 // end is pointing at the last factory advance to the next id or the end of the array. i = end + 1
} }
} }
......
...@@ -2,7 +2,10 @@ use anyhow::Result; ...@@ -2,7 +2,10 @@ use anyhow::Result;
use rustc_hash::FxHashMap; use rustc_hash::FxHashMap;
use smallvec::{SmallVec, smallvec}; use smallvec::{SmallVec, smallvec};
use turbo_rcstr::RcStr; use turbo_rcstr::RcStr;
use turbo_tasks::{ReadRef, TryJoinIterExt, ValueToString, Vc}; use turbo_tasks::{
NonLocalValue, ReadRef, TryJoinIterExt, ValueToString, Vc, debug::ValueDebugFormat,
trace::TraceRawVcs,
};
use turbopack_core::{ use turbopack_core::{
chunk::{ChunkItem, ChunkItemExt, ModuleId}, chunk::{ChunkItem, ChunkItemExt, ModuleId},
code_builder::Code, code_builder::Code,
...@@ -13,8 +16,31 @@ use crate::chunk::{ ...@@ -13,8 +16,31 @@ use crate::chunk::{
EcmascriptChunkItemWithAsyncInfo, EcmascriptChunkItemWithAsyncInfo,
}; };
async fn code_module_id_and_path(
item: &EcmascriptChunkItemWithAsyncInfo,
) -> Result<CodeModuleIdAndPath> {
let factory = item
.chunk_item
.code(item.async_info.map(|info| *info))
.await?;
Ok(CodeModuleIdAndPath {
id: item.chunk_item.id().await?,
code: factory.code.to_code().await?,
path: item.chunk_item.asset_ident().to_string().owned().await?,
strict: factory.strict,
})
}
#[derive(Clone, PartialEq, Eq, TraceRawVcs, ValueDebugFormat, NonLocalValue)]
pub struct CodeModuleIdAndPath {
pub id: ModuleId,
pub code: ReadRef<Code>,
pub path: RcStr,
pub strict: bool,
}
#[turbo_tasks::value(transparent, serialization = "skip")] #[turbo_tasks::value(transparent, serialization = "skip")]
pub struct CodeModuleIdsAndPaths(SmallVec<[(ModuleId, ReadRef<Code>, RcStr); 1]>); pub struct CodeModuleIdsAndPaths(SmallVec<[CodeModuleIdAndPath; 1]>);
#[turbo_tasks::value(transparent, serialization = "skip")] #[turbo_tasks::value(transparent, serialization = "skip")]
pub struct BatchGroupCodeModuleIdsAndPaths( pub struct BatchGroupCodeModuleIdsAndPaths(
...@@ -48,29 +74,14 @@ pub async fn item_code_module_ids_and_paths( ...@@ -48,29 +74,14 @@ pub async fn item_code_module_ids_and_paths(
item: EcmascriptChunkItemOrBatchWithAsyncInfo, item: EcmascriptChunkItemOrBatchWithAsyncInfo,
) -> Result<Vc<CodeModuleIdsAndPaths>> { ) -> Result<Vc<CodeModuleIdsAndPaths>> {
Ok(Vc::cell(match item { Ok(Vc::cell(match item {
EcmascriptChunkItemOrBatchWithAsyncInfo::ChunkItem(EcmascriptChunkItemWithAsyncInfo { EcmascriptChunkItemOrBatchWithAsyncInfo::ChunkItem(item) => {
chunk_item, smallvec![code_module_id_and_path(&item).await?]
async_info,
..
}) => {
let id = chunk_item.id().await?;
let code = chunk_item.code(async_info.map(|info| *info));
let path = chunk_item.asset_ident().to_string().owned().await?;
smallvec![(id, code.await?, path)]
} }
EcmascriptChunkItemOrBatchWithAsyncInfo::Batch(batch) => batch EcmascriptChunkItemOrBatchWithAsyncInfo::Batch(batch) => batch
.await? .await?
.chunk_items .chunk_items
.iter() .iter()
.map(async |item| { .map(code_module_id_and_path)
Ok((
item.chunk_item.id().await?,
item.chunk_item
.code(item.async_info.map(|info| *info))
.await?,
item.chunk_item.asset_ident().to_string().owned().await?,
))
})
.try_join() .try_join()
.await? .await?
.into(), .into(),
......
...@@ -2,14 +2,11 @@ use std::future::IntoFuture; ...@@ -2,14 +2,11 @@ use std::future::IntoFuture;
use anyhow::Result; use anyhow::Result;
use either::Either; use either::Either;
use turbo_rcstr::RcStr; use turbo_tasks::{ResolvedVc, TryJoinIterExt, Vc};
use turbo_tasks::{ReadRef, ResolvedVc, TryJoinIterExt, Vc}; use turbopack_core::chunk::{ChunkItem, ChunkItems, batch_info};
use turbopack_core::{
chunk::{ChunkItem, ChunkItems, ModuleId, batch_info},
code_builder::Code,
};
use crate::chunk::{ use crate::chunk::{
CodeModuleIdAndPath,
batch::{EcmascriptChunkItemBatchGroup, EcmascriptChunkItemOrBatchWithAsyncInfo}, batch::{EcmascriptChunkItemBatchGroup, EcmascriptChunkItemOrBatchWithAsyncInfo},
batch_group_code_module_ids_and_paths, item_code_module_ids_and_paths, batch_group_code_module_ids_and_paths, item_code_module_ids_and_paths,
}; };
...@@ -52,9 +49,7 @@ impl EcmascriptChunkContent { ...@@ -52,9 +49,7 @@ impl EcmascriptChunkContent {
} }
impl EcmascriptChunkContent { impl EcmascriptChunkContent {
pub async fn chunk_item_code_module_ids_and_paths( pub async fn chunk_item_code_module_ids_and_paths(&self) -> Result<Vec<CodeModuleIdAndPath>> {
&self,
) -> Result<Vec<(ModuleId, ReadRef<Code>, RcStr)>> {
let chunk_item_groups = batch_info( let chunk_item_groups = batch_info(
&self.batch_groups, &self.batch_groups,
&self.chunk_items, &self.chunk_items,
...@@ -68,8 +63,7 @@ impl EcmascriptChunkContent { ...@@ -68,8 +63,7 @@ impl EcmascriptChunkContent {
.collect::<Vec<_>>(); .collect::<Vec<_>>();
// Sort all items by their module path so that similar modules stay // Sort all items by their module path so that similar modules stay
// together and the chunks gzip better. // together and the chunks gzip better.
chunk_items chunk_items.sort_by(|a, b| (&a.path, &a.id).cmp(&(&b.path, &b.id)));
.sort_by(|(a_id, _, a_path), (b_id, _, b_path)| (a_path, a_id).cmp(&(b_path, b_id)));
Ok(chunk_items) Ok(chunk_items)
} }
} }
...@@ -29,7 +29,8 @@ impl EcmascriptChunkContentEntry { ...@@ -29,7 +29,8 @@ impl EcmascriptChunkContentEntry {
chunk_item: ResolvedVc<Box<dyn EcmascriptChunkItem>>, chunk_item: ResolvedVc<Box<dyn EcmascriptChunkItem>>,
async_module_info: Option<Vc<AsyncModuleInfo>>, async_module_info: Option<Vc<AsyncModuleInfo>>,
) -> Result<Self> { ) -> Result<Self> {
let code = chunk_item.code(async_module_info).to_resolved().await?; let factory = chunk_item.code(async_module_info).await?;
let code = factory.code.to_code().to_resolved().await?;
Ok(EcmascriptChunkContentEntry { Ok(EcmascriptChunkContentEntry {
code, code,
hash: code.source_code_hash().to_resolved().await?, hash: code.source_code_hash().to_resolved().await?,
......
use std::io::Write;
use anyhow::Result;
use turbopack_core::code_builder::CodeBuilder;
use crate::{chunk::CodeModuleIdAndPath, utils::StringifyJs};
const MIXED_ARROW_PREFIX: &str = "\n(()=>{\"use strict\";return[";
const MIXED_FUNCTION_PREFIX: &str = "\n(function(){\"use strict\";return[";
const MIXED_SUFFIX: &str = "\n]})(),";
const ALL_STRICT_ARROW_PREFIX: &str = "(()=>{\"use strict\";";
const ALL_STRICT_FUNCTION_PREFIX: &str = "(function(){\"use strict\";";
const ALL_STRICT_SUFFIX: &str = "})()";
/// Minimum number of strict factories that makes hoisting the directive worth its wrapper.
/// Derived from the minified wrapper sizes and pinned by `strict_thresholds_match_wrapper_sizes`.
/// The mixed wrappers differ in length but land on the same minimum; the all-strict ones do not,
/// which is why arrow support still selects between two constants here.
const MIXED_STRICT_THRESHOLD: usize = 3;
const ALL_STRICT_ARROW_THRESHOLD: usize = 2;
const ALL_STRICT_FUNCTION_THRESHOLD: usize = 3;
#[derive(Clone, Copy, PartialEq, Eq)]
pub enum StrictFactoryMode {
Flat,
Mixed,
AllStrict,
}
/// Selects the smallest expected minified representation for this chunk's mix of module factories.
pub fn strict_factory_mode(
chunk_items: &[CodeModuleIdAndPath],
supports_arrow_functions: bool,
) -> StrictFactoryMode {
let mut strict = 0;
let mut non_strict = 0;
for item in chunk_items {
if item.strict {
strict += 1;
} else {
non_strict += 1;
}
}
if strict == 0 {
return StrictFactoryMode::Flat;
}
let mode = if non_strict == 0 {
StrictFactoryMode::AllStrict
} else {
StrictFactoryMode::Mixed
};
let threshold = match (mode, supports_arrow_functions) {
(StrictFactoryMode::Mixed, _) => MIXED_STRICT_THRESHOLD,
(StrictFactoryMode::AllStrict, true) => ALL_STRICT_ARROW_THRESHOLD,
(StrictFactoryMode::AllStrict, false) => ALL_STRICT_FUNCTION_THRESHOLD,
(StrictFactoryMode::Flat, _) => unreachable!(),
};
if strict >= threshold {
mode
} else {
StrictFactoryMode::Flat
}
}
/// Code written around the whole chunk in the all-strict case.
pub fn strict_chunk_wrapper(
mode: StrictFactoryMode,
supports_arrow_functions: bool,
) -> Option<(&'static str, &'static str)> {
(mode == StrictFactoryMode::AllStrict).then(|| {
(
all_strict_prefix(supports_arrow_functions),
ALL_STRICT_SUFFIX,
)
})
}
const fn mixed_prefix(supports_arrow_functions: bool) -> &'static str {
if supports_arrow_functions {
MIXED_ARROW_PREFIX
} else {
MIXED_FUNCTION_PREFIX
}
}
const fn all_strict_prefix(supports_arrow_functions: bool) -> &'static str {
if supports_arrow_functions {
ALL_STRICT_ARROW_PREFIX
} else {
ALL_STRICT_FUNCTION_PREFIX
}
}
/// Writes flat factories, with a strict IIFE prepended to the non-strict factories in mixed chunks.
pub fn write_module_factories(
code: &mut CodeBuilder,
chunk_items: &[CodeModuleIdAndPath],
mode: StrictFactoryMode,
supports_arrow_functions: bool,
) -> Result<()> {
if mode == StrictFactoryMode::Mixed {
*code += mixed_prefix(supports_arrow_functions);
write_factories(code, chunk_items, |strict| strict)?;
*code += MIXED_SUFFIX;
write_factories(code, chunk_items, |strict| !strict)?;
} else {
write_factories(code, chunk_items, |_| true)?;
}
Ok(())
}
fn write_factories(
code: &mut CodeBuilder,
chunk_items: &[CodeModuleIdAndPath],
include: impl Fn(bool) -> bool,
) -> Result<()> {
for item in chunk_items {
if include(item.strict) {
write!(code, "\n{}, ", StringifyJs(&item.id))?;
code.push_code(&item.code);
write!(code, ",")?;
}
}
Ok(())
}
#[cfg(test)]
mod tests {
use super::*;
/// Minified length of the `"use strict";` directive that
/// `EcmascriptChunkItemContent::module_factory` writes into every strict factory, and that
/// the minimizer removes again inside a strict wrapper. The trailing newlines the factory
/// writes do not survive minification, so they are not counted. Kept here because only these
/// assertions need it.
const STRICT_MODE_DIRECTIVE_LEN: usize = "\"use strict\";".len();
fn minified_len(wrapper: &str) -> usize {
// Formatting whitespace is only added at line boundaries. Trim each line rather than all
// whitespace so the space inside the `"use strict"` string literal is preserved.
wrapper.lines().map(str::trim).map(str::len).sum()
}
/// `threshold` must be the smallest factory count worth grouping: one below it the directives
/// do not outweigh the wrapper, at the threshold they do.
fn assert_threshold(threshold: usize, wrapper: &str) {
let wrapper_len = minified_len(wrapper);
assert!((threshold - 1) * STRICT_MODE_DIRECTIVE_LEN <= wrapper_len);
assert!(threshold * STRICT_MODE_DIRECTIVE_LEN > wrapper_len);
}
#[test]
fn strict_thresholds_match_wrapper_sizes() {
assert_threshold(
MIXED_STRICT_THRESHOLD,
&format!("{MIXED_ARROW_PREFIX}{MIXED_SUFFIX}"),
);
assert_threshold(
MIXED_STRICT_THRESHOLD,
&format!("{MIXED_FUNCTION_PREFIX}{MIXED_SUFFIX}"),
);
assert_threshold(
ALL_STRICT_ARROW_THRESHOLD,
&format!("{ALL_STRICT_ARROW_PREFIX}{ALL_STRICT_SUFFIX}"),
);
assert_threshold(
ALL_STRICT_FUNCTION_THRESHOLD,
&format!("{ALL_STRICT_FUNCTION_PREFIX}{ALL_STRICT_SUFFIX}"),
);
}
}
...@@ -6,7 +6,8 @@ use bincode::{Decode, Encode}; ...@@ -6,7 +6,8 @@ use bincode::{Decode, Encode};
use smallvec::SmallVec; use smallvec::SmallVec;
use turbo_rcstr::{RcStr, rcstr}; use turbo_rcstr::{RcStr, rcstr};
use turbo_tasks::{ use turbo_tasks::{
NonLocalValue, PrettyPrintError, ResolvedVc, Upcast, ValueToString, Vc, trace::TraceRawVcs, NonLocalValue, PrettyPrintError, ReadRef, ResolvedVc, Upcast, ValueToString, Vc,
trace::TraceRawVcs,
}; };
use turbo_tasks_fs::{FileSystemPath, rope::Rope}; use turbo_tasks_fs::{FileSystemPath, rope::Rope};
use turbopack_core::{ use turbopack_core::{
...@@ -14,7 +15,7 @@ use turbopack_core::{ ...@@ -14,7 +15,7 @@ use turbopack_core::{
AsyncModuleInfo, ChunkItem, ChunkItemWithAsyncModuleInfo, ChunkType, ChunkingContext, AsyncModuleInfo, ChunkItem, ChunkItemWithAsyncModuleInfo, ChunkType, ChunkingContext,
ChunkingContextExt, ModuleId, SourceMapSourceType, ChunkingContextExt, ModuleId, SourceMapSourceType,
}, },
code_builder::{Code, CodeBuilder, PersistedCode}, code_builder::{CodeBuilder, PersistedCode},
ident::AssetIdent, ident::AssetIdent,
issue::{IssueExt, IssueSeverity, StyledString, code_gen::CodeGenerationIssue}, issue::{IssueExt, IssueSeverity, StyledString, code_gen::CodeGenerationIssue},
module::Module, module::Module,
...@@ -256,9 +257,18 @@ pub trait EcmascriptChunkItem: ChunkItem + OutputAssetsReference { ...@@ -256,9 +257,18 @@ pub trait EcmascriptChunkItem: ChunkItem + OutputAssetsReference {
) -> Result<Vc<EcmascriptChunkItemContent>>; ) -> Result<Vc<EcmascriptChunkItemContent>>;
} }
#[turbo_tasks::value]
pub struct EcmascriptChunkItemCode {
pub code: ResolvedVc<PersistedCode>,
pub strict: bool,
}
pub trait EcmascriptChunkItemExt { pub trait EcmascriptChunkItemExt {
/// Generates the module factory for this chunk item. /// Generates the module factory and returns whether it must run in strict mode.
fn code(self: Vc<Self>, async_module_info: Option<Vc<AsyncModuleInfo>>) -> Vc<Code>; fn code(
self: Vc<Self>,
async_module_info: Option<Vc<AsyncModuleInfo>>,
) -> Vc<EcmascriptChunkItemCode>;
} }
impl<T> EcmascriptChunkItemExt for T impl<T> EcmascriptChunkItemExt for T
...@@ -266,9 +276,11 @@ where ...@@ -266,9 +276,11 @@ where
T: Upcast<Box<dyn EcmascriptChunkItem>>, T: Upcast<Box<dyn EcmascriptChunkItem>>,
{ {
/// Generates the module factory for this chunk item. /// Generates the module factory for this chunk item.
fn code(self: Vc<Self>, async_module_info: Option<Vc<AsyncModuleInfo>>) -> Vc<Code> { fn code(
self: Vc<Self>,
async_module_info: Option<Vc<AsyncModuleInfo>>,
) -> Vc<EcmascriptChunkItemCode> {
module_factory_with_code_generation_issue(Vc::upcast_non_strict(self), async_module_info) module_factory_with_code_generation_issue(Vc::upcast_non_strict(self), async_module_info)
.to_code()
} }
} }
...@@ -276,21 +288,25 @@ where ...@@ -276,21 +288,25 @@ where
async fn module_factory_with_code_generation_issue( async fn module_factory_with_code_generation_issue(
chunk_item: Vc<Box<dyn EcmascriptChunkItem>>, chunk_item: Vc<Box<dyn EcmascriptChunkItem>>,
async_module_info: Option<Vc<AsyncModuleInfo>>, async_module_info: Option<Vc<AsyncModuleInfo>>,
) -> Result<Vc<PersistedCode>> { ) -> Result<Vc<EcmascriptChunkItemCode>> {
async fn get_content( async fn get_content(
chunk_item: Vc<Box<dyn EcmascriptChunkItem>>, chunk_item: Vc<Box<dyn EcmascriptChunkItem>>,
async_module_info: Option<Vc<AsyncModuleInfo>>, async_module_info: Option<Vc<AsyncModuleInfo>>,
) -> Result<ResolvedVc<PersistedCode>> { ) -> Result<ReadRef<EcmascriptChunkItemContent>> {
let chunk_item_ref = chunk_item.into_trait_ref().await?; chunk_item
let content = chunk_item_ref .into_trait_ref()
.await?
.content_with_async_module_info(async_module_info, false) .content_with_async_module_info(async_module_info, false)
.await? .await?
.await?; .await
content.module_factory().await
} }
let content = get_content(chunk_item, async_module_info).await;
Ok(match content { let (code, strict) = match get_content(chunk_item, async_module_info).await {
Ok(factory) => *factory, Ok(content) => (content.module_factory().await, content.options.strict),
Err(error) => (Err(error), false),
};
let code = match code {
Ok(factory) => factory,
Err(error) => { Err(error) => {
let id = chunk_item.asset_ident().to_string().await; let id = chunk_item.asset_ident().to_string().await;
let id = id.as_ref().map_or_else(|_| "unknown", |id| &**id); let id = id.as_ref().map_or_else(|_| "unknown", |id| &**id);
...@@ -315,9 +331,10 @@ async fn module_factory_with_code_generation_issue( ...@@ -315,9 +331,10 @@ async fn module_factory_with_code_generation_issue(
code += "(() => {{\n\n"; code += "(() => {{\n\n";
writeln!(code, "throw new Error({error});", error = js_error_message)?; writeln!(code, "throw new Error({error});", error = js_error_message)?;
code += "\n}})"; code += "\n}})";
*code.build().cell_persisted() code.build().cell_persisted()
} }
}) };
Ok(EcmascriptChunkItemCode { code, strict }.cell())
} }
/// Generic chunk item that wraps any EcmascriptChunkPlaceable module. /// Generic chunk item that wraps any EcmascriptChunkPlaceable module.
......
...@@ -4,6 +4,7 @@ pub(crate) mod code_module_ids_and_paths; ...@@ -4,6 +4,7 @@ pub(crate) mod code_module_ids_and_paths;
pub(crate) mod content; pub(crate) mod content;
pub(crate) mod content_entry; pub(crate) mod content_entry;
pub(crate) mod data; pub(crate) mod data;
pub(crate) mod factory_group;
pub(crate) mod item; pub(crate) mod item;
pub(crate) mod placeable; pub(crate) mod placeable;
...@@ -31,15 +32,19 @@ pub use self::{ ...@@ -31,15 +32,19 @@ pub use self::{
}, },
chunk_type::EcmascriptChunkType, chunk_type::EcmascriptChunkType,
code_module_ids_and_paths::{ code_module_ids_and_paths::{
BatchGroupCodeModuleIdsAndPaths, CodeModuleIdsAndPaths, BatchGroupCodeModuleIdsAndPaths, CodeModuleIdAndPath, CodeModuleIdsAndPaths,
batch_group_code_module_ids_and_paths, item_code_module_ids_and_paths, batch_group_code_module_ids_and_paths, item_code_module_ids_and_paths,
}, },
content::EcmascriptChunkContent, content::EcmascriptChunkContent,
content_entry::{EcmascriptChunkContentEntries, EcmascriptChunkContentEntry}, content_entry::{EcmascriptChunkContentEntries, EcmascriptChunkContentEntry},
data::EcmascriptChunkData, data::EcmascriptChunkData,
factory_group::{
StrictFactoryMode, strict_chunk_wrapper, strict_factory_mode, write_module_factories,
},
item::{ item::{
EcmascriptChunkItem, EcmascriptChunkItemContent, EcmascriptChunkItemExt, EcmascriptChunkItem, EcmascriptChunkItemCode, EcmascriptChunkItemContent,
EcmascriptChunkItemOptions, EcmascriptChunkItemWithAsyncInfo, ecmascript_chunk_item, EcmascriptChunkItemExt, EcmascriptChunkItemOptions, EcmascriptChunkItemWithAsyncInfo,
ecmascript_chunk_item,
}, },
placeable::{CjsStaticExports, EcmascriptChunkPlaceable, EcmascriptExports}, placeable::{CjsStaticExports, EcmascriptChunkPlaceable, EcmascriptExports},
}; };
......
...@@ -10,13 +10,15 @@ use turbopack_core::{ ...@@ -10,13 +10,15 @@ use turbopack_core::{
version::{MergeableVersionedContent, Version, VersionedContent, VersionedContentMerger}, version::{MergeableVersionedContent, Version, VersionedContent, VersionedContentMerger},
}; };
use turbopack_ecmascript::{ use turbopack_ecmascript::{
chunk::{EcmascriptChunkContent, EcmascriptChunkContentEntries}, chunk::{
EcmascriptChunkContent, EcmascriptChunkContentEntries, strict_chunk_wrapper,
strict_factory_mode, write_module_factories,
},
hmr::{ hmr::{
EcmascriptHmrChunkContent, merger::EcmascriptChunkContentMerger, EcmascriptHmrChunkContent, merger::EcmascriptChunkContentMerger,
version::EcmascriptChunkVersion, version::EcmascriptChunkVersion,
}, },
minify::minify, minify::minify,
utils::StringifyJs,
}; };
use super::chunk::EcmascriptBuildNodeChunk; use super::chunk::EcmascriptBuildNodeChunk;
...@@ -60,18 +62,32 @@ impl EcmascriptNodeChunkContent { ...@@ -60,18 +62,32 @@ impl EcmascriptNodeChunkContent {
.await?; .await?;
let mut code = CodeBuilder::new(true, *self.chunking_context.debug_ids_enabled().await?); let mut code = CodeBuilder::new(true, *self.chunking_context.debug_ids_enabled().await?);
let supports_arrow_functions = *self
write!(code, "module.exports = [")?; .chunking_context
.environment()
.runtime_versions()
.supports_arrow_functions()
.await?;
let content = self.content.await?; let content = self.content.await?;
let chunk_items = content.chunk_item_code_module_ids_and_paths().await?; let chunk_items = content.chunk_item_code_module_ids_and_paths().await?;
for (id, item_code, _) in &chunk_items { let strict_factory_mode = strict_factory_mode(&chunk_items, supports_arrow_functions);
write!(code, "\n{}, ", StringifyJs(id))?;
code.push_code(item_code);
write!(code, ",")?;
}
let strict_chunk_wrapper =
strict_chunk_wrapper(strict_factory_mode, supports_arrow_functions);
if let Some((prefix, _)) = strict_chunk_wrapper {
code += prefix;
}
write!(code, "module.exports = [")?;
write_module_factories(
&mut code,
&chunk_items,
strict_factory_mode,
supports_arrow_functions,
)?;
write!(code, "\n];")?; write!(code, "\n];")?;
if let Some((_, suffix)) = strict_chunk_wrapper {
code += suffix;
}
let mut code = code.build(); let mut code = code.build();
......
(globalThis["TURBOPACK"] || (globalThis["TURBOPACK"] = [])).push(["output/1jsg_tests_snapshot_basic-tree-shake_dynamic-import_input_lib_1b34ju5a6z6v3.js", (()=>{"use strict";(globalThis["TURBOPACK"] || (globalThis["TURBOPACK"] = [])).push(["output/1jsg_tests_snapshot_basic-tree-shake_dynamic-import_input_lib_1b34ju5a6z6v3.js",
"[project]/turbopack/crates/turbopack-tests/tests/snapshot/basic-tree-shake/dynamic-import/input/lib.js [test] (ecmascript)", ((__turbopack_context__) => { "[project]/turbopack/crates/turbopack-tests/tests/snapshot/basic-tree-shake/dynamic-import/input/lib.js [test] (ecmascript)", ((__turbopack_context__) => {
"use strict"; "use strict";
...@@ -180,6 +180,6 @@ var __TURBOPACK__imported__module__$5b$project$5d2f$turbopack$2f$crates$2f$turbo ...@@ -180,6 +180,6 @@ var __TURBOPACK__imported__module__$5b$project$5d2f$turbopack$2f$crates$2f$turbo
; ;
; ;
}), }),
]); ]);})()
//# sourceMappingURL=1jsg_tests_snapshot_basic-tree-shake_dynamic-import_input_lib_1b34ju5a6z6v3.js.map //# sourceMappingURL=1jsg_tests_snapshot_basic-tree-shake_dynamic-import_input_lib_1b34ju5a6z6v3.js.map
\ No newline at end of file
(globalThis["TURBOPACK"] || (globalThis["TURBOPACK"] = [])).push(["output/1jsg_tests_snapshot_basic-tree-shake_export-named_input_0xj7cshvyczs_._.js", (()=>{"use strict";(globalThis["TURBOPACK"] || (globalThis["TURBOPACK"] = [])).push(["output/1jsg_tests_snapshot_basic-tree-shake_export-named_input_0xj7cshvyczs_._.js",
"[project]/turbopack/crates/turbopack-tests/tests/snapshot/basic-tree-shake/export-named/input/index.js [test] (ecmascript)", ((__turbopack_context__) => { "[project]/turbopack/crates/turbopack-tests/tests/snapshot/basic-tree-shake/export-named/input/index.js [test] (ecmascript)", ((__turbopack_context__) => {
"use strict"; "use strict";
...@@ -92,6 +92,6 @@ var __TURBOPACK__imported__module__$5b$project$5d2f$turbopack$2f$crates$2f$turbo ...@@ -92,6 +92,6 @@ var __TURBOPACK__imported__module__$5b$project$5d2f$turbopack$2f$crates$2f$turbo
; ;
; ;
}), }),
]); ]);})()
//# sourceMappingURL=1jsg_tests_snapshot_basic-tree-shake_export-named_input_0xj7cshvyczs_._.js.map //# sourceMappingURL=1jsg_tests_snapshot_basic-tree-shake_export-named_input_0xj7cshvyczs_._.js.map
\ No newline at end of file
(globalThis["TURBOPACK"] || (globalThis["TURBOPACK"] = [])).push(["output/1jsg_tests_snapshot_basic-tree-shake_export-namespace_input_1mqgz2-3_b4v8._.js", (()=>{"use strict";(globalThis["TURBOPACK"] || (globalThis["TURBOPACK"] = [])).push(["output/1jsg_tests_snapshot_basic-tree-shake_export-namespace_input_1mqgz2-3_b4v8._.js",
"[project]/turbopack/crates/turbopack-tests/tests/snapshot/basic-tree-shake/export-namespace/input/index.js [test] (ecmascript)", ((__turbopack_context__) => { "[project]/turbopack/crates/turbopack-tests/tests/snapshot/basic-tree-shake/export-namespace/input/index.js [test] (ecmascript)", ((__turbopack_context__) => {
"use strict"; "use strict";
...@@ -187,6 +187,6 @@ var __TURBOPACK__imported__module__$5b$project$5d2f$turbopack$2f$crates$2f$turbo ...@@ -187,6 +187,6 @@ var __TURBOPACK__imported__module__$5b$project$5d2f$turbopack$2f$crates$2f$turbo
; ;
; ;
}), }),
]); ]);})()
//# sourceMappingURL=1jsg_tests_snapshot_basic-tree-shake_export-namespace_input_1mqgz2-3_b4v8._.js.map //# sourceMappingURL=1jsg_tests_snapshot_basic-tree-shake_export-namespace_input_1mqgz2-3_b4v8._.js.map
\ No newline at end of file
(globalThis["TURBOPACK"] || (globalThis["TURBOPACK"] = [])).push(["output/1jsg_tests_snapshot_basic-tree-shake_import-named-all_input_1orhvu2sihqe-._.js", (()=>{"use strict";(globalThis["TURBOPACK"] || (globalThis["TURBOPACK"] = [])).push(["output/1jsg_tests_snapshot_basic-tree-shake_import-named-all_input_1orhvu2sihqe-._.js",
"[project]/turbopack/crates/turbopack-tests/tests/snapshot/basic-tree-shake/import-named-all/input/index.js [test] (ecmascript)", ((__turbopack_context__) => { "[project]/turbopack/crates/turbopack-tests/tests/snapshot/basic-tree-shake/import-named-all/input/index.js [test] (ecmascript)", ((__turbopack_context__) => {
"use strict"; "use strict";
...@@ -75,6 +75,6 @@ var __TURBOPACK__imported__module__$5b$project$5d2f$turbopack$2f$crates$2f$turbo ...@@ -75,6 +75,6 @@ var __TURBOPACK__imported__module__$5b$project$5d2f$turbopack$2f$crates$2f$turbo
; ;
; ;
}), }),
]); ]);})()
//# sourceMappingURL=1jsg_tests_snapshot_basic-tree-shake_import-named-all_input_1orhvu2sihqe-._.js.map //# sourceMappingURL=1jsg_tests_snapshot_basic-tree-shake_import-named-all_input_1orhvu2sihqe-._.js.map
\ No newline at end of file
(globalThis["TURBOPACK"] || (globalThis["TURBOPACK"] = [])).push(["output/1jsg_tests_snapshot_basic-tree-shake_import-named_input_1j9uhcyhqdoze._.js", (()=>{"use strict";(globalThis["TURBOPACK"] || (globalThis["TURBOPACK"] = [])).push(["output/1jsg_tests_snapshot_basic-tree-shake_import-named_input_1j9uhcyhqdoze._.js",
"[project]/turbopack/crates/turbopack-tests/tests/snapshot/basic-tree-shake/import-named/input/index.js [test] (ecmascript)", ((__turbopack_context__) => { "[project]/turbopack/crates/turbopack-tests/tests/snapshot/basic-tree-shake/import-named/input/index.js [test] (ecmascript)", ((__turbopack_context__) => {
"use strict"; "use strict";
...@@ -75,6 +75,6 @@ var __TURBOPACK__imported__module__$5b$project$5d2f$turbopack$2f$crates$2f$turbo ...@@ -75,6 +75,6 @@ var __TURBOPACK__imported__module__$5b$project$5d2f$turbopack$2f$crates$2f$turbo
; ;
; ;
}), }),
]); ]);})()
//# sourceMappingURL=1jsg_tests_snapshot_basic-tree-shake_import-named_input_1j9uhcyhqdoze._.js.map //# sourceMappingURL=1jsg_tests_snapshot_basic-tree-shake_import-named_input_1j9uhcyhqdoze._.js.map
\ No newline at end of file
(globalThis["TURBOPACK"] || (globalThis["TURBOPACK"] = [])).push(["output/1jsg_tests_snapshot_basic-tree-shake_import-namespace_input_1ippwh3yc_l3v._.js", (()=>{"use strict";(globalThis["TURBOPACK"] || (globalThis["TURBOPACK"] = [])).push(["output/1jsg_tests_snapshot_basic-tree-shake_import-namespace_input_1ippwh3yc_l3v._.js",
"[project]/turbopack/crates/turbopack-tests/tests/snapshot/basic-tree-shake/import-namespace/input/index.js [test] (ecmascript)", ((__turbopack_context__) => { "[project]/turbopack/crates/turbopack-tests/tests/snapshot/basic-tree-shake/import-namespace/input/index.js [test] (ecmascript)", ((__turbopack_context__) => {
"use strict"; "use strict";
...@@ -171,6 +171,6 @@ var __TURBOPACK__imported__module__$5b$project$5d2f$turbopack$2f$crates$2f$turbo ...@@ -171,6 +171,6 @@ var __TURBOPACK__imported__module__$5b$project$5d2f$turbopack$2f$crates$2f$turbo
; ;
; ;
}), }),
]); ]);})()
//# sourceMappingURL=1jsg_tests_snapshot_basic-tree-shake_import-namespace_input_1ippwh3yc_l3v._.js.map //# sourceMappingURL=1jsg_tests_snapshot_basic-tree-shake_import-namespace_input_1ippwh3yc_l3v._.js.map
\ No newline at end of file
(globalThis["TURBOPACK"] || (globalThis["TURBOPACK"] = [])).push(["output/1jsg_tests_snapshot_basic-tree-shake_import-side-effect_input_1_hdh9its1vdz._.js", (()=>{"use strict";(globalThis["TURBOPACK"] || (globalThis["TURBOPACK"] = [])).push(["output/1jsg_tests_snapshot_basic-tree-shake_import-side-effect_input_1_hdh9its1vdz._.js",
"[project]/turbopack/crates/turbopack-tests/tests/snapshot/basic-tree-shake/import-side-effect/input/index.js [test] (ecmascript)", ((__turbopack_context__) => { "[project]/turbopack/crates/turbopack-tests/tests/snapshot/basic-tree-shake/import-side-effect/input/index.js [test] (ecmascript)", ((__turbopack_context__) => {
"use strict"; "use strict";
...@@ -51,6 +51,6 @@ var __TURBOPACK__imported__module__$5b$project$5d2f$turbopack$2f$crates$2f$turbo ...@@ -51,6 +51,6 @@ var __TURBOPACK__imported__module__$5b$project$5d2f$turbopack$2f$crates$2f$turbo
; ;
__TURBOPACK__imported__module__$5b$project$5d2f$turbopack$2f$crates$2f$turbopack$2d$tests$2f$tests$2f$snapshot$2f$basic$2d$tree$2d$shake$2f$import$2d$side$2d$effect$2f$input$2f$lib$2e$js__$5b$test$5d$__$28$ecmascript$29$__$3c$internal__part__0$3e$__["a"] += '!'; __TURBOPACK__imported__module__$5b$project$5d2f$turbopack$2f$crates$2f$turbopack$2d$tests$2f$tests$2f$snapshot$2f$basic$2d$tree$2d$shake$2f$import$2d$side$2d$effect$2f$input$2f$lib$2e$js__$5b$test$5d$__$28$ecmascript$29$__$3c$internal__part__0$3e$__["a"] += '!';
}), }),
]); ]);})()
//# sourceMappingURL=1jsg_tests_snapshot_basic-tree-shake_import-side-effect_input_1_hdh9its1vdz._.js.map //# sourceMappingURL=1jsg_tests_snapshot_basic-tree-shake_import-side-effect_input_1_hdh9its1vdz._.js.map
\ No newline at end of file
(globalThis["TURBOPACK"] || (globalThis["TURBOPACK"] = [])).push(["output/1jsg_tests_snapshot_basic-tree-shake_require-side-effect_input_0fs4qhn32cnvu._.js", (globalThis["TURBOPACK"] || (globalThis["TURBOPACK"] = [])).push(["output/1jsg_tests_snapshot_basic-tree-shake_require-side-effect_input_0fs4qhn32cnvu._.js",
"[project]/turbopack/crates/turbopack-tests/tests/snapshot/basic-tree-shake/require-side-effect/input/index.js [test] (ecmascript)", ((__turbopack_context__, module, exports) => { (()=>{"use strict";return[
const { cat } = __turbopack_context__.r("[project]/turbopack/crates/turbopack-tests/tests/snapshot/basic-tree-shake/require-side-effect/input/lib.js [test] (ecmascript)");
}),
"[project]/turbopack/crates/turbopack-tests/tests/snapshot/basic-tree-shake/require-side-effect/input/lib.js [test] (ecmascript)", ((__turbopack_context__) => { "[project]/turbopack/crates/turbopack-tests/tests/snapshot/basic-tree-shake/require-side-effect/input/lib.js [test] (ecmascript)", ((__turbopack_context__) => {
"use strict"; "use strict";
...@@ -184,6 +181,11 @@ var __TURBOPACK__imported__module__$5b$project$5d2f$turbopack$2f$crates$2f$turbo ...@@ -184,6 +181,11 @@ var __TURBOPACK__imported__module__$5b$project$5d2f$turbopack$2f$crates$2f$turbo
; ;
; ;
}), }),
]})(),
"[project]/turbopack/crates/turbopack-tests/tests/snapshot/basic-tree-shake/require-side-effect/input/index.js [test] (ecmascript)", ((__turbopack_context__, module, exports) => {
const { cat } = __turbopack_context__.r("[project]/turbopack/crates/turbopack-tests/tests/snapshot/basic-tree-shake/require-side-effect/input/lib.js [test] (ecmascript)");
}),
]); ]);
//# sourceMappingURL=1jsg_tests_snapshot_basic-tree-shake_require-side-effect_input_0fs4qhn32cnvu._.js.map //# sourceMappingURL=1jsg_tests_snapshot_basic-tree-shake_require-side-effect_input_0fs4qhn32cnvu._.js.map
\ No newline at end of file
(globalThis["TURBOPACK"] || (globalThis["TURBOPACK"] = [])).push(["output/1jsg_tests_snapshot_basic-tree-shake_tree-shake-test-1_input_index_07jttq51-r0-b.js", (()=>{"use strict";(globalThis["TURBOPACK"] || (globalThis["TURBOPACK"] = [])).push(["output/1jsg_tests_snapshot_basic-tree-shake_tree-shake-test-1_input_index_07jttq51-r0-b.js",
"[project]/turbopack/crates/turbopack-tests/tests/snapshot/basic-tree-shake/tree-shake-test-1/input/index.js [test] (ecmascript)", ((__turbopack_context__) => { "[project]/turbopack/crates/turbopack-tests/tests/snapshot/basic-tree-shake/tree-shake-test-1/input/index.js [test] (ecmascript)", ((__turbopack_context__) => {
"use strict"; "use strict";
...@@ -180,6 +180,6 @@ var __TURBOPACK__imported__module__$5b$project$5d2f$turbopack$2f$crates$2f$turbo ...@@ -180,6 +180,6 @@ var __TURBOPACK__imported__module__$5b$project$5d2f$turbopack$2f$crates$2f$turbo
; ;
; ;
}), }),
]); ]);})()
//# sourceMappingURL=1jsg_tests_snapshot_basic-tree-shake_tree-shake-test-1_input_index_07jttq51-r0-b.js.map //# sourceMappingURL=1jsg_tests_snapshot_basic-tree-shake_tree-shake-test-1_input_index_07jttq51-r0-b.js.map
\ No newline at end of file
(globalThis["TURBOPACK"] || (globalThis["TURBOPACK"] = [])).push(["output/1do3_crates_turbopack-tests_tests_snapshot_basic_async_chunk_input_1lkohl-aes1w9._.js", (()=>{"use strict";(globalThis["TURBOPACK"] || (globalThis["TURBOPACK"] = [])).push(["output/1do3_crates_turbopack-tests_tests_snapshot_basic_async_chunk_input_1lkohl-aes1w9._.js",
"[project]/turbopack/crates/turbopack-tests/tests/snapshot/basic/async_chunk/input/import.js [test] (ecmascript)", ((__turbopack_context__) => { "[project]/turbopack/crates/turbopack-tests/tests/snapshot/basic/async_chunk/input/import.js [test] (ecmascript)", ((__turbopack_context__) => {
"use strict"; "use strict";
...@@ -23,6 +23,6 @@ function foo(value) { ...@@ -23,6 +23,6 @@ function foo(value) {
console.assert(value); console.assert(value);
} }
}), }),
]); ]);})()
//# sourceMappingURL=1do3_crates_turbopack-tests_tests_snapshot_basic_async_chunk_input_1lkohl-aes1w9._.js.map //# sourceMappingURL=1do3_crates_turbopack-tests_tests_snapshot_basic_async_chunk_input_1lkohl-aes1w9._.js.map
\ No newline at end of file
module.exports = [ (()=>{"use strict";module.exports = [
"[project]/turbopack/crates/turbopack-tests/tests/snapshot/basic/async_chunk_build/input/import.js [test] (ecmascript)", ((__turbopack_context__) => { "[project]/turbopack/crates/turbopack-tests/tests/snapshot/basic/async_chunk_build/input/import.js [test] (ecmascript)", ((__turbopack_context__) => {
"use strict"; "use strict";
...@@ -23,6 +23,6 @@ function foo(value) { ...@@ -23,6 +23,6 @@ function foo(value) {
console.assert(value); console.assert(value);
} }
}), }),
]; ];})()
//# sourceMappingURL=0_9x_turbopack-tests_tests_snapshot_basic_async_chunk_build_input_0aldykipaj64f._.js.map //# sourceMappingURL=0_9x_turbopack-tests_tests_snapshot_basic_async_chunk_build_input_0aldykipaj64f._.js.map
\ No newline at end of file
(globalThis["TURBOPACK"] || (globalThis["TURBOPACK"] = [])).push(["output/1do3_crates_turbopack-tests_tests_snapshot_basic_chunked_input_1_yzgm1kllkx5._.js", (()=>{"use strict";(globalThis["TURBOPACK"] || (globalThis["TURBOPACK"] = [])).push(["output/1do3_crates_turbopack-tests_tests_snapshot_basic_chunked_input_1_yzgm1kllkx5._.js",
"[project]/turbopack/crates/turbopack-tests/tests/snapshot/basic/chunked/input/index.js [test] (ecmascript)", ((__turbopack_context__) => { "[project]/turbopack/crates/turbopack-tests/tests/snapshot/basic/chunked/input/index.js [test] (ecmascript)", ((__turbopack_context__) => {
"use strict"; "use strict";
...@@ -18,6 +18,6 @@ function foo(value) { ...@@ -18,6 +18,6 @@ function foo(value) {
console.assert(value); console.assert(value);
} }
}), }),
]); ]);})()
//# sourceMappingURL=1do3_crates_turbopack-tests_tests_snapshot_basic_chunked_input_1_yzgm1kllkx5._.js.map //# sourceMappingURL=1do3_crates_turbopack-tests_tests_snapshot_basic_chunked_input_1_yzgm1kllkx5._.js.map
\ No newline at end of file
(globalThis["TURBOPACK"] || (globalThis["TURBOPACK"] = [])).push(["output/1do3_crates_turbopack-tests_tests_snapshot_basic_export-default_input_1k9-ja77l7ynd._.js", (()=>{"use strict";(globalThis["TURBOPACK"] || (globalThis["TURBOPACK"] = [])).push(["output/1do3_crates_turbopack-tests_tests_snapshot_basic_export-default_input_1k9-ja77l7ynd._.js",
"[project]/turbopack/crates/turbopack-tests/tests/snapshot/basic/export-default/input/index.js [test] (ecmascript)", ((__turbopack_context__) => { "[project]/turbopack/crates/turbopack-tests/tests/snapshot/basic/export-default/input/index.js [test] (ecmascript)", ((__turbopack_context__) => {
"use strict"; "use strict";
...@@ -19,6 +19,6 @@ __turbopack_context__.s([ ...@@ -19,6 +19,6 @@ __turbopack_context__.s([
__TURBOPACK__default__export__ __TURBOPACK__default__export__
]); ]);
}), }),
]); ]);})()
//# sourceMappingURL=1do3_crates_turbopack-tests_tests_snapshot_basic_export-default_input_1k9-ja77l7ynd._.js.map //# sourceMappingURL=1do3_crates_turbopack-tests_tests_snapshot_basic_export-default_input_1k9-ja77l7ynd._.js.map
\ No newline at end of file
(globalThis["TURBOPACK"] || (globalThis["TURBOPACK"] = [])).push(["output/1do3_crates_turbopack-tests_tests_snapshot_basic_shebang_input_02e38zhtmusm6._.js", (()=>{"use strict";(globalThis["TURBOPACK"] || (globalThis["TURBOPACK"] = [])).push(["output/1do3_crates_turbopack-tests_tests_snapshot_basic_shebang_input_02e38zhtmusm6._.js",
"[project]/turbopack/crates/turbopack-tests/tests/snapshot/basic/shebang/input/index.js [test] (ecmascript)", ((__turbopack_context__) => { "[project]/turbopack/crates/turbopack-tests/tests/snapshot/basic/shebang/input/index.js [test] (ecmascript)", ((__turbopack_context__) => {
"use strict"; "use strict";
...@@ -18,6 +18,6 @@ function foo(value) { ...@@ -18,6 +18,6 @@ function foo(value) {
console.assert(value); console.assert(value);
} }
}), }),
]); ]);})()
//# sourceMappingURL=1do3_crates_turbopack-tests_tests_snapshot_basic_shebang_input_02e38zhtmusm6._.js.map //# sourceMappingURL=1do3_crates_turbopack-tests_tests_snapshot_basic_shebang_input_02e38zhtmusm6._.js.map
\ No newline at end of file
(globalThis["TURBOPACK"] || (globalThis["TURBOPACK"] = [])).push(["output/1do3_crates_turbopack-tests_tests_snapshot_basic_top-level-await_input_0zs_dr_r82cwm._.js", (()=>{"use strict";(globalThis["TURBOPACK"] || (globalThis["TURBOPACK"] = [])).push(["output/1do3_crates_turbopack-tests_tests_snapshot_basic_top-level-await_input_0zs_dr_r82cwm._.js",
"[project]/turbopack/crates/turbopack-tests/tests/snapshot/basic/top-level-await/input/UserAPI.js [test] (ecmascript)", ((__turbopack_context__) => { "[project]/turbopack/crates/turbopack-tests/tests/snapshot/basic/top-level-await/input/UserAPI.js [test] (ecmascript)", ((__turbopack_context__) => {
"use strict"; "use strict";
...@@ -49,6 +49,6 @@ const close = ()=>{ ...@@ -49,6 +49,6 @@ const close = ()=>{
}; };
__turbopack_async_result__(); __turbopack_async_result__();
} catch(e) { __turbopack_async_result__(e); } }, true);}), } catch(e) { __turbopack_async_result__(e); } }, true);}),
]); ]);})()
//# sourceMappingURL=1do3_crates_turbopack-tests_tests_snapshot_basic_top-level-await_input_0zs_dr_r82cwm._.js.map //# sourceMappingURL=1do3_crates_turbopack-tests_tests_snapshot_basic_top-level-await_input_0zs_dr_r82cwm._.js.map
\ No newline at end of file
(globalThis["TURBOPACK"] || (globalThis["TURBOPACK"] = [])).push(["output/1do3_crates_turbopack-tests_tests_snapshot_basic_top-level-await_input_1ih204k-kik67._.js", (()=>{"use strict";(globalThis["TURBOPACK"] || (globalThis["TURBOPACK"] = [])).push(["output/1do3_crates_turbopack-tests_tests_snapshot_basic_top-level-await_input_1ih204k-kik67._.js",
"[project]/turbopack/crates/turbopack-tests/tests/snapshot/basic/top-level-await/input/Actions.js [test] (ecmascript)", ((__turbopack_context__) => { "[project]/turbopack/crates/turbopack-tests/tests/snapshot/basic/top-level-await/input/Actions.js [test] (ecmascript)", ((__turbopack_context__) => {
"use strict"; "use strict";
...@@ -34,6 +34,6 @@ var __TURBOPACK__imported__module__$5b$project$5d2f$turbopack$2f$crates$2f$turbo ...@@ -34,6 +34,6 @@ var __TURBOPACK__imported__module__$5b$project$5d2f$turbopack$2f$crates$2f$turbo
console.log('created user John'); console.log('created user John');
})(); })();
}), }),
]); ]);})()
//# sourceMappingURL=1do3_crates_turbopack-tests_tests_snapshot_basic_top-level-await_input_1ih204k-kik67._.js.map //# sourceMappingURL=1do3_crates_turbopack-tests_tests_snapshot_basic_top-level-await_input_1ih204k-kik67._.js.map
\ No newline at end of file
import { a } from './all-strict-a'
import { b } from './all-strict-b'
export const value = a + b
'use strict' 'use strict'
console.log('this is CJS') const strictA = require('./strict-a')
module.exports = 1234 const strictB = require('./strict-b').default
const sloppy = require('./non-strict')
import('./below-threshold').then(({ value }) => {
console.log('below threshold', value)
})
import('./all-strict').then(({ value }) => {
console.log('all strict', value)
})
console.log('this is CJS', strictA, strictB, sloppy)
module.exports = strictA + strictB + sloppy
module.exports = (function () {
return this === globalThis ? 34 : 0
})()
(globalThis["TURBOPACK"] || (globalThis["TURBOPACK"] = [])).push([
"output/0rv8_turbopack-tests_tests_snapshot_basic_use-strict_input_index_06b3uhycu7sip.js",
{"otherChunks":["output/0_9x_turbopack-tests_tests_snapshot_basic_use-strict_input_index_0nlvx9556vyf1.js"],"runtimeModuleIds":["[project]/turbopack/crates/turbopack-tests/tests/snapshot/basic/use-strict/input/index.js [test] (ecmascript)"]}
]);
// Dummy runtime
\ No newline at end of file
(globalThis["TURBOPACK"] || (globalThis["TURBOPACK"] = [])).push([
"output/0rv8_turbopack-tests_tests_snapshot_basic_use-strict_input_index_0r4xda1wnxaqk.js",
{"otherChunks":["output/1do3_crates_turbopack-tests_tests_snapshot_basic_use-strict_input_0czj5szeqd2rf._.js","output/1do3_crates_turbopack-tests_tests_snapshot_basic_use-strict_input_1wmp5yoyw-hht._.js"],"runtimeModuleIds":["[project]/turbopack/crates/turbopack-tests/tests/snapshot/basic/use-strict/input/index.js [test] (ecmascript)"]}
]);
// Dummy runtime
\ No newline at end of file
(globalThis["TURBOPACK"] || (globalThis["TURBOPACK"] = [])).push(["output/1do3_crates_turbopack-tests_tests_snapshot_basic_use-strict_input_0czj5szeqd2rf._.js",
"[project]/turbopack/crates/turbopack-tests/tests/snapshot/basic/use-strict/input/all-strict.js [test] (ecmascript, async loader)", ((__turbopack_context__) => {
__turbopack_context__.v((parentImport) => {
return Promise.all([
"output/1do3_crates_turbopack-tests_tests_snapshot_basic_use-strict_input_1fuq2pc5luz9r._.js"
].map((chunk) => __turbopack_context__.l(chunk))).then(() => {
return parentImport("[project]/turbopack/crates/turbopack-tests/tests/snapshot/basic/use-strict/input/all-strict.js [test] (ecmascript)");
});
});
}),
"[project]/turbopack/crates/turbopack-tests/tests/snapshot/basic/use-strict/input/below-threshold.js [test] (ecmascript, async loader)", ((__turbopack_context__) => {
__turbopack_context__.v((parentImport) => {
return Promise.all([
"output/1jsg_tests_snapshot_basic_use-strict_input_below-threshold_1my1mnvsmmqb0.js"
].map((chunk) => __turbopack_context__.l(chunk))).then(() => {
return parentImport("[project]/turbopack/crates/turbopack-tests/tests/snapshot/basic/use-strict/input/below-threshold.js [test] (ecmascript)");
});
});
}),
]);
\ No newline at end of file
(()=>{"use strict";(globalThis["TURBOPACK"] || (globalThis["TURBOPACK"] = [])).push(["output/1do3_crates_turbopack-tests_tests_snapshot_basic_use-strict_input_1fuq2pc5luz9r._.js",
"[project]/turbopack/crates/turbopack-tests/tests/snapshot/basic/use-strict/input/all-strict-a.js [test] (ecmascript)", ((__turbopack_context__) => {
"use strict";
__turbopack_context__.s([
"a",
()=>a
]);
const a = 1;
}),
"[project]/turbopack/crates/turbopack-tests/tests/snapshot/basic/use-strict/input/all-strict-b.js [test] (ecmascript)", ((__turbopack_context__) => {
"use strict";
__turbopack_context__.s([
"b",
()=>b
]);
const b = 2;
}),
"[project]/turbopack/crates/turbopack-tests/tests/snapshot/basic/use-strict/input/all-strict.js [test] (ecmascript)", ((__turbopack_context__) => {
"use strict";
__turbopack_context__.s([
"value",
()=>value
]);
var __TURBOPACK__imported__module__$5b$project$5d2f$turbopack$2f$crates$2f$turbopack$2d$tests$2f$tests$2f$snapshot$2f$basic$2f$use$2d$strict$2f$input$2f$all$2d$strict$2d$a$2e$js__$5b$test$5d$__$28$ecmascript$29$__ = __turbopack_context__.i("[project]/turbopack/crates/turbopack-tests/tests/snapshot/basic/use-strict/input/all-strict-a.js [test] (ecmascript)");
var __TURBOPACK__imported__module__$5b$project$5d2f$turbopack$2f$crates$2f$turbopack$2d$tests$2f$tests$2f$snapshot$2f$basic$2f$use$2d$strict$2f$input$2f$all$2d$strict$2d$b$2e$js__$5b$test$5d$__$28$ecmascript$29$__ = __turbopack_context__.i("[project]/turbopack/crates/turbopack-tests/tests/snapshot/basic/use-strict/input/all-strict-b.js [test] (ecmascript)");
;
;
const value = __TURBOPACK__imported__module__$5b$project$5d2f$turbopack$2f$crates$2f$turbopack$2d$tests$2f$tests$2f$snapshot$2f$basic$2f$use$2d$strict$2f$input$2f$all$2d$strict$2d$a$2e$js__$5b$test$5d$__$28$ecmascript$29$__["a"] + __TURBOPACK__imported__module__$5b$project$5d2f$turbopack$2f$crates$2f$turbopack$2d$tests$2f$tests$2f$snapshot$2f$basic$2f$use$2d$strict$2f$input$2f$all$2d$strict$2d$b$2e$js__$5b$test$5d$__$28$ecmascript$29$__["b"];
}),
]);})()
//# sourceMappingURL=1do3_crates_turbopack-tests_tests_snapshot_basic_use-strict_input_1fuq2pc5luz9r._.js.map
\ No newline at end of file
{
"version": 3,
"sources": [],
"sections": [
{"offset": {"line": 4, "column": 0}, "map": {"version":3,"sources":["turbopack:///[project]/turbopack/crates/turbopack-tests/tests/snapshot/basic/use-strict/input/all-strict-a.js"],"sourcesContent":["export const a = 1\n"],"names":["a"],"mappings":";;;;AAAO,MAAMA,IAAI"}},
{"offset": {"line": 13, "column": 0}, "map": {"version":3,"sources":["turbopack:///[project]/turbopack/crates/turbopack-tests/tests/snapshot/basic/use-strict/input/all-strict-b.js"],"sourcesContent":["export const b = 2\n"],"names":["b"],"mappings":";;;;AAAO,MAAMA,IAAI"}},
{"offset": {"line": 22, "column": 0}, "map": {"version":3,"sources":["turbopack:///[project]/turbopack/crates/turbopack-tests/tests/snapshot/basic/use-strict/input/all-strict.js"],"sourcesContent":["import { a } from './all-strict-a'\nimport { b } from './all-strict-b'\n\nexport const value = a + b\n"],"names":["value"],"mappings":";;;;AAAA;AACA;;;AAEO,MAAMA,QAAQ,sNAAC,GAAG,sNAAC"}}]
}
\ No newline at end of file
(globalThis["TURBOPACK"] || (globalThis["TURBOPACK"] = [])).push(["output/1do3_crates_turbopack-tests_tests_snapshot_basic_use-strict_input_1wmp5yoyw-hht._.js",
(()=>{"use strict";return[
"[project]/turbopack/crates/turbopack-tests/tests/snapshot/basic/use-strict/input/index.js [test] (ecmascript)", ((__turbopack_context__, module, exports) => {
"use strict";
const strictA = __turbopack_context__.r("[project]/turbopack/crates/turbopack-tests/tests/snapshot/basic/use-strict/input/strict-a.js [test] (ecmascript)");
const strictB = __turbopack_context__.r("[project]/turbopack/crates/turbopack-tests/tests/snapshot/basic/use-strict/input/strict-b.js [test] (ecmascript)").default;
const sloppy = __turbopack_context__.r("[project]/turbopack/crates/turbopack-tests/tests/snapshot/basic/use-strict/input/non-strict.js [test] (ecmascript)");
__turbopack_context__.A("[project]/turbopack/crates/turbopack-tests/tests/snapshot/basic/use-strict/input/below-threshold.js [test] (ecmascript, async loader)").then(({ value })=>{
console.log('below threshold', value);
});
__turbopack_context__.A("[project]/turbopack/crates/turbopack-tests/tests/snapshot/basic/use-strict/input/all-strict.js [test] (ecmascript, async loader)").then(({ value })=>{
console.log('all strict', value);
});
console.log('this is CJS', strictA, strictB, sloppy);
module.exports = strictA + strictB + sloppy;
}),
"[project]/turbopack/crates/turbopack-tests/tests/snapshot/basic/use-strict/input/strict-a.js [test] (ecmascript)", ((__turbopack_context__, module, exports) => {
"use strict";
module.exports = 1000;
}),
"[project]/turbopack/crates/turbopack-tests/tests/snapshot/basic/use-strict/input/strict-b.js [test] (ecmascript)", ((__turbopack_context__) => {
"use strict";
__turbopack_context__.s([
"default",
()=>__TURBOPACK__default__export__
]);
const __TURBOPACK__default__export__ = 200;
}),
]})(),
"[project]/turbopack/crates/turbopack-tests/tests/snapshot/basic/use-strict/input/non-strict.js [test] (ecmascript)", ((__turbopack_context__, module, exports) => {
module.exports = function() {
return this === globalThis ? 34 : 0;
}();
}),
]);
//# sourceMappingURL=1do3_crates_turbopack-tests_tests_snapshot_basic_use-strict_input_1wmp5yoyw-hht._.js.map
\ No newline at end of file
{
"version": 3,
"sources": [],
"sections": [
{"offset": {"line": 5, "column": 0}, "map": {"version":3,"sources":["turbopack:///[project]/turbopack/crates/turbopack-tests/tests/snapshot/basic/use-strict/input/index.js"],"sourcesContent":["'use strict'\n\nconst strictA = require('./strict-a')\nconst strictB = require('./strict-b').default\nconst sloppy = require('./non-strict')\n\nimport('./below-threshold').then(({ value }) => {\n console.log('below threshold', value)\n})\nimport('./all-strict').then(({ value }) => {\n console.log('all strict', value)\n})\n\nconsole.log('this is CJS', strictA, strictB, sloppy)\nmodule.exports = strictA + strictB + sloppy\n"],"names":["strictA","strictB","default","sloppy","then","value","console","log","module","exports"],"mappings":"AAEA,MAAMA;AACN,MAAMC,UAAU,4IAAsBC,OAAO;AAC7C,MAAMC;AAEN,iKAA4BC,IAAI,CAAC,CAAC,EAAEC,KAAK,EAAE;IACzCC,QAAQC,GAAG,CAAC,mBAAmBF;AACjC;AACA,4JAAuBD,IAAI,CAAC,CAAC,EAAEC,KAAK,EAAE;IACpCC,QAAQC,GAAG,CAAC,cAAcF;AAC5B;AAEAC,QAAQC,GAAG,CAAC,eAAeP,SAASC,SAASE;AAC7CK,OAAOC,OAAO,GAAGT,UAAUC,UAAUE"}},
{"offset": {"line": 20, "column": 0}, "map": {"version":3,"sources":["turbopack:///[project]/turbopack/crates/turbopack-tests/tests/snapshot/basic/use-strict/input/strict-a.js"],"sourcesContent":["'use strict'\n\nmodule.exports = 1000\n"],"names":["module","exports"],"mappings":"AAEAA,OAAOC,OAAO,GAAG"}},
{"offset": {"line": 25, "column": 0}, "map": {"version":3,"sources":["turbopack:///[project]/turbopack/crates/turbopack-tests/tests/snapshot/basic/use-strict/input/strict-b.js"],"sourcesContent":["export default 200\n"],"names":[],"mappings":";;;;uCAAe"}},
{"offset": {"line": 34, "column": 0}, "map": {"version":3,"sources":["turbopack:///[project]/turbopack/crates/turbopack-tests/tests/snapshot/basic/use-strict/input/non-strict.js"],"sourcesContent":["module.exports = (function () {\n return this === globalThis ? 34 : 0\n})()\n"],"names":["module","exports","globalThis"],"mappings":"AAAAA,OAAOC,OAAO,GAAG,AAAC;IAChB,OAAO,IAAI,KAAKC,aAAa,KAAK;AACpC"}}]
}
\ No newline at end of file
(globalThis["TURBOPACK"] || (globalThis["TURBOPACK"] = [])).push(["output/0_9x_turbopack-tests_tests_snapshot_basic_use-strict_input_index_0nlvx9556vyf1.js", (globalThis["TURBOPACK"] || (globalThis["TURBOPACK"] = [])).push(["output/1jsg_tests_snapshot_basic_use-strict_input_below-threshold_1my1mnvsmmqb0.js",
"[project]/turbopack/crates/turbopack-tests/tests/snapshot/basic/use-strict/input/index.js [test] (ecmascript)", ((__turbopack_context__, module, exports) => { "[project]/turbopack/crates/turbopack-tests/tests/snapshot/basic/use-strict/input/below-threshold.js [test] (ecmascript)", ((__turbopack_context__) => {
"use strict"; "use strict";
console.log('this is CJS'); __turbopack_context__.s([
module.exports = 1234; "value",
()=>value
]);
const value = 2;
}), }),
]); ]);
//# sourceMappingURL=0_9x_turbopack-tests_tests_snapshot_basic_use-strict_input_index_0nlvx9556vyf1.js.map //# sourceMappingURL=1jsg_tests_snapshot_basic_use-strict_input_below-threshold_1my1mnvsmmqb0.js.map
\ No newline at end of file \ No newline at end of file
...@@ -2,5 +2,5 @@ ...@@ -2,5 +2,5 @@
"version": 3, "version": 3,
"sources": [], "sources": [],
"sections": [ "sections": [
{"offset": {"line": 4, "column": 0}, "map": {"version":3,"sources":["turbopack:///[project]/turbopack/crates/turbopack-tests/tests/snapshot/basic/use-strict/input/index.js"],"sourcesContent":["'use strict'\n\nconsole.log('this is CJS')\nmodule.exports = 1234\n"],"names":["console","log","module","exports"],"mappings":"AAEAA,QAAQC,GAAG,CAAC;AACZC,OAAOC,OAAO,GAAG"}}] {"offset": {"line": 4, "column": 0}, "map": {"version":3,"sources":["turbopack:///[project]/turbopack/crates/turbopack-tests/tests/snapshot/basic/use-strict/input/below-threshold.js"],"sourcesContent":["export const value = 2\n"],"names":["value"],"mappings":";;;;AAAO,MAAMA,QAAQ"}}]
} }
\ No newline at end of file
(globalThis["TURBOPACK"] || (globalThis["TURBOPACK"] = [])).push(["output/1jsg_tests_snapshot_comptime_cross-module-attribute_input_0scutbfo13k0p._.js", (()=>{"use strict";(globalThis["TURBOPACK"] || (globalThis["TURBOPACK"] = [])).push(["output/1jsg_tests_snapshot_comptime_cross-module-attribute_input_0scutbfo13k0p._.js",
"[project]/turbopack/crates/turbopack-tests/tests/snapshot/comptime/cross-module-attribute/input/index.js [test] (ecmascript)", ((__turbopack_context__) => { "[project]/turbopack/crates/turbopack-tests/tests/snapshot/comptime/cross-module-attribute/input/index.js [test] (ecmascript)", ((__turbopack_context__) => {
"use strict"; "use strict";
...@@ -57,6 +57,6 @@ __turbopack_context__.s([ ...@@ -57,6 +57,6 @@ __turbopack_context__.s([
const lower = 'lowercase'; const lower = 'lowercase';
const UPPER = 'UPPER'; const UPPER = 'UPPER';
}), }),
]); ]);})()
//# sourceMappingURL=1jsg_tests_snapshot_comptime_cross-module-attribute_input_0scutbfo13k0p._.js.map //# sourceMappingURL=1jsg_tests_snapshot_comptime_cross-module-attribute_input_0scutbfo13k0p._.js.map
\ No newline at end of file
(globalThis["TURBOPACK"] || (globalThis["TURBOPACK"] = [])).push(["output/0_9x_turbopack-tests_tests_snapshot_comptime_cross-module-barrel_input_0pg1--73_0gbu._.js", (()=>{"use strict";(globalThis["TURBOPACK"] || (globalThis["TURBOPACK"] = [])).push(["output/0_9x_turbopack-tests_tests_snapshot_comptime_cross-module-barrel_input_0pg1--73_0gbu._.js",
"[project]/turbopack/crates/turbopack-tests/tests/snapshot/comptime/cross-module-barrel/input/index.js [test] (ecmascript)", ((__turbopack_context__) => { "[project]/turbopack/crates/turbopack-tests/tests/snapshot/comptime/cross-module-barrel/input/index.js [test] (ecmascript)", ((__turbopack_context__) => {
"use strict"; "use strict";
...@@ -28,6 +28,6 @@ function foo() { ...@@ -28,6 +28,6 @@ function foo() {
return 123; return 123;
} }
}), }),
]); ]);})()
//# sourceMappingURL=0_9x_turbopack-tests_tests_snapshot_comptime_cross-module-barrel_input_0pg1--73_0gbu._.js.map //# sourceMappingURL=0_9x_turbopack-tests_tests_snapshot_comptime_cross-module-barrel_input_0pg1--73_0gbu._.js.map
\ No newline at end of file
(globalThis["TURBOPACK"] || (globalThis["TURBOPACK"] = [])).push(["output/1jsg_tests_snapshot_comptime_cross-module-cycle-constant_input_13shj11lx78r9._.js", (()=>{"use strict";(globalThis["TURBOPACK"] || (globalThis["TURBOPACK"] = [])).push(["output/1jsg_tests_snapshot_comptime_cross-module-cycle-constant_input_13shj11lx78r9._.js",
"[project]/turbopack/crates/turbopack-tests/tests/snapshot/comptime/cross-module-cycle-constant/input/index.js [test] (ecmascript)", ((__turbopack_context__) => { "[project]/turbopack/crates/turbopack-tests/tests/snapshot/comptime/cross-module-cycle-constant/input/index.js [test] (ecmascript)", ((__turbopack_context__) => {
"use strict"; "use strict";
...@@ -29,6 +29,6 @@ var __TURBOPACK__imported__module__$5b$project$5d2f$turbopack$2f$crates$2f$turbo ...@@ -29,6 +29,6 @@ var __TURBOPACK__imported__module__$5b$project$5d2f$turbopack$2f$crates$2f$turbo
; ;
const TWO = '2' + __TURBOPACK__imported__module__$5b$project$5d2f$turbopack$2f$crates$2f$turbopack$2d$tests$2f$tests$2f$snapshot$2f$comptime$2f$cross$2d$module$2d$cycle$2d$constant$2f$input$2f$multiple$2d$1$2e$js__$5b$test$5d$__$28$ecmascript$29$__["ONE"]; const TWO = '2' + __TURBOPACK__imported__module__$5b$project$5d2f$turbopack$2f$crates$2f$turbopack$2d$tests$2f$tests$2f$snapshot$2f$comptime$2f$cross$2d$module$2d$cycle$2d$constant$2f$input$2f$multiple$2d$1$2e$js__$5b$test$5d$__$28$ecmascript$29$__["ONE"];
}), }),
]); ]);})()
//# sourceMappingURL=1jsg_tests_snapshot_comptime_cross-module-cycle-constant_input_13shj11lx78r9._.js.map //# sourceMappingURL=1jsg_tests_snapshot_comptime_cross-module-cycle-constant_input_13shj11lx78r9._.js.map
\ No newline at end of file
(globalThis["TURBOPACK"] || (globalThis["TURBOPACK"] = [])).push(["output/1jsg_tests_snapshot_comptime_cross-module-cycle-dynamic_input_0y6rllfq_jecq._.js", (()=>{"use strict";(globalThis["TURBOPACK"] || (globalThis["TURBOPACK"] = [])).push(["output/1jsg_tests_snapshot_comptime_cross-module-cycle-dynamic_input_0y6rllfq_jecq._.js",
"[project]/turbopack/crates/turbopack-tests/tests/snapshot/comptime/cross-module-cycle-dynamic/input/index.js [test] (ecmascript)", ((__turbopack_context__) => { "[project]/turbopack/crates/turbopack-tests/tests/snapshot/comptime/cross-module-cycle-dynamic/input/index.js [test] (ecmascript)", ((__turbopack_context__) => {
"use strict"; "use strict";
...@@ -54,6 +54,6 @@ function foo1(left, right) { ...@@ -54,6 +54,6 @@ function foo1(left, right) {
} }
; ;
}), }),
]); ]);})()
//# sourceMappingURL=1jsg_tests_snapshot_comptime_cross-module-cycle-dynamic_input_0y6rllfq_jecq._.js.map //# sourceMappingURL=1jsg_tests_snapshot_comptime_cross-module-cycle-dynamic_input_0y6rllfq_jecq._.js.map
\ No newline at end of file
(globalThis["TURBOPACK"] || (globalThis["TURBOPACK"] = [])).push(["output/1jsg_tests_snapshot_comptime_cross-module-imported_input_1h-za4-_ttkv-._.js", (()=>{"use strict";(globalThis["TURBOPACK"] || (globalThis["TURBOPACK"] = [])).push(["output/1jsg_tests_snapshot_comptime_cross-module-imported_input_1h-za4-_ttkv-._.js",
"[project]/turbopack/crates/turbopack-tests/tests/snapshot/comptime/cross-module-imported/input/index.js [test] (ecmascript)", ((__turbopack_context__) => { "[project]/turbopack/crates/turbopack-tests/tests/snapshot/comptime/cross-module-imported/input/index.js [test] (ecmascript)", ((__turbopack_context__) => {
"use strict"; "use strict";
...@@ -45,6 +45,6 @@ __turbopack_context__.s([ ...@@ -45,6 +45,6 @@ __turbopack_context__.s([
const REEXPORTED = 'reexported'; const REEXPORTED = 'reexported';
const IMPORTED_EXPORTED = 'imported exported'; const IMPORTED_EXPORTED = 'imported exported';
}), }),
]); ]);})()
//# sourceMappingURL=1jsg_tests_snapshot_comptime_cross-module-imported_input_1h-za4-_ttkv-._.js.map //# sourceMappingURL=1jsg_tests_snapshot_comptime_cross-module-imported_input_1h-za4-_ttkv-._.js.map
\ No newline at end of file
(globalThis["TURBOPACK"] || (globalThis["TURBOPACK"] = [])).push(["output/1jsg_tests_snapshot_comptime_cross-module-long-literals_input_1dlt5gz60hx2n._.js", (()=>{"use strict";(globalThis["TURBOPACK"] || (globalThis["TURBOPACK"] = [])).push(["output/1jsg_tests_snapshot_comptime_cross-module-long-literals_input_1dlt5gz60hx2n._.js",
"[project]/turbopack/crates/turbopack-tests/tests/snapshot/comptime/cross-module-long-literals/input/index.js [test] (ecmascript)", ((__turbopack_context__) => { "[project]/turbopack/crates/turbopack-tests/tests/snapshot/comptime/cross-module-long-literals/input/index.js [test] (ecmascript)", ((__turbopack_context__) => {
"use strict"; "use strict";
...@@ -52,6 +52,6 @@ const REGEX = /ab/i; ...@@ -52,6 +52,6 @@ const REGEX = /ab/i;
const NAN = NaN; const NAN = NaN;
const INFINITY = Infinity; const INFINITY = Infinity;
}), }),
]); ]);})()
//# sourceMappingURL=1jsg_tests_snapshot_comptime_cross-module-long-literals_input_1dlt5gz60hx2n._.js.map //# sourceMappingURL=1jsg_tests_snapshot_comptime_cross-module-long-literals_input_1dlt5gz60hx2n._.js.map
\ No newline at end of file
(globalThis["TURBOPACK"] || (globalThis["TURBOPACK"] = [])).push(["output/0_9x_turbopack-tests_tests_snapshot_comptime_cross-module-strict_input_0lz7wh6sby-77._.js", (()=>{"use strict";(globalThis["TURBOPACK"] || (globalThis["TURBOPACK"] = [])).push(["output/0_9x_turbopack-tests_tests_snapshot_comptime_cross-module-strict_input_0lz7wh6sby-77._.js",
"[project]/turbopack/crates/turbopack-tests/tests/snapshot/comptime/cross-module-strict/input/index.js [test] (ecmascript)", ((__turbopack_context__) => { "[project]/turbopack/crates/turbopack-tests/tests/snapshot/comptime/cross-module-strict/input/index.js [test] (ecmascript)", ((__turbopack_context__) => {
"use strict"; "use strict";
...@@ -51,6 +51,6 @@ const LONG_NUMBER = 21345672345678345678901234567890; ...@@ -51,6 +51,6 @@ const LONG_NUMBER = 21345672345678345678901234567890;
const LONG_BIG_NUMBER = 21345672345678345678901234567890n; const LONG_BIG_NUMBER = 21345672345678345678901234567890n;
const LONG_REGEX = /abcdefghijklmnopqrstuvwxyz0123456789abcdefghijklmnopqrstuvwxyz0123456789/i; const LONG_REGEX = /abcdefghijklmnopqrstuvwxyz0123456789abcdefghijklmnopqrstuvwxyz0123456789/i;
}), }),
]); ]);})()
//# sourceMappingURL=0_9x_turbopack-tests_tests_snapshot_comptime_cross-module-strict_input_0lz7wh6sby-77._.js.map //# sourceMappingURL=0_9x_turbopack-tests_tests_snapshot_comptime_cross-module-strict_input_0lz7wh6sby-77._.js.map
\ No newline at end of file
(globalThis["TURBOPACK"] || (globalThis["TURBOPACK"] = [])).push(["output/1do3_crates_turbopack-tests_tests_snapshot_comptime_early-return_input_00p0fdz0d5nhi._.js", (()=>{"use strict";(globalThis["TURBOPACK"] || (globalThis["TURBOPACK"] = [])).push(["output/1do3_crates_turbopack-tests_tests_snapshot_comptime_early-return_input_00p0fdz0d5nhi._.js",
"[project]/turbopack/crates/turbopack-tests/tests/snapshot/comptime/early-return/input/index.js [test] (ecmascript)", ((__turbopack_context__) => { "[project]/turbopack/crates/turbopack-tests/tests/snapshot/comptime/early-return/input/index.js [test] (ecmascript)", ((__turbopack_context__) => {
"use strict"; "use strict";
...@@ -226,6 +226,6 @@ z1(); ...@@ -226,6 +226,6 @@ z1();
return; return;
z2(); z2();
}), }),
]); ]);})()
//# sourceMappingURL=1do3_crates_turbopack-tests_tests_snapshot_comptime_early-return_input_00p0fdz0d5nhi._.js.map //# sourceMappingURL=1do3_crates_turbopack-tests_tests_snapshot_comptime_early-return_input_00p0fdz0d5nhi._.js.map
\ No newline at end of file
(globalThis["TURBOPACK"] || (globalThis["TURBOPACK"] = [])).push(["output/1do3_crates_turbopack-tests_tests_snapshot_comptime_typeof_input_1y4b353ijz1yk._.js", (globalThis["TURBOPACK"] || (globalThis["TURBOPACK"] = [])).push(["output/1do3_crates_turbopack-tests_tests_snapshot_comptime_typeof_input_1y4b353ijz1yk._.js",
"[project]/turbopack/crates/turbopack-tests/tests/snapshot/comptime/typeof/input/cjs.js [test] (ecmascript)", ((__turbopack_context__, module, exports) => { (()=>{"use strict";return[
var __TURBOPACK__import$2e$meta__ = {
get url () {
return __turbopack_context__.F("turbopack/crates/turbopack-tests/tests/snapshot/comptime/typeof/input/cjs.js");
},
env: {
DEV: true,
PROD: false,
MODE: "development",
BASE_URL: "/",
SSR: false
}
};
console.log('typeof require', ("TURBOPACK compile-time value", "function"));
console.log('typeof import.meta', ("TURBOPACK compile-time value", "object"));
// CJS, should be `object`
console.log('typeof module', ("TURBOPACK compile-time value", "object"));
console.log('typeof exports', ("TURBOPACK compile-time value", "object"));
// CJS, should be real require
console.log(/*TURBOPACK member replacement*/ __turbopack_context__.t);
}),
"[project]/turbopack/crates/turbopack-tests/tests/snapshot/comptime/typeof/input/dep.js [test] (ecmascript)", ((__turbopack_context__, module, exports) => {
}),
"[project]/turbopack/crates/turbopack-tests/tests/snapshot/comptime/typeof/input/esm-automatic.js [test] (ecmascript)", ((__turbopack_context__) => { "[project]/turbopack/crates/turbopack-tests/tests/snapshot/comptime/typeof/input/esm-automatic.js [test] (ecmascript)", ((__turbopack_context__) => {
"use strict"; "use strict";
...@@ -84,6 +60,32 @@ var __TURBOPACK__imported__module__$5b$project$5d2f$turbopack$2f$crates$2f$turbo ...@@ -84,6 +60,32 @@ var __TURBOPACK__imported__module__$5b$project$5d2f$turbopack$2f$crates$2f$turbo
; ;
; ;
; ;
}),
]})(),
"[project]/turbopack/crates/turbopack-tests/tests/snapshot/comptime/typeof/input/cjs.js [test] (ecmascript)", ((__turbopack_context__, module, exports) => {
var __TURBOPACK__import$2e$meta__ = {
get url () {
return __turbopack_context__.F("turbopack/crates/turbopack-tests/tests/snapshot/comptime/typeof/input/cjs.js");
},
env: {
DEV: true,
PROD: false,
MODE: "development",
BASE_URL: "/",
SSR: false
}
};
console.log('typeof require', ("TURBOPACK compile-time value", "function"));
console.log('typeof import.meta', ("TURBOPACK compile-time value", "object"));
// CJS, should be `object`
console.log('typeof module', ("TURBOPACK compile-time value", "object"));
console.log('typeof exports', ("TURBOPACK compile-time value", "object"));
// CJS, should be real require
console.log(/*TURBOPACK member replacement*/ __turbopack_context__.t);
}),
"[project]/turbopack/crates/turbopack-tests/tests/snapshot/comptime/typeof/input/dep.js [test] (ecmascript)", ((__turbopack_context__, module, exports) => {
}), }),
]); ]);
......
...@@ -2,9 +2,9 @@ ...@@ -2,9 +2,9 @@
"version": 3, "version": 3,
"sources": [], "sources": [],
"sections": [ "sections": [
{"offset": {"line": 3, "column": 0}, "map": {"version":3,"sources":["turbopack:///[project]/turbopack/crates/turbopack-tests/tests/snapshot/comptime/typeof/input/cjs.js"],"sourcesContent":["console.log('typeof require', typeof require)\nconsole.log('typeof import.meta', typeof import.meta)\n// CJS, should be `object`\nconsole.log('typeof module', typeof module)\nconsole.log('typeof exports', typeof exports)\n\n// CJS, should be real require\nconsole.log(require)\n"],"names":["console","log"],"mappings":";;;;;;;;;;;;AAAAA,QAAQC,GAAG,CAAC;AACZD,QAAQC,GAAG,CAAC;AACZ,0BAA0B;AAC1BD,QAAQC,GAAG,CAAC;AACZD,QAAQC,GAAG,CAAC;AAEZ,8BAA8B;AAC9BD,QAAQC,GAAG"}}, {"offset": {"line": 5, "column": 0}, "map": {"version":3,"sources":["turbopack:///[project]/turbopack/crates/turbopack-tests/tests/snapshot/comptime/typeof/input/esm-automatic.js"],"sourcesContent":["import './dep.js'\n\nconsole.log('typeof require', typeof require)\nconsole.log('typeof import.meta', typeof import.meta)\n// ESM, should be `undefined`\nconsole.log('typeof module', typeof module)\nconsole.log('typeof exports', typeof exports)\n\n// ESM, should be require stub\nconsole.log(require)\n"],"names":["console","log"],"mappings":";AAAA;;;;;;;;;;;;;;AAEAA,QAAQC,GAAG,CAAC;AACZD,QAAQC,GAAG,CAAC;AACZ,6BAA6B;AAC7BD,QAAQC,GAAG,CAAC;AACZD,QAAQC,GAAG,CAAC;AAEZ,8BAA8B;AAC9BD,QAAQC,GAAG"}},
{"offset": {"line": 25, "column": 0}, "map": {"version":3,"sources":[],"names":[],"mappings":""}}, {"offset": {"line": 31, "column": 0}, "map": {"version":3,"sources":["turbopack:///[project]/turbopack/crates/turbopack-tests/tests/snapshot/comptime/typeof/input/esm-specified.mjs"],"sourcesContent":["console.log('typeof require', typeof require)\nconsole.log('typeof import.meta', typeof import.meta)\n// ESM, should be `undefined`\nconsole.log('typeof module', typeof module)\nconsole.log('typeof exports', typeof exports)\n\n// ESM, should be require stub\nconsole.log(require)\n"],"names":["console","log"],"mappings":";;;;;;;;;;;;;AAAAA,QAAQC,GAAG,CAAC;AACZD,QAAQC,GAAG,CAAC;AACZ,6BAA6B;AAC7BD,QAAQC,GAAG,CAAC;AACZD,QAAQC,GAAG,CAAC;AAEZ,8BAA8B;AAC9BD,QAAQC,GAAG"}},
{"offset": {"line": 29, "column": 0}, "map": {"version":3,"sources":["turbopack:///[project]/turbopack/crates/turbopack-tests/tests/snapshot/comptime/typeof/input/esm-automatic.js"],"sourcesContent":["import './dep.js'\n\nconsole.log('typeof require', typeof require)\nconsole.log('typeof import.meta', typeof import.meta)\n// ESM, should be `undefined`\nconsole.log('typeof module', typeof module)\nconsole.log('typeof exports', typeof exports)\n\n// ESM, should be require stub\nconsole.log(require)\n"],"names":["console","log"],"mappings":";AAAA;;;;;;;;;;;;;;AAEAA,QAAQC,GAAG,CAAC;AACZD,QAAQC,GAAG,CAAC;AACZ,6BAA6B;AAC7BD,QAAQC,GAAG,CAAC;AACZD,QAAQC,GAAG,CAAC;AAEZ,8BAA8B;AAC9BD,QAAQC,GAAG"}}, {"offset": {"line": 55, "column": 0}, "map": {"version":3,"sources":["turbopack:///[project]/turbopack/crates/turbopack-tests/tests/snapshot/comptime/typeof/input/index.js"],"sourcesContent":["import './cjs.js'\nimport './esm-automatic.js'\nimport './esm-specified.mjs'\n"],"names":[],"mappings":";AAAA;AACA;AACA"}},
{"offset": {"line": 55, "column": 0}, "map": {"version":3,"sources":["turbopack:///[project]/turbopack/crates/turbopack-tests/tests/snapshot/comptime/typeof/input/esm-specified.mjs"],"sourcesContent":["console.log('typeof require', typeof require)\nconsole.log('typeof import.meta', typeof import.meta)\n// ESM, should be `undefined`\nconsole.log('typeof module', typeof module)\nconsole.log('typeof exports', typeof exports)\n\n// ESM, should be require stub\nconsole.log(require)\n"],"names":["console","log"],"mappings":";;;;;;;;;;;;;AAAAA,QAAQC,GAAG,CAAC;AACZD,QAAQC,GAAG,CAAC;AACZ,6BAA6B;AAC7BD,QAAQC,GAAG,CAAC;AACZD,QAAQC,GAAG,CAAC;AAEZ,8BAA8B;AAC9BD,QAAQC,GAAG"}}, {"offset": {"line": 66, "column": 0}, "map": {"version":3,"sources":["turbopack:///[project]/turbopack/crates/turbopack-tests/tests/snapshot/comptime/typeof/input/cjs.js"],"sourcesContent":["console.log('typeof require', typeof require)\nconsole.log('typeof import.meta', typeof import.meta)\n// CJS, should be `object`\nconsole.log('typeof module', typeof module)\nconsole.log('typeof exports', typeof exports)\n\n// CJS, should be real require\nconsole.log(require)\n"],"names":["console","log"],"mappings":";;;;;;;;;;;;AAAAA,QAAQC,GAAG,CAAC;AACZD,QAAQC,GAAG,CAAC;AACZ,0BAA0B;AAC1BD,QAAQC,GAAG,CAAC;AACZD,QAAQC,GAAG,CAAC;AAEZ,8BAA8B;AAC9BD,QAAQC,GAAG"}},
{"offset": {"line": 79, "column": 0}, "map": {"version":3,"sources":["turbopack:///[project]/turbopack/crates/turbopack-tests/tests/snapshot/comptime/typeof/input/index.js"],"sourcesContent":["import './cjs.js'\nimport './esm-automatic.js'\nimport './esm-specified.mjs'\n"],"names":[],"mappings":";AAAA;AACA;AACA"}}] {"offset": {"line": 88, "column": 0}, "map": {"version":3,"sources":[],"names":[],"mappings":""}}]
} }
\ No newline at end of file
;!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]="37ea5bcf-f259-1cd1-a144-361dcb52f06f")}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]="77867742-97a1-7739-5b4e-e0fc46a40a42")}catch(e){}}();
(globalThis["TURBOPACK"] || (globalThis["TURBOPACK"] = [])).push([ (globalThis["TURBOPACK"] || (globalThis["TURBOPACK"] = [])).push([
"output/0rv8_turbopack-tests_tests_snapshot_debug-ids_browser_input_index_0bjegbrfzt05o.js", "output/0rv8_turbopack-tests_tests_snapshot_debug-ids_browser_input_index_0bjegbrfzt05o.js",
{"otherChunks":["output/0_9x_turbopack-tests_tests_snapshot_debug-ids_browser_input_index_03ibyvsq4xsbk.js"],"runtimeModuleIds":["[project]/turbopack/crates/turbopack-tests/tests/snapshot/debug-ids/browser/input/index.js [test] (ecmascript)"]} {"otherChunks":["output/0_9x_turbopack-tests_tests_snapshot_debug-ids_browser_input_index_03ibyvsq4xsbk.js"],"runtimeModuleIds":["[project]/turbopack/crates/turbopack-tests/tests/snapshot/debug-ids/browser/input/index.js [test] (ecmascript)"]}
...@@ -437,14 +437,16 @@ contextPrototype.f = moduleContext; ...@@ -437,14 +437,16 @@ contextPrototype.f = moduleContext;
*/ function getChunkPath(chunkData) { */ function getChunkPath(chunkData) {
return typeof chunkData === 'string' ? chunkData : chunkData.path; return typeof chunkData === 'string' ? chunkData : chunkData.path;
} }
// Load the CompressedmoduleFactories of a chunk into the `moduleFactories` Map. // Load the CompressedModuleFactories of a chunk into the `moduleFactories` Map.
// The CompressedModuleFactories format is // The flat format alternates one or more module IDs with their factory function.
// - 1 or more module ids // Strict factories can be prepended as a nested array.
// - a module factory function
// So walking this is a little complex but the flat structure is also fast to
// traverse, we can use `typeof` operators to distinguish the two cases.
function installCompressedModuleFactories(chunkModules, offset, moduleFactories, newModuleId) { function installCompressedModuleFactories(chunkModules, offset, moduleFactories, newModuleId) {
let i = offset; let i = offset;
const strictFactories = chunkModules[i];
if (Array.isArray(strictFactories)) {
installCompressedModuleFactories(strictFactories, 0, moduleFactories, newModuleId);
i++;
}
while(i < chunkModules.length){ while(i < chunkModules.length){
let end = i + 1; let end = i + 1;
// Find our factory function // Find our factory function
...@@ -483,7 +485,7 @@ function installCompressedModuleFactories(chunkModules, offset, moduleFactories, ...@@ -483,7 +485,7 @@ function installCompressedModuleFactories(chunkModules, offset, moduleFactories,
newModuleId?.(id); newModuleId?.(id);
} }
} }
i = end + 1; // end is pointing at the last factory advance to the next id or the end of the array. i = end + 1;
} }
} }
/** /**
...@@ -2495,5 +2497,5 @@ chunkListsToRegister.forEach(registerChunkList); ...@@ -2495,5 +2497,5 @@ chunkListsToRegister.forEach(registerChunkList);
})(); })();
//# debugId=37ea5bcf-f259-1cd1-a144-361dcb52f06f //# debugId=77867742-97a1-7739-5b4e-e0fc46a40a42
//# sourceMappingURL=0_9x_turbopack-tests_tests_snapshot_debug-ids_browser_input_index_0bjegbrfzt05o.js.map //# sourceMappingURL=0_9x_turbopack-tests_tests_snapshot_debug-ids_browser_input_index_0bjegbrfzt05o.js.map
\ No newline at end of file
...@@ -414,14 +414,16 @@ contextPrototype.f = moduleContext; ...@@ -414,14 +414,16 @@ contextPrototype.f = moduleContext;
*/ function getChunkPath(chunkData) { */ function getChunkPath(chunkData) {
return typeof chunkData === 'string' ? chunkData : chunkData.path; return typeof chunkData === 'string' ? chunkData : chunkData.path;
} }
// Load the CompressedmoduleFactories of a chunk into the `moduleFactories` Map. // Load the CompressedModuleFactories of a chunk into the `moduleFactories` Map.
// The CompressedModuleFactories format is // The flat format alternates one or more module IDs with their factory function.
// - 1 or more module ids // Strict factories can be prepended as a nested array.
// - a module factory function
// So walking this is a little complex but the flat structure is also fast to
// traverse, we can use `typeof` operators to distinguish the two cases.
function installCompressedModuleFactories(chunkModules, offset, moduleFactories, newModuleId) { function installCompressedModuleFactories(chunkModules, offset, moduleFactories, newModuleId) {
let i = offset; let i = offset;
const strictFactories = chunkModules[i];
if (Array.isArray(strictFactories)) {
installCompressedModuleFactories(strictFactories, 0, moduleFactories, newModuleId);
i++;
}
while(i < chunkModules.length){ while(i < chunkModules.length){
let end = i + 1; let end = i + 1;
// Find our factory function // Find our factory function
...@@ -460,7 +462,7 @@ function installCompressedModuleFactories(chunkModules, offset, moduleFactories, ...@@ -460,7 +462,7 @@ function installCompressedModuleFactories(chunkModules, offset, moduleFactories,
newModuleId?.(id); newModuleId?.(id);
} }
} }
i = end + 1; // end is pointing at the last factory advance to the next id or the end of the array. i = end + 1;
} }
} }
/** /**
......
(globalThis["TURBOPACK"] || (globalThis["TURBOPACK"] = [])).push(["output/turbopack_crates_turbopack-tests_tests_snapshot_1xzb8pohmqk06._.js", (globalThis["TURBOPACK"] || (globalThis["TURBOPACK"] = [])).push(["output/turbopack_crates_turbopack-tests_tests_snapshot_1xzb8pohmqk06._.js",
(()=>{"use strict";return[
"[project]/turbopack/crates/turbopack-tests/tests/snapshot/emotion/emotion/input/index.js [test] (ecmascript)", ((__turbopack_context__) => { "[project]/turbopack/crates/turbopack-tests/tests/snapshot/emotion/emotion/input/index.js [test] (ecmascript)", ((__turbopack_context__) => {
"use strict"; "use strict";
...@@ -48,6 +49,7 @@ function jsxDEV() { ...@@ -48,6 +49,7 @@ function jsxDEV() {
return 'purposefully empty stub for @emotion/react/jsx-dev-runtime.js'; return 'purposefully empty stub for @emotion/react/jsx-dev-runtime.js';
} }
}), }),
]})(),
"[project]/turbopack/crates/turbopack-tests/tests/snapshot/node_modules/@emotion/styled/index.js [test] (ecmascript)", ((__turbopack_context__, module, exports) => { "[project]/turbopack/crates/turbopack-tests/tests/snapshot/node_modules/@emotion/styled/index.js [test] (ecmascript)", ((__turbopack_context__, module, exports) => {
"purposefully empty stub"; "purposefully empty stub";
......
...@@ -2,8 +2,8 @@ ...@@ -2,8 +2,8 @@
"version": 3, "version": 3,
"sources": [], "sources": [],
"sections": [ "sections": [
{"offset": {"line": 4, "column": 0}, "map": {"version":3,"sources":["turbopack:///[project]/turbopack/crates/turbopack-tests/tests/snapshot/emotion/emotion/input/index.js"],"sourcesContent":["/** @jsxImportSource @emotion/react */\n\nimport { jsx } from '@emotion/react'\nimport styled from '@emotion/styled'\n\nconst StyledButton = styled.button`\n background: blue;\n`\n\nfunction ClassNameButton({ children }) {\n return (\n <button\n className={css`\n background: blue;\n `}\n >\n {children}\n </button>\n )\n}\n\nconsole.log(StyledButton, ClassNameButton)\n"],"names":["StyledButton","ClassNameButton","children","className","css","console","log"],"mappings":";;AAAA,oCAAoC,GAEpC;AACA;;;;AAEA,MAAMA,iCAAe,mNAAM;;;AAI3B,SAASC,gBAAgB,EAAEC,QAAQ,EAAE;IACnC,qBACE,uOAAC;QACCC,WAAWC,GAAG,CAAC;;MAEf,CAAC;kBAEAF;;;;;;AAGP;AAEAG,QAAQC,GAAG,CAACN,cAAcC"}}, {"offset": {"line": 5, "column": 0}, "map": {"version":3,"sources":["turbopack:///[project]/turbopack/crates/turbopack-tests/tests/snapshot/emotion/emotion/input/index.js"],"sourcesContent":["/** @jsxImportSource @emotion/react */\n\nimport { jsx } from '@emotion/react'\nimport styled from '@emotion/styled'\n\nconst StyledButton = styled.button`\n background: blue;\n`\n\nfunction ClassNameButton({ children }) {\n return (\n <button\n className={css`\n background: blue;\n `}\n >\n {children}\n </button>\n )\n}\n\nconsole.log(StyledButton, ClassNameButton)\n"],"names":["StyledButton","ClassNameButton","children","className","css","console","log"],"mappings":";;AAAA,oCAAoC,GAEpC;AACA;;;;AAEA,MAAMA,iCAAe,mNAAM;;;AAI3B,SAASC,gBAAgB,EAAEC,QAAQ,EAAE;IACnC,qBACE,uOAAC;QACCC,WAAWC,GAAG,CAAC;;MAEf,CAAC;kBAEAF;;;;;;AAGP;AAEAG,QAAQC,GAAG,CAACN,cAAcC"}},
{"offset": {"line": 31, "column": 0}, "map": {"version":3,"sources":["turbopack:///[project]/turbopack/crates/turbopack-tests/tests/snapshot/node_modules/@emotion/react/index.js"],"sourcesContent":["export function jsx() {\n return 'purposefully empty stub for @emotion/react/index.js'\n}\n"],"names":["jsx"],"mappings":";;;;AAAO,SAASA;IACd,OAAO;AACT","ignoreList":[0]}}, {"offset": {"line": 32, "column": 0}, "map": {"version":3,"sources":["turbopack:///[project]/turbopack/crates/turbopack-tests/tests/snapshot/node_modules/@emotion/react/index.js"],"sourcesContent":["export function jsx() {\n return 'purposefully empty stub for @emotion/react/index.js'\n}\n"],"names":["jsx"],"mappings":";;;;AAAO,SAASA;IACd,OAAO;AACT","ignoreList":[0]}},
{"offset": {"line": 42, "column": 0}, "map": {"version":3,"sources":["turbopack:///[project]/turbopack/crates/turbopack-tests/tests/snapshot/node_modules/@emotion/react/jsx-dev-runtime.js"],"sourcesContent":["export function jsxDEV() {\n return 'purposefully empty stub for @emotion/react/jsx-dev-runtime.js'\n}\n"],"names":["jsxDEV"],"mappings":";;;;AAAO,SAASA;IACd,OAAO;AACT","ignoreList":[0]}}, {"offset": {"line": 43, "column": 0}, "map": {"version":3,"sources":["turbopack:///[project]/turbopack/crates/turbopack-tests/tests/snapshot/node_modules/@emotion/react/jsx-dev-runtime.js"],"sourcesContent":["export function jsxDEV() {\n return 'purposefully empty stub for @emotion/react/jsx-dev-runtime.js'\n}\n"],"names":["jsxDEV"],"mappings":";;;;AAAO,SAASA;IACd,OAAO;AACT","ignoreList":[0]}},
{"offset": {"line": 52, "column": 0}, "map": {"version":3,"sources":["turbopack:///[project]/turbopack/crates/turbopack-tests/tests/snapshot/node_modules/@emotion/styled/index.js"],"sourcesContent":["\"purposefully empty stub\";\n\"@emtion/styled/index.js\";\n"],"names":[],"mappings":"AAAA;AACA","ignoreList":[0]}}] {"offset": {"line": 54, "column": 0}, "map": {"version":3,"sources":["turbopack:///[project]/turbopack/crates/turbopack-tests/tests/snapshot/node_modules/@emotion/styled/index.js"],"sourcesContent":["\"purposefully empty stub\";\n\"@emtion/styled/index.js\";\n"],"names":[],"mappings":"AAAA;AACA","ignoreList":[0]}}]
} }
\ No newline at end of file
(globalThis["TURBOPACK"] || (globalThis["TURBOPACK"] = [])).push(["output/1do3_crates_turbopack-tests_tests_snapshot_export-alls_cjs-2_input_212xd9jyjh6hy._.js", (globalThis["TURBOPACK"] || (globalThis["TURBOPACK"] = [])).push(["output/1do3_crates_turbopack-tests_tests_snapshot_export-alls_cjs-2_input_212xd9jyjh6hy._.js",
(()=>{"use strict";return[
"[project]/turbopack/crates/turbopack-tests/tests/snapshot/export-alls/cjs-2/input/b.js [test] (ecmascript)", ((__turbopack_context__) => { "[project]/turbopack/crates/turbopack-tests/tests/snapshot/export-alls/cjs-2/input/b.js [test] (ecmascript)", ((__turbopack_context__) => {
"use strict"; "use strict";
...@@ -18,11 +19,6 @@ var __TURBOPACK__imported__module__$5b$project$5d2f$turbopack$2f$crates$2f$turbo ...@@ -18,11 +19,6 @@ var __TURBOPACK__imported__module__$5b$project$5d2f$turbopack$2f$crates$2f$turbo
__turbopack_context__.j(__TURBOPACK__imported__module__$5b$project$5d2f$turbopack$2f$crates$2f$turbopack$2d$tests$2f$tests$2f$snapshot$2f$export$2d$alls$2f$cjs$2d$2$2f$input$2f$commonjs$2e$js__$5b$test$5d$__$28$ecmascript$29$__); __turbopack_context__.j(__TURBOPACK__imported__module__$5b$project$5d2f$turbopack$2f$crates$2f$turbopack$2d$tests$2f$tests$2f$snapshot$2f$export$2d$alls$2f$cjs$2d$2$2f$input$2f$commonjs$2e$js__$5b$test$5d$__$28$ecmascript$29$__);
; ;
}), }),
"[project]/turbopack/crates/turbopack-tests/tests/snapshot/export-alls/cjs-2/input/commonjs.js [test] (ecmascript)", ((__turbopack_context__, module, exports) => {
// commonjs.js
exports.hello = 'World';
}),
"[project]/turbopack/crates/turbopack-tests/tests/snapshot/export-alls/cjs-2/input/index.js [test] (ecmascript)", ((__turbopack_context__) => { "[project]/turbopack/crates/turbopack-tests/tests/snapshot/export-alls/cjs-2/input/index.js [test] (ecmascript)", ((__turbopack_context__) => {
"use strict"; "use strict";
...@@ -32,6 +28,12 @@ var __TURBOPACK__imported__module__$5b$project$5d2f$turbopack$2f$crates$2f$turbo ...@@ -32,6 +28,12 @@ var __TURBOPACK__imported__module__$5b$project$5d2f$turbopack$2f$crates$2f$turbo
; ;
console.log(__TURBOPACK__imported__module__$5b$project$5d2f$turbopack$2f$crates$2f$turbopack$2d$tests$2f$tests$2f$snapshot$2f$export$2d$alls$2f$cjs$2d$2$2f$input$2f$b$2e$js__$5b$test$5d$__$28$ecmascript$29$__); console.log(__TURBOPACK__imported__module__$5b$project$5d2f$turbopack$2f$crates$2f$turbopack$2d$tests$2f$tests$2f$snapshot$2f$export$2d$alls$2f$cjs$2d$2$2f$input$2f$b$2e$js__$5b$test$5d$__$28$ecmascript$29$__);
}), }),
]})(),
"[project]/turbopack/crates/turbopack-tests/tests/snapshot/export-alls/cjs-2/input/commonjs.js [test] (ecmascript)", ((__turbopack_context__, module, exports) => {
// commonjs.js
exports.hello = 'World';
}),
]); ]);
//# sourceMappingURL=1do3_crates_turbopack-tests_tests_snapshot_export-alls_cjs-2_input_212xd9jyjh6hy._.js.map //# sourceMappingURL=1do3_crates_turbopack-tests_tests_snapshot_export-alls_cjs-2_input_212xd9jyjh6hy._.js.map
\ No newline at end of file
...@@ -2,8 +2,8 @@ ...@@ -2,8 +2,8 @@
"version": 3, "version": 3,
"sources": [], "sources": [],
"sections": [ "sections": [
{"offset": {"line": 4, "column": 0}, "map": {"version":3,"sources":["turbopack:///[project]/turbopack/crates/turbopack-tests/tests/snapshot/export-alls/cjs-2/input/b.js"],"sourcesContent":["// b.js\nexport * from './c'\n// This would not be handled, but still need __turbopack__cjs__\n// as there are properties dynamically added by __turbopack__cjs__ in c.js\n"],"names":[],"mappings":";AAAA,OAAO;AACP,kVACA,+DAA+D;CAC/D,0EAA0E"}}, {"offset": {"line": 5, "column": 0}, "map": {"version":3,"sources":["turbopack:///[project]/turbopack/crates/turbopack-tests/tests/snapshot/export-alls/cjs-2/input/b.js"],"sourcesContent":["// b.js\nexport * from './c'\n// This would not be handled, but still need __turbopack__cjs__\n// as there are properties dynamically added by __turbopack__cjs__ in c.js\n"],"names":[],"mappings":";AAAA,OAAO;AACP,kVACA,+DAA+D;CAC/D,0EAA0E"}},
{"offset": {"line": 14, "column": 0}, "map": {"version":3,"sources":["turbopack:///[project]/turbopack/crates/turbopack-tests/tests/snapshot/export-alls/cjs-2/input/c.js"],"sourcesContent":["// c.js\nexport * from './commonjs.js'\n// This would be handled by existing logic\n"],"names":[],"mappings":";AAAA,OAAO;AACP,gWACA,0CAA0C"}}, {"offset": {"line": 15, "column": 0}, "map": {"version":3,"sources":["turbopack:///[project]/turbopack/crates/turbopack-tests/tests/snapshot/export-alls/cjs-2/input/c.js"],"sourcesContent":["// c.js\nexport * from './commonjs.js'\n// This would be handled by existing logic\n"],"names":[],"mappings":";AAAA,OAAO;AACP,gWACA,0CAA0C"}},
{"offset": {"line": 22, "column": 0}, "map": {"version":3,"sources":["turbopack:///[project]/turbopack/crates/turbopack-tests/tests/snapshot/export-alls/cjs-2/input/commonjs.js"],"sourcesContent":["// commonjs.js\nexports.hello = 'World'\n"],"names":["exports","hello"],"mappings":"AAAA,cAAc;AACdA,QAAQC,KAAK,GAAG"}}, {"offset": {"line": 24, "column": 0}, "map": {"version":3,"sources":["turbopack:///[project]/turbopack/crates/turbopack-tests/tests/snapshot/export-alls/cjs-2/input/index.js"],"sourcesContent":["// a.js\nimport * as B from './b'\nconsole.log(B)\n"],"names":["console","log","imported module [project]/turbopack/crates/turbopack-tests/tests/snapshot/export-alls/cjs-2/input/b.js [test] (ecmascript)"],"mappings":";AAAA,OAAO;AACP;;AACAA,QAAQC,GAAG,CAACC"}},
{"offset": {"line": 28, "column": 0}, "map": {"version":3,"sources":["turbopack:///[project]/turbopack/crates/turbopack-tests/tests/snapshot/export-alls/cjs-2/input/index.js"],"sourcesContent":["// a.js\nimport * as B from './b'\nconsole.log(B)\n"],"names":["console","log","imported module [project]/turbopack/crates/turbopack-tests/tests/snapshot/export-alls/cjs-2/input/b.js [test] (ecmascript)"],"mappings":";AAAA,OAAO;AACP;;AACAA,QAAQC,GAAG,CAACC"}}] {"offset": {"line": 33, "column": 0}, "map": {"version":3,"sources":["turbopack:///[project]/turbopack/crates/turbopack-tests/tests/snapshot/export-alls/cjs-2/input/commonjs.js"],"sourcesContent":["// commonjs.js\nexports.hello = 'World'\n"],"names":["exports","hello"],"mappings":"AAAA,cAAc;AACdA,QAAQC,KAAK,GAAG"}}]
} }
\ No newline at end of file
(globalThis["TURBOPACK"] || (globalThis["TURBOPACK"] = [])).push(["output/0_9x_turbopack-tests_tests_snapshot_import-meta_esm-multiple_input_0__oir9q6_sm5._.js", (()=>{"use strict";(globalThis["TURBOPACK"] || (globalThis["TURBOPACK"] = [])).push(["output/0_9x_turbopack-tests_tests_snapshot_import-meta_esm-multiple_input_0__oir9q6_sm5._.js",
"[project]/turbopack/crates/turbopack-tests/tests/snapshot/import-meta/esm-multiple/input/index.js [test] (ecmascript)", ((__turbopack_context__) => { "[project]/turbopack/crates/turbopack-tests/tests/snapshot/import-meta/esm-multiple/input/index.js [test] (ecmascript)", ((__turbopack_context__) => {
"use strict"; "use strict";
...@@ -31,6 +31,6 @@ function bar() { ...@@ -31,6 +31,6 @@ function bar() {
foo(); foo();
bar(); bar();
}), }),
]); ]);})()
//# sourceMappingURL=0_9x_turbopack-tests_tests_snapshot_import-meta_esm-multiple_input_0__oir9q6_sm5._.js.map //# sourceMappingURL=0_9x_turbopack-tests_tests_snapshot_import-meta_esm-multiple_input_0__oir9q6_sm5._.js.map
\ No newline at end of file
(globalThis["TURBOPACK"] || (globalThis["TURBOPACK"] = [])).push(["output/0_9x_turbopack-tests_tests_snapshot_import-meta_esm-mutable_input_20u-wgbvzfds9._.js", (()=>{"use strict";(globalThis["TURBOPACK"] || (globalThis["TURBOPACK"] = [])).push(["output/0_9x_turbopack-tests_tests_snapshot_import-meta_esm-mutable_input_20u-wgbvzfds9._.js",
"[project]/turbopack/crates/turbopack-tests/tests/snapshot/import-meta/esm-mutable/input/index.js [test] (ecmascript)", ((__turbopack_context__) => { "[project]/turbopack/crates/turbopack-tests/tests/snapshot/import-meta/esm-mutable/input/index.js [test] (ecmascript)", ((__turbopack_context__) => {
"use strict"; "use strict";
...@@ -24,6 +24,6 @@ var __TURBOPACK__import$2e$meta__ = { ...@@ -24,6 +24,6 @@ var __TURBOPACK__import$2e$meta__ = {
}; };
__TURBOPACK__import$2e$meta__.foo = 1; __TURBOPACK__import$2e$meta__.foo = 1;
}), }),
]); ]);})()
//# sourceMappingURL=0_9x_turbopack-tests_tests_snapshot_import-meta_esm-mutable_input_20u-wgbvzfds9._.js.map //# sourceMappingURL=0_9x_turbopack-tests_tests_snapshot_import-meta_esm-mutable_input_20u-wgbvzfds9._.js.map
\ No newline at end of file
(globalThis["TURBOPACK"] || (globalThis["TURBOPACK"] = [])).push(["output/0_9x_turbopack-tests_tests_snapshot_import-meta_esm-object_input_0akuaiya2a112._.js", (()=>{"use strict";(globalThis["TURBOPACK"] || (globalThis["TURBOPACK"] = [])).push(["output/0_9x_turbopack-tests_tests_snapshot_import-meta_esm-object_input_0akuaiya2a112._.js",
"[project]/turbopack/crates/turbopack-tests/tests/snapshot/import-meta/esm-object/input/index.js [test] (ecmascript)", ((__turbopack_context__) => { "[project]/turbopack/crates/turbopack-tests/tests/snapshot/import-meta/esm-object/input/index.js [test] (ecmascript)", ((__turbopack_context__) => {
"use strict"; "use strict";
...@@ -24,6 +24,6 @@ var __TURBOPACK__import$2e$meta__ = { ...@@ -24,6 +24,6 @@ var __TURBOPACK__import$2e$meta__ = {
}; };
console.log(__TURBOPACK__import$2e$meta__); console.log(__TURBOPACK__import$2e$meta__);
}), }),
]); ]);})()
//# sourceMappingURL=0_9x_turbopack-tests_tests_snapshot_import-meta_esm-object_input_0akuaiya2a112._.js.map //# sourceMappingURL=0_9x_turbopack-tests_tests_snapshot_import-meta_esm-object_input_0akuaiya2a112._.js.map
\ No newline at end of file
(globalThis["TURBOPACK"] || (globalThis["TURBOPACK"] = [])).push(["output/1do3_crates_turbopack-tests_tests_snapshot_import-meta_esm_input_0m4yc4rpllbvz._.js", (()=>{"use strict";(globalThis["TURBOPACK"] || (globalThis["TURBOPACK"] = [])).push(["output/1do3_crates_turbopack-tests_tests_snapshot_import-meta_esm_input_0m4yc4rpllbvz._.js",
"[project]/turbopack/crates/turbopack-tests/tests/snapshot/import-meta/esm/input/index.js [test] (ecmascript)", ((__turbopack_context__) => { "[project]/turbopack/crates/turbopack-tests/tests/snapshot/import-meta/esm/input/index.js [test] (ecmascript)", ((__turbopack_context__) => {
"use strict"; "use strict";
...@@ -24,6 +24,6 @@ var __TURBOPACK__import$2e$meta__ = { ...@@ -24,6 +24,6 @@ var __TURBOPACK__import$2e$meta__ = {
}; };
console.log(__TURBOPACK__import$2e$meta__.url); console.log(__TURBOPACK__import$2e$meta__.url);
}), }),
]); ]);})()
//# sourceMappingURL=1do3_crates_turbopack-tests_tests_snapshot_import-meta_esm_input_0m4yc4rpllbvz._.js.map //# sourceMappingURL=1do3_crates_turbopack-tests_tests_snapshot_import-meta_esm_input_0m4yc4rpllbvz._.js.map
\ No newline at end of file
(globalThis["TURBOPACK"] || (globalThis["TURBOPACK"] = [])).push(["output/0_9x_turbopack-tests_tests_snapshot_imports_duplicate-binding_input_05k3-r-zlo2y8._.js", (()=>{"use strict";(globalThis["TURBOPACK"] || (globalThis["TURBOPACK"] = [])).push(["output/0_9x_turbopack-tests_tests_snapshot_imports_duplicate-binding_input_05k3-r-zlo2y8._.js",
"[project]/turbopack/crates/turbopack-tests/tests/snapshot/imports/duplicate-binding/input/index.js [test] (ecmascript)", ((__turbopack_context__) => { "[project]/turbopack/crates/turbopack-tests/tests/snapshot/imports/duplicate-binding/input/index.js [test] (ecmascript)", ((__turbopack_context__) => {
"use strict"; "use strict";
...@@ -23,6 +23,6 @@ const Table = ()=>{ ...@@ -23,6 +23,6 @@ const Table = ()=>{
return 'table'; return 'table';
}; };
}), }),
]); ]);})()
//# sourceMappingURL=0_9x_turbopack-tests_tests_snapshot_imports_duplicate-binding_input_05k3-r-zlo2y8._.js.map //# sourceMappingURL=0_9x_turbopack-tests_tests_snapshot_imports_duplicate-binding_input_05k3-r-zlo2y8._.js.map
\ No newline at end of file
(globalThis["TURBOPACK"] || (globalThis["TURBOPACK"] = [])).push(["output/1do3_crates_turbopack-tests_tests_snapshot_imports_order_input_1wfk3l4bfp2ys._.js", (()=>{"use strict";(globalThis["TURBOPACK"] || (globalThis["TURBOPACK"] = [])).push(["output/1do3_crates_turbopack-tests_tests_snapshot_imports_order_input_1wfk3l4bfp2ys._.js",
"[project]/turbopack/crates/turbopack-tests/tests/snapshot/imports/order/input/index.js [test] (ecmascript)", ((__turbopack_context__) => { "[project]/turbopack/crates/turbopack-tests/tests/snapshot/imports/order/input/index.js [test] (ecmascript)", ((__turbopack_context__) => {
"use strict"; "use strict";
...@@ -21,6 +21,6 @@ const __TURBOPACK__default__export__ = { ...@@ -21,6 +21,6 @@ const __TURBOPACK__default__export__ = {
js: true js: true
}; };
}), }),
]); ]);})()
//# sourceMappingURL=1do3_crates_turbopack-tests_tests_snapshot_imports_order_input_1wfk3l4bfp2ys._.js.map //# sourceMappingURL=1do3_crates_turbopack-tests_tests_snapshot_imports_order_input_1wfk3l4bfp2ys._.js.map
\ No newline at end of file
(globalThis["TURBOPACK"] || (globalThis["TURBOPACK"] = [])).push(["output/0_9x_turbopack-tests_tests_snapshot_imports_static-and-dynamic_input_0dm2mkcc8iok2._.js", (()=>{"use strict";(globalThis["TURBOPACK"] || (globalThis["TURBOPACK"] = [])).push(["output/0_9x_turbopack-tests_tests_snapshot_imports_static-and-dynamic_input_0dm2mkcc8iok2._.js",
"[project]/turbopack/crates/turbopack-tests/tests/snapshot/imports/static-and-dynamic/input/index.js [test] (ecmascript)", ((__turbopack_context__) => { "[project]/turbopack/crates/turbopack-tests/tests/snapshot/imports/static-and-dynamic/input/index.js [test] (ecmascript)", ((__turbopack_context__) => {
"use strict"; "use strict";
...@@ -17,6 +17,6 @@ __turbopack_context__.s([ ...@@ -17,6 +17,6 @@ __turbopack_context__.s([
]); ]);
const __TURBOPACK__default__export__ = 'turbopack'; const __TURBOPACK__default__export__ = 'turbopack';
}), }),
]); ]);})()
//# sourceMappingURL=0_9x_turbopack-tests_tests_snapshot_imports_static-and-dynamic_input_0dm2mkcc8iok2._.js.map //# sourceMappingURL=0_9x_turbopack-tests_tests_snapshot_imports_static-and-dynamic_input_0dm2mkcc8iok2._.js.map
\ No newline at end of file
(globalThis["TURBOPACK"] || (globalThis["TURBOPACK"] = [])).push(["output/1jsg_tests_snapshot_intermediate-tree-shake_reexport-with-locals_input_0fa40prz2spda._.js", (()=>{"use strict";(globalThis["TURBOPACK"] || (globalThis["TURBOPACK"] = [])).push(["output/1jsg_tests_snapshot_intermediate-tree-shake_reexport-with-locals_input_0fa40prz2spda._.js",
"[project]/turbopack/crates/turbopack-tests/tests/snapshot/intermediate-tree-shake/reexport-with-locals/input/index.js [test] (ecmascript)", ((__turbopack_context__) => { "[project]/turbopack/crates/turbopack-tests/tests/snapshot/intermediate-tree-shake/reexport-with-locals/input/index.js [test] (ecmascript)", ((__turbopack_context__) => {
"use strict"; "use strict";
...@@ -49,6 +49,6 @@ __turbopack_context__.s([]); ...@@ -49,6 +49,6 @@ __turbopack_context__.s([]);
function unusedStar() {} function unusedStar() {}
__turbopack_context__.s([]); __turbopack_context__.s([]);
}), }),
]); ]);})()
//# sourceMappingURL=1jsg_tests_snapshot_intermediate-tree-shake_reexport-with-locals_input_0fa40prz2spda._.js.map //# sourceMappingURL=1jsg_tests_snapshot_intermediate-tree-shake_reexport-with-locals_input_0fa40prz2spda._.js.map
\ No newline at end of file
(globalThis["TURBOPACK"] || (globalThis["TURBOPACK"] = [])).push(["output/154e_intermediate-tree-shake_rename-side-effect-free-facade_input_1nl1qrj_-qqwu._.js", (()=>{"use strict";(globalThis["TURBOPACK"] || (globalThis["TURBOPACK"] = [])).push(["output/154e_intermediate-tree-shake_rename-side-effect-free-facade_input_1nl1qrj_-qqwu._.js",
"[project]/turbopack/crates/turbopack-tests/tests/snapshot/intermediate-tree-shake/rename-side-effect-free-facade/input/index.js [test] (ecmascript)", ((__turbopack_context__) => { "[project]/turbopack/crates/turbopack-tests/tests/snapshot/intermediate-tree-shake/rename-side-effect-free-facade/input/index.js [test] (ecmascript)", ((__turbopack_context__) => {
"use strict"; "use strict";
...@@ -27,6 +27,6 @@ __turbopack_context__.s([ ...@@ -27,6 +27,6 @@ __turbopack_context__.s([
()=>__TURBOPACK__imported__module__$5b$project$5d2f$turbopack$2f$crates$2f$turbopack$2d$tests$2f$tests$2f$snapshot$2f$intermediate$2d$tree$2d$shake$2f$rename$2d$side$2d$effect$2d$free$2d$facade$2f$input$2f$node_modules$2f$lib$2f$a$2e$js__$5b$test$5d$__$28$ecmascript$29$__["a"] ()=>__TURBOPACK__imported__module__$5b$project$5d2f$turbopack$2f$crates$2f$turbopack$2d$tests$2f$tests$2f$snapshot$2f$intermediate$2d$tree$2d$shake$2f$rename$2d$side$2d$effect$2d$free$2d$facade$2f$input$2f$node_modules$2f$lib$2f$a$2e$js__$5b$test$5d$__$28$ecmascript$29$__["a"]
]); ]);
}), }),
]); ]);})()
//# sourceMappingURL=154e_intermediate-tree-shake_rename-side-effect-free-facade_input_1nl1qrj_-qqwu._.js.map //# sourceMappingURL=154e_intermediate-tree-shake_rename-side-effect-free-facade_input_1nl1qrj_-qqwu._.js.map
\ No newline at end of file
(globalThis["TURBOPACK"] || (globalThis["TURBOPACK"] = [])).push(["output/1jsg_tests_snapshot_intermediate-tree-shake_tree-shake-test-1_input_1mlxku40v_-py._.js", (()=>{"use strict";(globalThis["TURBOPACK"] || (globalThis["TURBOPACK"] = [])).push(["output/1jsg_tests_snapshot_intermediate-tree-shake_tree-shake-test-1_input_1mlxku40v_-py._.js",
"[project]/turbopack/crates/turbopack-tests/tests/snapshot/intermediate-tree-shake/tree-shake-test-1/input/index.js [test] (ecmascript)", ((__turbopack_context__) => { "[project]/turbopack/crates/turbopack-tests/tests/snapshot/intermediate-tree-shake/tree-shake-test-1/input/index.js [test] (ecmascript)", ((__turbopack_context__) => {
"use strict"; "use strict";
...@@ -27,6 +27,6 @@ __turbopack_context__.s([ ...@@ -27,6 +27,6 @@ __turbopack_context__.s([
getCat getCat
]); ]);
}), }),
]); ]);})()
//# sourceMappingURL=1jsg_tests_snapshot_intermediate-tree-shake_tree-shake-test-1_input_1mlxku40v_-py._.js.map //# sourceMappingURL=1jsg_tests_snapshot_intermediate-tree-shake_tree-shake-test-1_input_1mlxku40v_-py._.js.map
\ No newline at end of file
module.exports=["[project]/turbopack/crates/turbopack-tests/tests/snapshot/mangle-exports/escaping-namespace/input/escaping.js [test] (ecmascript)",t=>{"use strict";t.s(["anotherLongExportName",0,"long-2","someLongExportName",0,"long-1"])},"[project]/turbopack/crates/turbopack-tests/tests/snapshot/mangle-exports/escaping-namespace/input/index.js [test] (ecmascript)",t=>{"use strict";var s=t.i("[project]/turbopack/crates/turbopack-tests/tests/snapshot/mangle-exports/escaping-namespace/input/escaping.js [test] (ecmascript)"),e=t.i("[project]/turbopack/crates/turbopack-tests/tests/snapshot/mangle-exports/escaping-namespace/input/mangled.js [test] (ecmascript)");console.log(s,e.z,e.T),t.s([])},"[project]/turbopack/crates/turbopack-tests/tests/snapshot/mangle-exports/escaping-namespace/input/mangled.js [test] (ecmascript)",t=>{"use strict";t.s(["T",0,"mangled-2","z",0,"mangled-1"])}]; (()=>{"use strict";module.exports=["[project]/turbopack/crates/turbopack-tests/tests/snapshot/mangle-exports/escaping-namespace/input/escaping.js [test] (ecmascript)",t=>{t.s(["anotherLongExportName",0,"long-2","someLongExportName",0,"long-1"])},"[project]/turbopack/crates/turbopack-tests/tests/snapshot/mangle-exports/escaping-namespace/input/index.js [test] (ecmascript)",t=>{var s=t.i("[project]/turbopack/crates/turbopack-tests/tests/snapshot/mangle-exports/escaping-namespace/input/escaping.js [test] (ecmascript)"),e=t.i("[project]/turbopack/crates/turbopack-tests/tests/snapshot/mangle-exports/escaping-namespace/input/mangled.js [test] (ecmascript)");console.log(s,e.z,e.T),t.s([])},"[project]/turbopack/crates/turbopack-tests/tests/snapshot/mangle-exports/escaping-namespace/input/mangled.js [test] (ecmascript)",t=>{t.s(["T",0,"mangled-2","z",0,"mangled-1"])}]})();
//# sourceMappingURL=1jsg_tests_snapshot_mangle-exports_escaping-namespace_input_1ysta134r3dyz._.js.map //# sourceMappingURL=1jsg_tests_snapshot_mangle-exports_escaping-namespace_input_1ysta134r3dyz._.js.map
\ No newline at end of file
{"version":3,"sources":["turbopack:///[project]/turbopack/crates/turbopack-tests/tests/snapshot/mangle-exports/escaping-namespace/input/escaping.js","turbopack:///[project]/turbopack/crates/turbopack-tests/tests/snapshot/mangle-exports/escaping-namespace/input/index.js","turbopack:///[project]/turbopack/crates/turbopack-tests/tests/snapshot/mangle-exports/escaping-namespace/input/mangled.js"],"sourcesContent":["// A namespace object of this module escapes, so it keeps its original export names.\nexport const someLongExportName = 'long-1'\nexport const anotherLongExportName = 'long-2'\n","import * as escaping from './escaping.js'\nimport { someLongExportName, anotherLongExportName } from './mangled.js'\n\nconst leak = () => escaping\n\nconsole.log(leak(), someLongExportName, anotherLongExportName)\n","// Nothing escapes here, so this module in the same graph is still mangled.\nexport const someLongExportName = 'mangled-1'\nexport const anotherLongExportName = 'mangled-2'\n"],"names":["someLongExportName","anotherLongExportName","leak","imported module [project]/turbopack/crates/turbopack-tests/tests/snapshot/mangle-exports/escaping-namespace/input/escaping.js [test] (ecmascript)","console","log"],"mappings":"oMAEqC,gCADH,8JCDlC,IAAA,EAAA,EAAA,CAAA,CAAA,qIACA,EAAA,EAAA,CAAA,CAAA,oIAIAI,QAAQC,GAAG,CAFQF,AAEPD,EAAQ,EAAA,CAAkB,CAAE,EAAA,CAAqB,0KCHxB,kBADH"} {"version":3,"sources":["turbopack:///[project]/turbopack/crates/turbopack-tests/tests/snapshot/mangle-exports/escaping-namespace/input/escaping.js","turbopack:///[project]/turbopack/crates/turbopack-tests/tests/snapshot/mangle-exports/escaping-namespace/input/index.js","turbopack:///[project]/turbopack/crates/turbopack-tests/tests/snapshot/mangle-exports/escaping-namespace/input/mangled.js"],"sourcesContent":["// A namespace object of this module escapes, so it keeps its original export names.\nexport const someLongExportName = 'long-1'\nexport const anotherLongExportName = 'long-2'\n","import * as escaping from './escaping.js'\nimport { someLongExportName, anotherLongExportName } from './mangled.js'\n\nconst leak = () => escaping\n\nconsole.log(leak(), someLongExportName, anotherLongExportName)\n","// Nothing escapes here, so this module in the same graph is still mangled.\nexport const someLongExportName = 'mangled-1'\nexport const anotherLongExportName = 'mangled-2'\n"],"names":["someLongExportName","anotherLongExportName","leak","imported module [project]/turbopack/crates/turbopack-tests/tests/snapshot/mangle-exports/escaping-namespace/input/escaping.js [test] (ecmascript)","console","log"],"mappings":"0MAEqC,gCADH,iJCDlC,IAAA,EAAA,EAAA,CAAA,CAAA,qIACA,EAAA,EAAA,CAAA,CAAA,oIAIAI,QAAQC,GAAG,CAFQF,AAEPD,EAAQ,EAAA,CAAkB,CAAE,EAAA,CAAqB,6JCHxB,kBADH"}
\ No newline at end of file \ No newline at end of file
module.exports=["[project]/turbopack/crates/turbopack-tests/tests/snapshot/mangle-exports/named-and-preserved/input/index.js [test] (ecmascript)",t=>{"use strict";var s=t.i("[project]/turbopack/crates/turbopack-tests/tests/snapshot/mangle-exports/named-and-preserved/input/lib.js [test] (ecmascript)");console.log(s.a,s.$,s.z,s.T,(0,s.X)()),t.s([])},"[project]/turbopack/crates/turbopack-tests/tests/snapshot/mangle-exports/named-and-preserved/input/lib.js [test] (ecmascript)",t=>{"use strict";t.s(["a",0,"a","X",0,function(){return"fn"},"T",0,"long-2","$",0,"bb","z",0,"long-1"])}]; (()=>{"use strict";module.exports=["[project]/turbopack/crates/turbopack-tests/tests/snapshot/mangle-exports/named-and-preserved/input/index.js [test] (ecmascript)",t=>{var e=t.i("[project]/turbopack/crates/turbopack-tests/tests/snapshot/mangle-exports/named-and-preserved/input/lib.js [test] (ecmascript)");console.log(e.a,e.$,e.z,e.T,(0,e.X)()),t.s([])},"[project]/turbopack/crates/turbopack-tests/tests/snapshot/mangle-exports/named-and-preserved/input/lib.js [test] (ecmascript)",t=>{t.s(["a",0,"a","X",0,function(){return"fn"},"T",0,"long-2","$",0,"bb","z",0,"long-1"])}]})();
//# sourceMappingURL=1jsg_tests_snapshot_mangle-exports_named-and-preserved_input_0pbreftkp_5pc._.js.map //# sourceMappingURL=1jsg_tests_snapshot_mangle-exports_named-and-preserved_input_0pbreftkp_5pc._.js.map
\ No newline at end of file
{"version":3,"sources":["turbopack:///[project]/turbopack/crates/turbopack-tests/tests/snapshot/mangle-exports/named-and-preserved/input/index.js","turbopack:///[project]/turbopack/crates/turbopack-tests/tests/snapshot/mangle-exports/named-and-preserved/input/lib.js"],"sourcesContent":["import {\n a,\n bb,\n someLongExportName,\n anotherLongExportName,\n aLongFunctionName,\n} from './lib.js'\n\nconsole.log(\n a,\n bb,\n someLongExportName,\n anotherLongExportName,\n aLongFunctionName()\n)\n","export const a = 'a'\nexport const bb = 'bb'\nexport const someLongExportName = 'long-1'\nexport const anotherLongExportName = 'long-2'\nexport const unusedLongExportName = 'unused'\n\nexport function aLongFunctionName() {\n return 'fn'\n}\n"],"names":["console","log","a","bb","someLongExportName","anotherLongExportName","unusedLongExportName","aLongFunctionName"],"mappings":"mKAAA,IAAA,EAAA,EAAA,CAAA,CAAA,iIAQAA,QAAQC,GAAG,CACT,EAAA,CAAC,CACD,EAAA,CAAE,CACF,EAAA,CAAkB,CAClB,EAAA,CAAqB,CACrB,CAAA,EAAA,EAAA,CAAA,AAAiB,0KCbF,UAMV,SAASM,EACd,MAAO,IACT,QALqC,eAFnB,WACgB"} {"version":3,"sources":["turbopack:///[project]/turbopack/crates/turbopack-tests/tests/snapshot/mangle-exports/named-and-preserved/input/index.js","turbopack:///[project]/turbopack/crates/turbopack-tests/tests/snapshot/mangle-exports/named-and-preserved/input/lib.js"],"sourcesContent":["import {\n a,\n bb,\n someLongExportName,\n anotherLongExportName,\n aLongFunctionName,\n} from './lib.js'\n\nconsole.log(\n a,\n bb,\n someLongExportName,\n anotherLongExportName,\n aLongFunctionName()\n)\n","export const a = 'a'\nexport const bb = 'bb'\nexport const someLongExportName = 'long-1'\nexport const anotherLongExportName = 'long-2'\nexport const unusedLongExportName = 'unused'\n\nexport function aLongFunctionName() {\n return 'fn'\n}\n"],"names":["console","log","a","bb","someLongExportName","anotherLongExportName","unusedLongExportName","aLongFunctionName"],"mappings":"yKAAA,IAAA,EAAA,EAAA,CAAA,CAAA,iIAQAA,QAAQC,GAAG,CACT,EAAA,CAAC,CACD,EAAA,CAAE,CACF,EAAA,CAAkB,CAClB,EAAA,CAAqB,CACrB,CAAA,EAAA,EAAA,CAAA,AAAiB,6JCbF,UAMV,SAASM,EACd,MAAO,IACT,QALqC,eAFnB,WACgB"}
\ No newline at end of file \ No newline at end of file
module.exports=["[project]/turbopack/crates/turbopack-tests/tests/snapshot/mangle-exports/single-export/input/index.js [test] (ecmascript)",t=>{"use strict";console.log((0,t.i("[project]/turbopack/crates/turbopack-tests/tests/snapshot/mangle-exports/single-export/input/lone.js [test] (ecmascript)").f)()),t.s([])},"[project]/turbopack/crates/turbopack-tests/tests/snapshot/mangle-exports/single-export/input/lone.js [test] (ecmascript)",t=>{"use strict";t.s(["f",0,function(){return"lone"}])}]; (()=>{"use strict";module.exports=["[project]/turbopack/crates/turbopack-tests/tests/snapshot/mangle-exports/single-export/input/index.js [test] (ecmascript)",t=>{console.log((0,t.i("[project]/turbopack/crates/turbopack-tests/tests/snapshot/mangle-exports/single-export/input/lone.js [test] (ecmascript)").f)()),t.s([])},"[project]/turbopack/crates/turbopack-tests/tests/snapshot/mangle-exports/single-export/input/lone.js [test] (ecmascript)",t=>{t.s(["f",0,function(){return"lone"}])}]})();
//# sourceMappingURL=0_9x_turbopack-tests_tests_snapshot_mangle-exports_single-export_input_1mf78g4ogdhgv._.js.map //# sourceMappingURL=0_9x_turbopack-tests_tests_snapshot_mangle-exports_single-export_input_1mf78g4ogdhgv._.js.map
\ No newline at end of file
{"version":3,"sources":["turbopack:///[project]/turbopack/crates/turbopack-tests/tests/snapshot/mangle-exports/single-export/input/index.js","turbopack:///[project]/turbopack/crates/turbopack-tests/tests/snapshot/mangle-exports/single-export/input/lone.js"],"sourcesContent":["import { aLongFunctionNameNobodyWantsInTheBundle } from './lone'\n\nconsole.log(aLongFunctionNameNobodyWantsInTheBundle())\n","// The only export of this module. It is emitted under the fixed single-export key rather than a\n// hashed one, so that every single-export module in the graph produces the same `.f` byte sequence\n// and gzip can share it. Visible in the committed output below.\nexport function aLongFunctionNameNobodyWantsInTheBundle() {\n return 'lone'\n}\n"],"names":["console","log","aLongFunctionNameNobodyWantsInTheBundle"],"mappings":"6JAEAA,QAAQC,GAAG,CAAC,CAAA,EAFZ,AAEY,EAFZ,CAAA,CAAA,4HAEY,CAAA,AAAuC,qKCC5C,SAASC,EACd,MAAO,MACT"} {"version":3,"sources":["turbopack:///[project]/turbopack/crates/turbopack-tests/tests/snapshot/mangle-exports/single-export/input/index.js","turbopack:///[project]/turbopack/crates/turbopack-tests/tests/snapshot/mangle-exports/single-export/input/lone.js"],"sourcesContent":["import { aLongFunctionNameNobodyWantsInTheBundle } from './lone'\n\nconsole.log(aLongFunctionNameNobodyWantsInTheBundle())\n","// The only export of this module. It is emitted under the fixed single-export key rather than a\n// hashed one, so that every single-export module in the graph produces the same `.f` byte sequence\n// and gzip can share it. Visible in the committed output below.\nexport function aLongFunctionNameNobodyWantsInTheBundle() {\n return 'lone'\n}\n"],"names":["console","log","aLongFunctionNameNobodyWantsInTheBundle"],"mappings":"mKAEAA,QAAQC,GAAG,CAAC,CAAA,EAFZ,AAEY,EAFZ,CAAA,CAAA,4HAEY,CAAA,AAAuC,wJCC5C,SAASC,EACd,MAAO,MACT"}
\ No newline at end of file \ No newline at end of file
(globalThis["TURBOPACK"] || (globalThis["TURBOPACK"] = [])).push(["output/1do3_crates_turbopack-tests_tests_snapshot_node_spawn_dynamic_input_0ow1swaxdiv8b._.js", (()=>{"use strict";(globalThis["TURBOPACK"] || (globalThis["TURBOPACK"] = [])).push(["output/1do3_crates_turbopack-tests_tests_snapshot_node_spawn_dynamic_input_0ow1swaxdiv8b._.js",
"[project]/turbopack/crates/turbopack-tests/tests/snapshot/node/spawn_dynamic/input/index.js [test] (ecmascript)", ((__turbopack_context__) => { "[project]/turbopack/crates/turbopack-tests/tests/snapshot/node/spawn_dynamic/input/index.js [test] (ecmascript)", ((__turbopack_context__) => {
"use strict"; "use strict";
...@@ -23,6 +23,6 @@ function spawn(cmd, args) { ...@@ -23,6 +23,6 @@ function spawn(cmd, args) {
// //
} }
}), }),
]); ]);})()
//# sourceMappingURL=1do3_crates_turbopack-tests_tests_snapshot_node_spawn_dynamic_input_0ow1swaxdiv8b._.js.map //# sourceMappingURL=1do3_crates_turbopack-tests_tests_snapshot_node_spawn_dynamic_input_0ow1swaxdiv8b._.js.map
\ No newline at end of file
(globalThis["TURBOPACK"] || (globalThis["TURBOPACK"] = [])).push(["output/1do3_crates_turbopack-tests_tests_snapshot_node_spawn_node_eval_input_2055vpqzks2dy._.js", (()=>{"use strict";(globalThis["TURBOPACK"] || (globalThis["TURBOPACK"] = [])).push(["output/1do3_crates_turbopack-tests_tests_snapshot_node_spawn_node_eval_input_2055vpqzks2dy._.js",
"[project]/turbopack/crates/turbopack-tests/tests/snapshot/node/spawn_node_eval/input/index.js [test] (ecmascript)", ((__turbopack_context__) => { "[project]/turbopack/crates/turbopack-tests/tests/snapshot/node/spawn_node_eval/input/index.js [test] (ecmascript)", ((__turbopack_context__) => {
"use strict"; "use strict";
...@@ -21,6 +21,6 @@ function spawn(cmd, args) { ...@@ -21,6 +21,6 @@ function spawn(cmd, args) {
// //
} }
}), }),
]); ]);})()
//# sourceMappingURL=1do3_crates_turbopack-tests_tests_snapshot_node_spawn_node_eval_input_2055vpqzks2dy._.js.map //# sourceMappingURL=1do3_crates_turbopack-tests_tests_snapshot_node_spawn_node_eval_input_2055vpqzks2dy._.js.map
\ No newline at end of file
(globalThis["TURBOPACK"] || (globalThis["TURBOPACK"] = [])).push(["output/1jsg_tests_snapshot_remove-unused-imports_exports_input_07rt4kfe5xt7p._.js", (()=>{"use strict";(globalThis["TURBOPACK"] || (globalThis["TURBOPACK"] = [])).push(["output/1jsg_tests_snapshot_remove-unused-imports_exports_input_07rt4kfe5xt7p._.js",
"[project]/turbopack/crates/turbopack-tests/tests/snapshot/remove-unused-imports/exports/input/a.js [test] (ecmascript)", ((__turbopack_context__) => { "[project]/turbopack/crates/turbopack-tests/tests/snapshot/remove-unused-imports/exports/input/a.js [test] (ecmascript)", ((__turbopack_context__) => {
"use strict"; "use strict";
...@@ -72,6 +72,6 @@ __turbopack_context__.s([ ...@@ -72,6 +72,6 @@ __turbopack_context__.s([
y y
]); ]);
}), }),
]); ]);})()
//# sourceMappingURL=1jsg_tests_snapshot_remove-unused-imports_exports_input_07rt4kfe5xt7p._.js.map //# sourceMappingURL=1jsg_tests_snapshot_remove-unused-imports_exports_input_07rt4kfe5xt7p._.js.map
\ No newline at end of file
(globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["output/1jsg_tests_snapshot_remove-unused-imports_star-import-string-key_input_03-1fx5_29uet._.js","[project]/turbopack/crates/turbopack-tests/tests/snapshot/remove-unused-imports/star-import-string-key/input/index.js [test] (ecmascript)",t=>{"use strict";console.log(t.i("[project]/turbopack/crates/turbopack-tests/tests/snapshot/remove-unused-imports/star-import-string-key/input/lit.js [test] (ecmascript)").foo),t.s([])},"[project]/turbopack/crates/turbopack-tests/tests/snapshot/remove-unused-imports/star-import-string-key/input/lit.js [test] (ecmascript)",t=>{"use strict";t.s(["foo",0,function(){}])}]); (()=>{"use strict";(globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["output/1jsg_tests_snapshot_remove-unused-imports_star-import-string-key_input_03-1fx5_29uet._.js","[project]/turbopack/crates/turbopack-tests/tests/snapshot/remove-unused-imports/star-import-string-key/input/index.js [test] (ecmascript)",t=>{console.log(t.i("[project]/turbopack/crates/turbopack-tests/tests/snapshot/remove-unused-imports/star-import-string-key/input/lit.js [test] (ecmascript)").foo),t.s([])},"[project]/turbopack/crates/turbopack-tests/tests/snapshot/remove-unused-imports/star-import-string-key/input/lit.js [test] (ecmascript)",t=>{t.s(["foo",0,function(){}])}])})();
//# sourceMappingURL=1jsg_tests_snapshot_remove-unused-imports_star-import-string-key_input_03-1fx5_29uet._.js.map //# sourceMappingURL=1jsg_tests_snapshot_remove-unused-imports_star-import-string-key_input_03-1fx5_29uet._.js.map
\ No newline at end of file
{"version":3,"sources":["turbopack:///[project]/turbopack/crates/turbopack-tests/tests/snapshot/remove-unused-imports/star-import-string-key/input/index.js","turbopack:///[project]/turbopack/crates/turbopack-tests/tests/snapshot/remove-unused-imports/star-import-string-key/input/lit.js"],"sourcesContent":["import * as lit from './lit.js'\n\n// A string-literal key narrows to `foo`, so `unused` leaves the bundle.\nconsole.log(lit['foo'])\n","export function foo() {}\nexport function unused() {}\n"],"names":["console","log","foo","unused"],"mappings":"wTAGAA,QAAQC,GAAG,CAHX,AAGY,EAHZ,CAAA,CAAA,2IAGY,GAAU,mLCHf,SAASC,EAAO"} {"version":3,"sources":["turbopack:///[project]/turbopack/crates/turbopack-tests/tests/snapshot/remove-unused-imports/star-import-string-key/input/index.js","turbopack:///[project]/turbopack/crates/turbopack-tests/tests/snapshot/remove-unused-imports/star-import-string-key/input/lit.js"],"sourcesContent":["import * as lit from './lit.js'\n\n// A string-literal key narrows to `foo`, so `unused` leaves the bundle.\nconsole.log(lit['foo'])\n","export function foo() {}\nexport function unused() {}\n"],"names":["console","log","foo","unused"],"mappings":"8TAGAA,QAAQC,GAAG,CAHX,AAGY,EAHZ,CAAA,CAAA,2IAGY,GAAU,sKCHf,SAASC,EAAO"}
\ No newline at end of file \ No newline at end of file
...@@ -414,14 +414,16 @@ contextPrototype.f = moduleContext; ...@@ -414,14 +414,16 @@ contextPrototype.f = moduleContext;
*/ function getChunkPath(chunkData) { */ function getChunkPath(chunkData) {
return typeof chunkData === 'string' ? chunkData : chunkData.path; return typeof chunkData === 'string' ? chunkData : chunkData.path;
} }
// Load the CompressedmoduleFactories of a chunk into the `moduleFactories` Map. // Load the CompressedModuleFactories of a chunk into the `moduleFactories` Map.
// The CompressedModuleFactories format is // The flat format alternates one or more module IDs with their factory function.
// - 1 or more module ids // Strict factories can be prepended as a nested array.
// - a module factory function
// So walking this is a little complex but the flat structure is also fast to
// traverse, we can use `typeof` operators to distinguish the two cases.
function installCompressedModuleFactories(chunkModules, offset, moduleFactories, newModuleId) { function installCompressedModuleFactories(chunkModules, offset, moduleFactories, newModuleId) {
let i = offset; let i = offset;
const strictFactories = chunkModules[i];
if (Array.isArray(strictFactories)) {
installCompressedModuleFactories(strictFactories, 0, moduleFactories, newModuleId);
i++;
}
while(i < chunkModules.length){ while(i < chunkModules.length){
let end = i + 1; let end = i + 1;
// Find our factory function // Find our factory function
...@@ -460,7 +462,7 @@ function installCompressedModuleFactories(chunkModules, offset, moduleFactories, ...@@ -460,7 +462,7 @@ function installCompressedModuleFactories(chunkModules, offset, moduleFactories,
newModuleId?.(id); newModuleId?.(id);
} }
} }
i = end + 1; // end is pointing at the last factory advance to the next id or the end of the array. i = end + 1;
} }
} }
/** /**
......
...@@ -436,14 +436,16 @@ contextPrototype.f = moduleContext; ...@@ -436,14 +436,16 @@ contextPrototype.f = moduleContext;
*/ function getChunkPath(chunkData) { */ function getChunkPath(chunkData) {
return typeof chunkData === 'string' ? chunkData : chunkData.path; return typeof chunkData === 'string' ? chunkData : chunkData.path;
} }
// Load the CompressedmoduleFactories of a chunk into the `moduleFactories` Map. // Load the CompressedModuleFactories of a chunk into the `moduleFactories` Map.
// The CompressedModuleFactories format is // The flat format alternates one or more module IDs with their factory function.
// - 1 or more module ids // Strict factories can be prepended as a nested array.
// - a module factory function
// So walking this is a little complex but the flat structure is also fast to
// traverse, we can use `typeof` operators to distinguish the two cases.
function installCompressedModuleFactories(chunkModules, offset, moduleFactories, newModuleId) { function installCompressedModuleFactories(chunkModules, offset, moduleFactories, newModuleId) {
let i = offset; let i = offset;
const strictFactories = chunkModules[i];
if (Array.isArray(strictFactories)) {
installCompressedModuleFactories(strictFactories, 0, moduleFactories, newModuleId);
i++;
}
while(i < chunkModules.length){ while(i < chunkModules.length){
let end = i + 1; let end = i + 1;
// Find our factory function // Find our factory function
...@@ -482,7 +484,7 @@ function installCompressedModuleFactories(chunkModules, offset, moduleFactories, ...@@ -482,7 +484,7 @@ function installCompressedModuleFactories(chunkModules, offset, moduleFactories,
newModuleId?.(id); newModuleId?.(id);
} }
} }
i = end + 1; // end is pointing at the last factory advance to the next id or the end of the array. i = end + 1;
} }
} }
/** /**
......
(globalThis["TURBOPACK"] || (globalThis["TURBOPACK"] = [])).push(["output/0_9x_turbopack-tests_tests_snapshot_source_maps_input-source-map_input_0n-g1xc4-d7nb._.js", (()=>{"use strict";(globalThis["TURBOPACK"] || (globalThis["TURBOPACK"] = [])).push(["output/0_9x_turbopack-tests_tests_snapshot_source_maps_input-source-map_input_0n-g1xc4-d7nb._.js",
"[project]/turbopack/crates/turbopack-tests/tests/snapshot/source_maps/input-source-map/input/index.js [test] (ecmascript)", ((__turbopack_context__) => { "[project]/turbopack/crates/turbopack-tests/tests/snapshot/source_maps/input-source-map/input/index.js [test] (ecmascript)", ((__turbopack_context__) => {
"use strict"; "use strict";
...@@ -18,6 +18,6 @@ function runExternalSourceMapped(fn) { ...@@ -18,6 +18,6 @@ function runExternalSourceMapped(fn) {
return fn(); return fn();
} }
}), }),
]); ]);})()
//# sourceMappingURL=0_9x_turbopack-tests_tests_snapshot_source_maps_input-source-map_input_0n-g1xc4-d7nb._.js.map //# sourceMappingURL=0_9x_turbopack-tests_tests_snapshot_source_maps_input-source-map_input_0n-g1xc4-d7nb._.js.map
\ No newline at end of file
(globalThis["TURBOPACK"] || (globalThis["TURBOPACK"] = [])).push(["output/0_9x_turbopack-tests_tests_snapshot_source_maps_merged-unicode_input_1tq4mpj1076n4._.js", (globalThis["TURBOPACK"] || (globalThis["TURBOPACK"] = [])).push(["output/0_9x_turbopack-tests_tests_snapshot_source_maps_merged-unicode_input_1tq4mpj1076n4._.js",
(()=>{"use strict";return[
"[project]/turbopack/crates/turbopack-tests/tests/snapshot/source_maps/merged-unicode/input/entry-base.js [test] (ecmascript)", ((__turbopack_context__) => { "[project]/turbopack/crates/turbopack-tests/tests/snapshot/source_maps/merged-unicode/input/entry-base.js [test] (ecmascript)", ((__turbopack_context__) => {
"use strict"; "use strict";
...@@ -21,6 +22,21 @@ const waitAtLeastOneReactRenderTask = 1; //import { waitAtLeastOneReactRenderTas ...@@ -21,6 +22,21 @@ const waitAtLeastOneReactRenderTask = 1; //import { waitAtLeastOneReactRenderTas
; ;
; ;
}), }),
"[project]/turbopack/crates/turbopack-tests/tests/snapshot/source_maps/merged-unicode/input/index1.js [test] (ecmascript)", ((__turbopack_context__) => {
"use strict";
__turbopack_context__.s([]);
var __TURBOPACK__imported__module__$5b$project$5d2f$turbopack$2f$crates$2f$turbopack$2d$tests$2f$tests$2f$snapshot$2f$source_maps$2f$merged$2d$unicode$2f$input$2f$entry$2d$base$2e$js__$5b$test$5d$__$28$ecmascript$29$__ = __turbopack_context__.i("[project]/turbopack/crates/turbopack-tests/tests/snapshot/source_maps/merged-unicode/input/entry-base.js [test] (ecmascript)");
;
}),
"[project]/turbopack/crates/turbopack-tests/tests/snapshot/source_maps/merged-unicode/input/index2.js [test] (ecmascript)", ((__turbopack_context__) => {
"use strict";
__turbopack_context__.s([]);
var __TURBOPACK__imported__module__$5b$project$5d2f$turbopack$2f$crates$2f$turbopack$2d$tests$2f$tests$2f$snapshot$2f$source_maps$2f$merged$2d$unicode$2f$input$2f$entry$2d$base$2e$js__$5b$test$5d$__$28$ecmascript$29$__ = __turbopack_context__.i("[project]/turbopack/crates/turbopack-tests/tests/snapshot/source_maps/merged-unicode/input/entry-base.js [test] (ecmascript)");
;
}),
]})(),
"[project]/turbopack/crates/turbopack-tests/tests/snapshot/source_maps/merged-unicode/input/index.js [test] (ecmascript)", ((__turbopack_context__, module, exports) => { "[project]/turbopack/crates/turbopack-tests/tests/snapshot/source_maps/merged-unicode/input/index.js [test] (ecmascript)", ((__turbopack_context__, module, exports) => {
// "entry-base.js [app-rsc] (ecmascript) <module evaluation>" with // "entry-base.js [app-rsc] (ecmascript) <module evaluation>" with
...@@ -42,20 +58,6 @@ if (Date.now() > 0) { ...@@ -42,20 +58,6 @@ if (Date.now() > 0) {
__turbopack_context__.r("[project]/turbopack/crates/turbopack-tests/tests/snapshot/source_maps/merged-unicode/input/index2.js [test] (ecmascript)"); __turbopack_context__.r("[project]/turbopack/crates/turbopack-tests/tests/snapshot/source_maps/merged-unicode/input/index2.js [test] (ecmascript)");
} }
}), }),
"[project]/turbopack/crates/turbopack-tests/tests/snapshot/source_maps/merged-unicode/input/index1.js [test] (ecmascript)", ((__turbopack_context__) => {
"use strict";
__turbopack_context__.s([]);
var __TURBOPACK__imported__module__$5b$project$5d2f$turbopack$2f$crates$2f$turbopack$2d$tests$2f$tests$2f$snapshot$2f$source_maps$2f$merged$2d$unicode$2f$input$2f$entry$2d$base$2e$js__$5b$test$5d$__$28$ecmascript$29$__ = __turbopack_context__.i("[project]/turbopack/crates/turbopack-tests/tests/snapshot/source_maps/merged-unicode/input/entry-base.js [test] (ecmascript)");
;
}),
"[project]/turbopack/crates/turbopack-tests/tests/snapshot/source_maps/merged-unicode/input/index2.js [test] (ecmascript)", ((__turbopack_context__) => {
"use strict";
__turbopack_context__.s([]);
var __TURBOPACK__imported__module__$5b$project$5d2f$turbopack$2f$crates$2f$turbopack$2d$tests$2f$tests$2f$snapshot$2f$source_maps$2f$merged$2d$unicode$2f$input$2f$entry$2d$base$2e$js__$5b$test$5d$__$28$ecmascript$29$__ = __turbopack_context__.i("[project]/turbopack/crates/turbopack-tests/tests/snapshot/source_maps/merged-unicode/input/entry-base.js [test] (ecmascript)");
;
}),
]); ]);
//# sourceMappingURL=0_9x_turbopack-tests_tests_snapshot_source_maps_merged-unicode_input_1tq4mpj1076n4._.js.map //# sourceMappingURL=0_9x_turbopack-tests_tests_snapshot_source_maps_merged-unicode_input_1tq4mpj1076n4._.js.map
\ No newline at end of file
...@@ -2,8 +2,8 @@ ...@@ -2,8 +2,8 @@
"version": 3, "version": 3,
"sources": [], "sources": [],
"sections": [ "sections": [
{"offset": {"line": 4, "column": 0}, "map": {"version":3,"sources":["turbopack:///[project]/turbopack/crates/turbopack-tests/tests/snapshot/source_maps/merged-unicode/input/collect-segment-data.js"],"sourcesContent":["import { jsx as _jsx } from \"./jsx-runtime\";\n// eslint-disable-next-line import/no-extraneous-dependencies\nconst createFromReadableStream = 123; //import { createFromReadableStream } from 'react-server-dom-webpack/client.edge';\n// eslint-disable-next-line import/no-extraneous-dependencies\nconst prerender = 123; // import { prerender } from 'react-server-dom-webpack/static.edge';\nconst streamFromBuffer=1,streamToBuffer=1; // import { streamFromBuffer, streamToBuffer } from '../stream-utils/node-web-streams-helper';\nconst waitAtLeastOneReactRenderTask=1; //import { waitAtLeastOneReactRenderTask } from '../../lib/scheduler';\n// import './segment-value-encoding';\n"],"names":[],"mappings":";;;;;;;;;AACA,6DAA6D;AAC7D,MAAM,2BAA2B,KAAK,kFAAkF;AACxH,6DAA6D;AAC7D,MAAM,YAAY,KAAK,oEAAoE;AAC3F,MAAM,mBAAiB,GAAE,iBAAe,GAAG,8FAA8F;AACzI,MAAM,gCAA8B,GAAG,sEAAsE;CAC7G,sCAAsC"}}, {"offset": {"line": 5, "column": 0}, "map": {"version":3,"sources":["turbopack:///[project]/turbopack/crates/turbopack-tests/tests/snapshot/source_maps/merged-unicode/input/collect-segment-data.js"],"sourcesContent":["import { jsx as _jsx } from \"./jsx-runtime\";\n// eslint-disable-next-line import/no-extraneous-dependencies\nconst createFromReadableStream = 123; //import { createFromReadableStream } from 'react-server-dom-webpack/client.edge';\n// eslint-disable-next-line import/no-extraneous-dependencies\nconst prerender = 123; // import { prerender } from 'react-server-dom-webpack/static.edge';\nconst streamFromBuffer=1,streamToBuffer=1; // import { streamFromBuffer, streamToBuffer } from '../stream-utils/node-web-streams-helper';\nconst waitAtLeastOneReactRenderTask=1; //import { waitAtLeastOneReactRenderTask } from '../../lib/scheduler';\n// import './segment-value-encoding';\n"],"names":[],"mappings":";;;;;;;;;AACA,6DAA6D;AAC7D,MAAM,2BAA2B,KAAK,kFAAkF;AACxH,6DAA6D;AAC7D,MAAM,YAAY,KAAK,oEAAoE;AAC3F,MAAM,mBAAiB,GAAE,iBAAe,GAAG,8FAA8F;AACzI,MAAM,gCAA8B,GAAG,sEAAsE;CAC7G,sCAAsC"}},
{"offset": {"line": 25, "column": 0}, "map": {"version":3,"sources":["turbopack:///[project]/turbopack/crates/turbopack-tests/tests/snapshot/source_maps/merged-unicode/input/index.js"],"sourcesContent":["// \"entry-base.js [app-rsc] (ecmascript) <module evaluation>\" with\n// [\"reflect-utils.js [app-rsc] (ecmascript)\",\n// \"params.js [app-rsc] (ecmascript)\",\n// \"segment-value-encoding.js [app-rsc] (ecmascript)\",\n// \"collect-segment-data.js [app-rsc] (ecmascript)\",\n// \"entry-base.js [app-rsc] (ecmascript) <locals>\"]\n\n// \"entry-base.js [test] (ecmascript) <module evaluation>\" with\n// [\"reflect-utils.js [test] (ecmascript)\",\n// \"params.js [test] (ecmascript)\",\n// \"segment-value-encoding.js [test] (ecmascript)\",\n// \"collect-segment-data.js [test] (ecmascript)\",\n// \"entry-base.js [test] (ecmascript) <locals>\"]\n\nif (Date.now() > 0) {\n require('./index1.js')\n}\nif (Date.now() > 0) {\n require('./index2.js')\n}\n\n"],"names":["Date","now"],"mappings":"AAAA,kEAAkE;AAClE,8CAA8C;AAC9C,sCAAsC;AACtC,sDAAsD;AACtD,oDAAoD;AACpD,mDAAmD;AAEnD,+DAA+D;AAC/D,2CAA2C;AAC3C,mCAAmC;AACnC,mDAAmD;AACnD,kDAAkD;AAClD,iDAAiD;AAEjD,IAAIA,KAAKC,GAAG,KAAK,GAAG;;AAEpB;AACA,IAAID,KAAKC,GAAG,KAAK,GAAG;;AAEpB"}}, {"offset": {"line": 27, "column": 0}, "map": {"version":3,"sources":["turbopack:///[project]/turbopack/crates/turbopack-tests/tests/snapshot/source_maps/merged-unicode/input/index1.js"],"sourcesContent":["import \"./entry-base.js\";\n"],"names":[],"mappings":";AAAA"}},
{"offset": {"line": 47, "column": 0}, "map": {"version":3,"sources":["turbopack:///[project]/turbopack/crates/turbopack-tests/tests/snapshot/source_maps/merged-unicode/input/index1.js"],"sourcesContent":["import \"./entry-base.js\";\n"],"names":[],"mappings":";AAAA"}}, {"offset": {"line": 34, "column": 0}, "map": {"version":3,"sources":["turbopack:///[project]/turbopack/crates/turbopack-tests/tests/snapshot/source_maps/merged-unicode/input/index2.js"],"sourcesContent":["import \"./entry-base.js\";\n"],"names":[],"mappings":";AAAA"}},
{"offset": {"line": 54, "column": 0}, "map": {"version":3,"sources":["turbopack:///[project]/turbopack/crates/turbopack-tests/tests/snapshot/source_maps/merged-unicode/input/index2.js"],"sourcesContent":["import \"./entry-base.js\";\n"],"names":[],"mappings":";AAAA"}}] {"offset": {"line": 41, "column": 0}, "map": {"version":3,"sources":["turbopack:///[project]/turbopack/crates/turbopack-tests/tests/snapshot/source_maps/merged-unicode/input/index.js"],"sourcesContent":["// \"entry-base.js [app-rsc] (ecmascript) <module evaluation>\" with\n// [\"reflect-utils.js [app-rsc] (ecmascript)\",\n// \"params.js [app-rsc] (ecmascript)\",\n// \"segment-value-encoding.js [app-rsc] (ecmascript)\",\n// \"collect-segment-data.js [app-rsc] (ecmascript)\",\n// \"entry-base.js [app-rsc] (ecmascript) <locals>\"]\n\n// \"entry-base.js [test] (ecmascript) <module evaluation>\" with\n// [\"reflect-utils.js [test] (ecmascript)\",\n// \"params.js [test] (ecmascript)\",\n// \"segment-value-encoding.js [test] (ecmascript)\",\n// \"collect-segment-data.js [test] (ecmascript)\",\n// \"entry-base.js [test] (ecmascript) <locals>\"]\n\nif (Date.now() > 0) {\n require('./index1.js')\n}\nif (Date.now() > 0) {\n require('./index2.js')\n}\n\n"],"names":["Date","now"],"mappings":"AAAA,kEAAkE;AAClE,8CAA8C;AAC9C,sCAAsC;AACtC,sDAAsD;AACtD,oDAAoD;AACpD,mDAAmD;AAEnD,+DAA+D;AAC/D,2CAA2C;AAC3C,mCAAmC;AACnC,mDAAmD;AACnD,kDAAkD;AAClD,iDAAiD;AAEjD,IAAIA,KAAKC,GAAG,KAAK,GAAG;;AAEpB;AACA,IAAID,KAAKC,GAAG,KAAK,GAAG;;AAEpB"}}]
} }
\ No newline at end of file
(globalThis["TURBOPACK"] || (globalThis["TURBOPACK"] = [])).push(["output/turbopack_crates_turbopack-tests_tests_snapshot_16i0hbsemtixh._.js", (()=>{"use strict";(globalThis["TURBOPACK"] || (globalThis["TURBOPACK"] = [])).push(["output/turbopack_crates_turbopack-tests_tests_snapshot_16i0hbsemtixh._.js",
"[project]/turbopack/crates/turbopack-tests/tests/snapshot/node_modules/react/compiler-runtime.js [test] (ecmascript)", ((__turbopack_context__) => { "[project]/turbopack/crates/turbopack-tests/tests/snapshot/node_modules/react/compiler-runtime.js [test] (ecmascript)", ((__turbopack_context__) => {
"use strict"; "use strict";
...@@ -113,6 +113,6 @@ var __TURBOPACK__imported__module__$5b$project$5d2f$turbopack$2f$crates$2f$turbo ...@@ -113,6 +113,6 @@ var __TURBOPACK__imported__module__$5b$project$5d2f$turbopack$2f$crates$2f$turbo
; ;
console.log(__TURBOPACK__imported__module__$5b$project$5d2f$turbopack$2f$crates$2f$turbopack$2d$tests$2f$tests$2f$snapshot$2f$source_maps$2f$react$2d$compiler$2f$input$2f$Component$2e$jsx__$5b$test$5d$__$28$ecmascript$29$__["Counter"]); console.log(__TURBOPACK__imported__module__$5b$project$5d2f$turbopack$2f$crates$2f$turbopack$2d$tests$2f$tests$2f$snapshot$2f$source_maps$2f$react$2d$compiler$2f$input$2f$Component$2e$jsx__$5b$test$5d$__$28$ecmascript$29$__["Counter"]);
}), }),
]); ]);})()
//# sourceMappingURL=turbopack_crates_turbopack-tests_tests_snapshot_16i0hbsemtixh._.js.map //# sourceMappingURL=turbopack_crates_turbopack-tests_tests_snapshot_16i0hbsemtixh._.js.map
\ No newline at end of file
...@@ -655,14 +655,16 @@ contextPrototype.f = moduleContext; ...@@ -655,14 +655,16 @@ contextPrototype.f = moduleContext;
*/ function getChunkPath(chunkData) { */ function getChunkPath(chunkData) {
return typeof chunkData === 'string' ? chunkData : chunkData.path; return typeof chunkData === 'string' ? chunkData : chunkData.path;
} }
// Load the CompressedmoduleFactories of a chunk into the `moduleFactories` Map. // Load the CompressedModuleFactories of a chunk into the `moduleFactories` Map.
// The CompressedModuleFactories format is // The flat format alternates one or more module IDs with their factory function.
// - 1 or more module ids // Strict factories can be prepended as a nested array.
// - a module factory function
// So walking this is a little complex but the flat structure is also fast to
// traverse, we can use `typeof` operators to distinguish the two cases.
function installCompressedModuleFactories(chunkModules, offset, moduleFactories, newModuleId) { function installCompressedModuleFactories(chunkModules, offset, moduleFactories, newModuleId) {
var i = offset; var i = offset;
var strictFactories = chunkModules[i];
if (Array.isArray(strictFactories)) {
installCompressedModuleFactories(strictFactories, 0, moduleFactories, newModuleId);
i++;
}
while(i < chunkModules.length){ while(i < chunkModules.length){
var end = i + 1; var end = i + 1;
// Find our factory function // Find our factory function
...@@ -701,7 +703,7 @@ function installCompressedModuleFactories(chunkModules, offset, moduleFactories, ...@@ -701,7 +703,7 @@ function installCompressedModuleFactories(chunkModules, offset, moduleFactories,
newModuleId === null || newModuleId === void 0 ? void 0 : newModuleId(id1); newModuleId === null || newModuleId === void 0 ? void 0 : newModuleId(id1);
} }
} }
i = end + 1; // end is pointing at the last factory advance to the next id or the end of the array. i = end + 1;
} }
} }
/** /**
......
(globalThis["TURBOPACK"] || (globalThis["TURBOPACK"] = [])).push(["output/1jsg_tests_snapshot_swc_transforms_preset_env_modern_input_1utkugv09yioo._.js", (()=>{"use strict";(globalThis["TURBOPACK"] || (globalThis["TURBOPACK"] = [])).push(["output/1jsg_tests_snapshot_swc_transforms_preset_env_modern_input_1utkugv09yioo._.js",
"[project]/turbopack/crates/turbopack-tests/tests/snapshot/swc_transforms/preset_env_modern/input/Parser.js [test] (ecmascript)", ((__turbopack_context__) => { "[project]/turbopack/crates/turbopack-tests/tests/snapshot/swc_transforms/preset_env_modern/input/Parser.js [test] (ecmascript)", ((__turbopack_context__) => {
"use strict"; "use strict";
...@@ -31,6 +31,6 @@ var __TURBOPACK__imported__module__$5b$project$5d2f$turbopack$2f$crates$2f$turbo ...@@ -31,6 +31,6 @@ var __TURBOPACK__imported__module__$5b$project$5d2f$turbopack$2f$crates$2f$turbo
; ;
console.log((0, __TURBOPACK__imported__module__$5b$project$5d2f$turbopack$2f$crates$2f$turbopack$2d$tests$2f$tests$2f$snapshot$2f$swc_transforms$2f$preset_env_modern$2f$input$2f$Parser$2e$js__$5b$test$5d$__$28$ecmascript$29$__["comment"])()); console.log((0, __TURBOPACK__imported__module__$5b$project$5d2f$turbopack$2f$crates$2f$turbopack$2d$tests$2f$tests$2f$snapshot$2f$swc_transforms$2f$preset_env_modern$2f$input$2f$Parser$2e$js__$5b$test$5d$__$28$ecmascript$29$__["comment"])());
}), }),
]); ]);})()
//# sourceMappingURL=1jsg_tests_snapshot_swc_transforms_preset_env_modern_input_1utkugv09yioo._.js.map //# sourceMappingURL=1jsg_tests_snapshot_swc_transforms_preset_env_modern_input_1utkugv09yioo._.js.map
\ No newline at end of file
(globalThis["TURBOPACK"] || (globalThis["TURBOPACK"] = [])).push(["output/0_9x_turbopack-tests_tests_snapshot_typescript_jsconfig-baseurl_input_0qbibqfoqauyh._.js", (()=>{"use strict";(globalThis["TURBOPACK"] || (globalThis["TURBOPACK"] = [])).push(["output/0_9x_turbopack-tests_tests_snapshot_typescript_jsconfig-baseurl_input_0qbibqfoqauyh._.js",
"[project]/turbopack/crates/turbopack-tests/tests/snapshot/typescript/jsconfig-baseurl/input/index.js [test] (ecmascript)", ((__turbopack_context__) => { "[project]/turbopack/crates/turbopack-tests/tests/snapshot/typescript/jsconfig-baseurl/input/index.js [test] (ecmascript)", ((__turbopack_context__) => {
"use strict"; "use strict";
...@@ -18,6 +18,6 @@ __turbopack_context__.s([ ...@@ -18,6 +18,6 @@ __turbopack_context__.s([
]); ]);
const prop = 1; const prop = 1;
}), }),
]); ]);})()
//# sourceMappingURL=0_9x_turbopack-tests_tests_snapshot_typescript_jsconfig-baseurl_input_0qbibqfoqauyh._.js.map //# sourceMappingURL=0_9x_turbopack-tests_tests_snapshot_typescript_jsconfig-baseurl_input_0qbibqfoqauyh._.js.map
\ No newline at end of file
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