Unverified Commit 6648a62e authored by vercel-fleet-prod[bot]'s avatar vercel-fleet-prod[bot] Committed by GitHub

turbopack: ignore deferred edges in side effect analysis

Co-authored-by: 's avatarLuke Sandberg <210140+lukesandberg@users.noreply.github.com>
parent 03d278db
......@@ -5,6 +5,7 @@ use turbo_tasks::{JoinIterExt, ResolvedVc, Vc};
use crate::{
module::{Module, ModuleSideEffects},
module_graph::{GraphTraversalAction, ModuleGraph, ModuleGraphLayer, SingleModuleGraphNode},
resolve::ModuleEvaluationTiming,
};
/// This lists all the modules that are side effect free
......@@ -18,10 +19,8 @@ pub struct SideEffectFreeModules(FxHashSet<ResolvedVc<Box<dyn Module>>>);
/// This leverages the module graph to compute if modules with `ModuleEvaluationIsSideEffectFree`
/// status are actually side effectful or not.
///
/// A current limitation is that the module graph doesn't contain information on how 'late' imports
/// are used. e.g. if there is a dynamic import with side effects in an event handler, we will mark
/// the module as side effectful even though it isn't. To fix this the module graph would need to
/// record more information about the nature of the edges.
/// Dependencies that are known to execute only after module evaluation don't affect this result.
/// They remain in the module graph for reachability, chunking, and runtime loading.
#[turbo_tasks::function]
pub async fn compute_side_effect_free_module_info(
graphs: ResolvedVc<ModuleGraph>,
......@@ -82,7 +81,10 @@ async fn compute_side_effect_free_module_info_single(
// child is a previously visited module that we know is side effectful
// parent is a module that depends on it.
|child, parent, _s| {
Ok(if child.is_some() {
Ok(if let Some((_, ref_data)) = child {
if ref_data.binding_usage.evaluation_timing == ModuleEvaluationTiming::Deferred {
return Ok(GraphTraversalAction::Exclude);
}
match module_side_effects.get(&parent) {
Some(ModuleSideEffects::SideEffectful | ModuleSideEffects::SideEffectFree) => {
// We have either already seen this or don't want to follow it
......
......@@ -114,6 +114,7 @@ impl ModuleReference for SingleChunkableModuleReference {
BindingUsage {
import: ImportUsage::TopLevel,
export: self.export.clone(),
evaluation_timing: Default::default(),
}
}
}
......
......@@ -138,6 +138,7 @@ impl ModuleResolveResultItem {
pub struct BindingUsage {
pub import: ImportUsage,
pub export: ExportUsage,
pub evaluation_timing: ModuleEvaluationTiming,
}
#[turbo_tasks::value_impl]
......@@ -148,6 +149,18 @@ impl BindingUsage {
}
}
/// Defines whether following a module reference can execute its target during evaluation of the
/// referencing module.
#[turbo_tasks::value(shared)]
#[derive(Debug, Clone, Copy, Default, Hash, Serialize, Deserialize)]
pub enum ModuleEvaluationTiming {
/// The target may execute during evaluation of the referencing module.
#[default]
Evaluation,
/// The target can only execute after evaluation of the referencing module has completed.
Deferred,
}
/// Defines where an import is used in a module
#[turbo_tasks::value(shared)]
#[derive(Debug, Clone, Default, Hash, Serialize, Deserialize)]
......
use bumpalo::boxed::Box as BumpBox;
use swc_core::{atoms::Atom, common::Span, ecma::visit::fields::*};
use turbo_rcstr::RcStr;
use turbopack_core::resolve::ExportUsage;
use turbopack_core::resolve::{ExportUsage, ModuleEvaluationTiming};
use crate::{
analyzer::{Bump, BumpVec, JsValue},
......@@ -133,6 +133,7 @@ pub enum Effect<'a> {
span: Span,
in_try: bool,
new: bool,
evaluation_timing: ModuleEvaluationTiming,
},
/// A function call or a new call of a property of an object.
MemberCall {
......@@ -143,6 +144,7 @@ pub enum Effect<'a> {
span: Span,
in_try: bool,
new: bool,
evaluation_timing: ModuleEvaluationTiming,
},
/// A property access.
Member {
......@@ -206,6 +208,7 @@ pub enum Effect<'a> {
ast_path: BumpBox<'a, [AstParentKind]>,
span: Span,
in_try: bool,
evaluation_timing: ModuleEvaluationTiming,
/// The export usage extracted from the usage pattern.
export_usage: ExportUsage,
},
......
......@@ -16,7 +16,7 @@ use swc_core::{
},
};
use turbo_rcstr::{RcStr, rcstr};
use turbopack_core::resolve::ExportUsage;
use turbopack_core::resolve::{ExportUsage, ModuleEvaluationTiming};
use crate::{
AnalyzeMode,
......@@ -799,6 +799,92 @@ pub fn as_parent_path(ast_path: &AstNodePath<AstParentNodeRef<'_>>) -> Vec<AstPa
ast_path.kinds().to_vec()
}
/// Whether a function body might execute immediately where the function is defined.
fn function_may_execute_at_definition(
ast_path: &AstNodePath<AstParentNodeRef<'_>>,
function_boundary: usize,
) -> bool {
for parent in ast_path.iter().take(function_boundary).rev() {
match parent {
// Transparent wrappers between a function value and its consumer.
AstParentNodeRef::FnExpr(_, FnExprField::Function)
| AstParentNodeRef::DefaultDecl(_, DefaultDeclField::Fn)
| AstParentNodeRef::Expr(_, ExprField::Fn | ExprField::Arrow | ExprField::Paren)
| AstParentNodeRef::ParenExpr(_, ParenExprField::Expr)
| AstParentNodeRef::Callee(_, CalleeField::Expr)
| AstParentNodeRef::ExprOrSpread(_, ExprOrSpreadField::Expr) => {}
// These contexts store or declare the function without invoking it.
AstParentNodeRef::FnDecl(..)
| AstParentNodeRef::ClassMethod(..)
| AstParentNodeRef::PrivateMethod(..)
| AstParentNodeRef::MethodProp(..)
| AstParentNodeRef::GetterProp(..)
| AstParentNodeRef::SetterProp(..)
| AstParentNodeRef::VarDeclarator(_, VarDeclaratorField::Init)
| AstParentNodeRef::ReturnStmt(_, ReturnStmtField::Arg)
| AstParentNodeRef::ClassProp(_, ClassPropField::Value)
| AstParentNodeRef::PrivateProp(_, PrivatePropField::Value)
| AstParentNodeRef::AutoAccessor(_, AutoAccessorField::Value)
| AstParentNodeRef::ExportDefaultDecl(..)
| AstParentNodeRef::ExportDefaultExpr(..) => return false,
// Direct calls and callback arguments may execute the function synchronously.
AstParentNodeRef::CallExpr(_, CallExprField::Callee | CallExprField::Args(_))
| AstParentNodeRef::NewExpr(_, NewExprField::Callee | NewExprField::Args(_))
| AstParentNodeRef::TaggedTpl(_, TaggedTplField::Tag | TaggedTplField::Tpl) => {
return true;
}
// Unknown consumers are conservatively treated as potentially eager.
_ => return true,
}
}
true
}
/// Classifies when a call-based module load can execute relative to module evaluation.
fn module_evaluation_timing(
ast_path: &AstNodePath<AstParentNodeRef<'_>>,
) -> ModuleEvaluationTiming {
for (index, parent) in ast_path.iter().enumerate().rev() {
match parent {
AstParentNodeRef::Function(_, FunctionField::Body)
| AstParentNodeRef::ArrowExpr(_, ArrowExprField::Body) => {
if !function_may_execute_at_definition(ast_path, index) {
return ModuleEvaluationTiming::Deferred;
}
}
AstParentNodeRef::Constructor(_, ConstructorField::Body) => {
return ModuleEvaluationTiming::Deferred;
}
AstParentNodeRef::ClassProp(prop, ClassPropField::Value) => {
return if prop.is_static {
ModuleEvaluationTiming::Evaluation
} else {
ModuleEvaluationTiming::Deferred
};
}
AstParentNodeRef::PrivateProp(prop, PrivatePropField::Value) => {
return if prop.is_static {
ModuleEvaluationTiming::Evaluation
} else {
ModuleEvaluationTiming::Deferred
};
}
AstParentNodeRef::AutoAccessor(accessor, AutoAccessorField::Value) => {
return if accessor.is_static {
ModuleEvaluationTiming::Evaluation
} else {
ModuleEvaluationTiming::Deferred
};
}
AstParentNodeRef::StaticBlock(_, StaticBlockField::Body) => {
return ModuleEvaluationTiming::Evaluation;
}
_ => {}
}
}
ModuleEvaluationTiming::Evaluation
}
/// Like [`as_parent_path`], but freezes the path into an arena-allocated boxed slice.
pub fn as_parent_path_in<'a>(
arena: &'a Bump,
......@@ -1278,6 +1364,7 @@ impl<'a> Analyzer<'a, '_> {
cjs_export_target_arg: Option<usize>,
) {
let new = n.as_new().is_some();
let evaluation_timing = module_evaluation_timing(ast_path);
let args = BumpVec::from_iter_in(
self.arena,
args.enumerate().map(|(i, arg)| {
......@@ -1384,6 +1471,7 @@ impl<'a> Analyzer<'a, '_> {
ast_path: as_parent_path_in(self.arena, ast_path),
span,
in_try: self.is_in_try(),
evaluation_timing,
export_usage,
});
}
......@@ -1413,6 +1501,7 @@ impl<'a> Analyzer<'a, '_> {
span,
in_try: self.is_in_try(),
new,
evaluation_timing,
});
} else {
let fn_value =
......@@ -1424,6 +1513,7 @@ impl<'a> Analyzer<'a, '_> {
span,
in_try: self.is_in_try(),
new,
evaluation_timing,
});
}
}
......@@ -1439,6 +1529,7 @@ impl<'a> Analyzer<'a, '_> {
span,
in_try: self.is_in_try(),
new,
evaluation_timing,
}),
}
}
......@@ -3248,3 +3339,110 @@ fn extract_var_from_umd_factory(callee: &Expr, args: &[ExprOrSpread]) -> Option<
None
}
#[cfg(test)]
mod module_evaluation_timing_tests {
use swc_core::{
common::{FileName, SourceMap},
ecma::{
ast::{CallExpr, Callee, EsVersion, Expr},
parser::{Parser, StringInput, Syntax, lexer::Lexer},
visit::{AstNodePath, VisitAstPath, VisitWithAstPath},
},
};
use super::{ModuleEvaluationTiming, module_evaluation_timing};
#[derive(Default)]
struct TimingCollector(Vec<ModuleEvaluationTiming>);
impl VisitAstPath for TimingCollector {
fn visit_call_expr<'ast: 'r, 'r>(
&mut self,
node: &'ast CallExpr,
ast_path: &mut AstNodePath<'r>,
) {
if matches!(&node.callee, Callee::Import(_))
|| matches!(
&node.callee,
Callee::Expr(callee)
if matches!(&**callee, Expr::Ident(ident) if ident.sym == "require")
)
{
self.0.push(module_evaluation_timing(ast_path));
}
node.visit_children_with_ast_path(self, ast_path);
}
}
fn collect(code: &str) -> Vec<ModuleEvaluationTiming> {
let cm = SourceMap::default();
let file = cm.new_source_file(FileName::Anon.into(), code.to_owned());
let lexer = Lexer::new(
Syntax::default(),
EsVersion::latest(),
StringInput::from(&*file),
None,
);
let mut parser = Parser::new_from(lexer);
let program = parser.parse_program().expect("test input should parse");
let mut collector = TimingCollector::default();
program.visit_with_ast_path(&mut collector, &mut Default::default());
collector.0
}
#[test]
fn deferred_function_and_instance_contexts() {
let timings = collect(
r#"
function declaration() { import('a') }
export default function () { import('default') }
const arrow = () => import('b')
const expression = function () { require('c') }
class Contexts {
field = import('d')
constructor() { require('e') }
method() { import('f') }
get loaded() { return require('g') }
set loaded(value) { if (value) import('h') }
}
"#,
);
assert_eq!(timings, vec![ModuleEvaluationTiming::Deferred; 9]);
}
#[test]
fn evaluation_and_immediate_contexts() {
let timings = collect(
r#"
import('a');
require('b');
(() => import('c'))();
(function () { require('d') })();
consume(() => import('e'));
new Consumer(() => require('f'));
((value) => import('g'))`value`;
consume({ callback: () => import('object') });
consume([() => require('array')]);
class Contexts {
static field = import('h')
static { require('i') }
}
"#,
);
assert_eq!(timings, vec![ModuleEvaluationTiming::Evaluation; 11]);
}
#[test]
fn an_outer_deferred_function_keeps_immediate_inner_calls_deferred() {
let timings = collect(
r#"
export function later() {
(() => import('a'))()
consume(() => require('b'))
}
"#,
);
assert_eq!(timings, vec![ModuleEvaluationTiming::Deferred; 2]);
}
}
......@@ -161,6 +161,7 @@ impl ModuleReference for LazyCompilationReference {
BindingUsage {
import: ImportUsage::TopLevel,
export: ExportUsage::All,
evaluation_timing: Default::default(),
}
}
}
......
......@@ -22,8 +22,8 @@ use turbopack_core::{
reference::ModuleReference,
reference_type::CommonJsReferenceSubType,
resolve::{
BindingUsage, ExportUsage, ImportUsage, ModuleResolveResult, ResolveErrorMode,
origin::ResolveOrigin, parse::Request,
BindingUsage, ExportUsage, ImportUsage, ModuleEvaluationTiming, ModuleResolveResult,
ResolveErrorMode, origin::ResolveOrigin, parse::Request,
},
};
use turbopack_resolve::ecmascript::cjs_resolve;
......@@ -106,6 +106,7 @@ pub struct CjsRequireAssetReference {
resolve_override: Option<ResolvedVc<Box<dyn Module>>>,
usage: ExportUsage,
cjs_tree_shaking: bool,
evaluation_timing: ModuleEvaluationTiming,
}
impl CjsRequireAssetReference {
......@@ -118,6 +119,7 @@ impl CjsRequireAssetReference {
resolve_override: Option<ResolvedVc<Box<dyn Module>>>,
usage: ExportUsage,
cjs_tree_shaking: bool,
evaluation_timing: ModuleEvaluationTiming,
) -> Self {
CjsRequireAssetReference {
origin,
......@@ -128,6 +130,7 @@ impl CjsRequireAssetReference {
resolve_override,
usage,
cjs_tree_shaking,
evaluation_timing,
}
}
}
......@@ -165,6 +168,7 @@ impl ModuleReference for CjsRequireAssetReference {
BindingUsage {
import: ImportUsage::TopLevel,
export: self.usage.clone(),
evaluation_timing: self.evaluation_timing,
}
}
......
......@@ -126,6 +126,7 @@ impl ModuleReference for EmitReference {
BindingUsage {
import: Default::default(),
export: self.export_usage.clone(),
evaluation_timing: Default::default(),
}
}
}
......
......@@ -786,6 +786,7 @@ impl ModuleReference for EsmAssetReference {
}
_ => ExportUsage::All,
},
evaluation_timing: Default::default(),
}
}
......
......@@ -15,7 +15,7 @@ use turbopack_core::{
reference::ModuleReference,
reference_type::EcmaScriptModulesReferenceSubType,
resolve::{
BindingUsage, ExportUsage, ModuleResolveResult, ResolveErrorMode,
BindingUsage, ExportUsage, ModuleEvaluationTiming, ModuleResolveResult, ResolveErrorMode,
origin::{ResolveOrigin, ResolveOriginExt},
parse::Request,
},
......@@ -48,6 +48,7 @@ pub struct EsmAsyncAssetReference {
pub resolve_override: Option<ResolvedVc<Box<dyn Module>>>,
/// Whether the target is compiled only after its runtime proxy is activated.
pub lazy_compilation: bool,
pub evaluation_timing: ModuleEvaluationTiming,
}
impl EsmAsyncAssetReference {
......@@ -62,6 +63,7 @@ impl EsmAsyncAssetReference {
export_usage: ExportUsage,
resolve_override: Option<ResolvedVc<Box<dyn Module>>>,
lazy_compilation: bool,
evaluation_timing: ModuleEvaluationTiming,
) -> Result<Self> {
// Apply any annotation-driven transition eagerly so the stored origin is final and the
// `annotations` don't need to be retained on the reference.
......@@ -83,6 +85,7 @@ impl EsmAsyncAssetReference {
export_usage,
resolve_override,
lazy_compilation,
evaluation_timing,
})
}
}
......@@ -126,6 +129,7 @@ impl ModuleReference for EsmAsyncAssetReference {
BindingUsage {
import: Default::default(),
export: self.export_usage.clone(),
evaluation_timing: self.evaluation_timing,
}
}
......
......@@ -657,6 +657,7 @@ impl ModuleReference for ImportMetaGlobModuleReference {
BindingUsage {
import: Default::default(),
export: self.export.clone(),
evaluation_timing: Default::default(),
}
}
}
......
......@@ -83,8 +83,8 @@ use turbopack_core::{
reference::{ModuleReference, ModuleReferences},
reference_type::{CommonJsReferenceSubType, InnerAssets},
resolve::{
ExportUsage, FindContextFileResult, ImportUsage, ModulePart, ResolveErrorMode,
find_context_file,
ExportUsage, FindContextFileResult, ImportUsage, ModuleEvaluationTiming, ModulePart,
ResolveErrorMode, find_context_file,
origin::{PlainResolveOrigin, ResolveOrigin},
parse::Request,
pattern::Pattern,
......@@ -1139,6 +1139,7 @@ async fn analyze_ecmascript_module_internal(
span,
in_try,
new,
evaluation_timing,
} => {
let func = analysis_state
.link_value(take(&mut *func), eval_context.imports.get_attributes(span))
......@@ -1161,6 +1162,7 @@ async fn analyze_ecmascript_module_internal(
new,
eval_context.imports.get_attributes(span),
call_usage,
evaluation_timing,
)
.await?;
}
......@@ -1169,6 +1171,7 @@ async fn analyze_ecmascript_module_internal(
ast_path,
span,
in_try,
evaluation_timing,
export_usage,
} => {
let args = process_effect_args(args, &mut queue_stack);
......@@ -1182,6 +1185,7 @@ async fn analyze_ecmascript_module_internal(
eval_context.imports.get_attributes(span),
export_usage,
ValueLinkContext::Default,
evaluation_timing,
)
.await?;
}
......@@ -1193,6 +1197,7 @@ async fn analyze_ecmascript_module_internal(
span,
in_try,
new,
evaluation_timing,
} => {
let func = analysis_state
.link_value(
......@@ -1261,6 +1266,7 @@ async fn analyze_ecmascript_module_internal(
// A member call (`obj.method(...)`) result isn't narrowed
// for require export usage.
ExportUsage::All,
evaluation_timing,
)
.await?;
}
......@@ -1725,6 +1731,7 @@ async fn handle_call<'a>(
new: bool,
attributes: &ImportAttributes,
call_usage: ExportUsage,
evaluation_timing: ModuleEvaluationTiming,
) -> Result<()> {
let &AnalysisState {
handler,
......@@ -1785,6 +1792,7 @@ async fn handle_call<'a>(
tracing_only,
attributes,
call_usage.clone(),
evaluation_timing,
)
.await?;
}
......@@ -1812,6 +1820,7 @@ async fn handle_call<'a>(
tracing_only,
attributes,
call_usage,
evaluation_timing,
)
.await?;
}
......@@ -1831,6 +1840,7 @@ async fn handle_dynamic_import<'a>(
attributes: &ImportAttributes,
export_usage: ExportUsage,
link_context: ValueLinkContext,
evaluation_timing: ModuleEvaluationTiming,
) -> Result<()> {
// If the import has a webpackIgnore/turbopackIgnore comment, skip processing
// so the import expression is preserved as-is in the output.
......@@ -1877,6 +1887,7 @@ async fn handle_dynamic_import<'a>(
export_usage,
link_context,
lazy_compilation,
evaluation_timing,
)
.await
}
......@@ -1896,6 +1907,7 @@ async fn handle_dynamic_import_with_linked_args(
export_usage: ExportUsage,
link_context: ValueLinkContext,
lazy_compilation: bool,
evaluation_timing: ModuleEvaluationTiming,
) -> Result<()> {
if linked_args.len() == 1 || linked_args.len() == 2 {
let pat = js_value_to_pattern(&linked_args[0]);
......@@ -1959,6 +1971,7 @@ async fn handle_dynamic_import_with_linked_args(
export_usage,
resolve_override,
lazy_compilation,
evaluation_timing,
)
.await?,
analysis.intern_path(ast_path),
......@@ -2005,6 +2018,7 @@ async fn handle_well_known_function_call<'a, 'l, F, Fut>(
tracing_only: bool,
attributes: &ImportAttributes,
call_usage: ExportUsage,
evaluation_timing: ModuleEvaluationTiming,
) -> Result<()>
where
'a: 'l,
......@@ -2289,6 +2303,7 @@ where
export_usage,
link_context,
state.lazy_compilation,
evaluation_timing,
)
.await?;
}
......@@ -2334,6 +2349,7 @@ where
resolve_override,
call_usage.clone(),
state.cjs_tree_shaking,
evaluation_timing,
),
analysis.intern_path(ast_path),
link_context,
......@@ -2393,6 +2409,7 @@ where
None,
call_usage.clone(),
state.cjs_tree_shaking,
evaluation_timing,
),
analysis.intern_path(ast_path),
link_context,
......
......@@ -138,6 +138,7 @@ impl ModuleReference for EcmascriptModulePartReference {
BindingUsage {
import: ImportUsage::TopLevel,
export: self.export_usage.clone(),
evaluation_timing: Default::default(),
}
}
}
......
import { value } from './pure-dep.js'
export function declaration() {
return import('./deferred-effect.js')
}
export const arrow = () => import('./deferred-effect.js')
export const expression = function () {
return require('./deferred-effect.js')
}
export class DeferredContexts {
field = import('./deferred-effect.js')
constructor() {
require('./deferred-effect.js')
}
method() {
return import('./deferred-effect.js')
}
get loaded() {
return require('./deferred-effect.js')
}
set loaded(value) {
if (value) require('./deferred-effect.js')
}
}
export const derived = value + 1
globalThis.__lateDynamicEffect = (globalThis.__lateDynamicEffect ?? 0) + 1
export const value = 'dynamic'
import { value } from './pure-dep.js'
export function load() {
return import('./dynamic-effect.js')
}
export const derived = value + 1
import { value } from './pure-dep.js'
export function loadDynamic() {
return import('./dynamic-effect.js')
}
export const derived = value + 1
import { value } from './pure-dep.js'
import('./evaluation-effect.js')
require('./evaluation-require-effect.cjs')
void (/*#__PURE__*/ (() => import('./evaluation-effect.js'))())
void (
/*#__PURE__*/ ((callback) => callback)(() => import('./evaluation-effect.js'))
)
class EvaluationContexts {
static field = import('./evaluation-effect.js')
static {
require('./evaluation-require-effect.cjs')
}
}
export const derived = value + 1
export { EvaluationContexts }
globalThis.__evaluationContextEffect = true
module.exports = { value: 'evaluation-require' }
import * as dynamicUnused from './dynamic-unused.js'
import * as requireUnused from './require-unused.js'
import * as deferredContexts from './deferred-contexts.js'
import * as evaluationContexts from './evaluation-contexts.js'
import { loadDynamic } from './dynamic-used.js'
import { loadRequire } from './require-used.js'
const unusedDynamic = dynamicUnused
const unusedRequire = requireUnused
const unusedDeferredContexts = deferredContexts
const unusedEvaluationContexts = evaluationContexts
it('separates evaluation-time and deferred module edges', async () => {
expect(globalThis.__lateDynamicEffect).toBeUndefined()
expect(globalThis.__lateRequireEffect).toBeUndefined()
expect(globalThis.__evaluationContextEffect).toBe(true)
const factory = __turbopack_modules__.get(
[...__turbopack_modules__.keys()].find((moduleId) =>
moduleId.endsWith(
'side-effect-optimization/late-edges/input/index.js [test] (ecmascript)'
)
)
)
const source = factory.toString()
const inputPath = ['side-effect-optimization', 'late-edges', 'input'].join(
'/'
)
expect(source).not.toContain(`${inputPath}/dynamic-unused.js`)
expect(source).not.toContain(`${inputPath}/require-unused.js`)
expect(source).not.toContain(`${inputPath}/deferred-contexts.js`)
expect(source).toContain(`${inputPath}/evaluation-contexts.js`)
const dynamicModule = await loadDynamic()
expect(dynamicModule.value).toBe('dynamic')
expect(globalThis.__lateDynamicEffect).toBe(1)
const requiredModule = loadRequire()
expect(requiredModule.value).toBe('require')
expect(globalThis.__lateRequireEffect).toBe(1)
})
globalThis.__lateRequireEffect = (globalThis.__lateRequireEffect ?? 0) + 1
module.exports = { value: 'require' }
import { value } from './pure-dep.js'
export function load() {
return require('./require-effect.cjs')
}
export const derived = value + 1
import { value } from './pure-dep.js'
export function loadRequire() {
return require('./require-effect.cjs')
}
export const derived = value + 1
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