Skip to content

Commit 0b10e92

Browse files
committed
fixup
1 parent 8ec5184 commit 0b10e92

File tree

3 files changed

+26
-5
lines changed

3 files changed

+26
-5
lines changed

Diff for: turbopack/crates/turbopack-css/src/module_asset.rs

-1
Original file line numberDiff line numberDiff line change
@@ -329,7 +329,6 @@ impl EcmascriptChunkItem for ModuleChunkItem {
329329
async fn content(&self) -> Result<Vc<EcmascriptChunkItemContent>> {
330330
let classes = self.module.classes().await?;
331331

332-
// TODO turn this into a rope
333332
let mut code = format!("{TURBOPACK_EXPORT_VALUE}({{\n");
334333
for (export_name, class_names) in &*classes {
335334
let mut exported_class_names = Vec::with_capacity(class_names.len());

Diff for: turbopack/crates/turbopack-ecmascript/src/references/mod.rs

+26-3
Original file line numberDiff line numberDiff line change
@@ -145,7 +145,8 @@ use crate::{
145145
type_issue::SpecifiedModuleTypeIssue,
146146
},
147147
runtime_functions::{
148-
TUBROPACK_RUNTIME_FUNCTION_SHORTCUTS, TURBOPACK_REQUIRE_REAL, TURBOPACK_REQUIRE_STUB,
148+
TUBROPACK_RUNTIME_FUNCTION_SHORTCUTS, TURBOPACK_EXPORT_NAMESPACE, TURBOPACK_EXPORT_VALUE,
149+
TURBOPACK_REQUIRE_REAL, TURBOPACK_REQUIRE_STUB,
149150
},
150151
tree_shake::{find_turbopack_part_id_in_asserts, part_of_module, split},
151152
utils::{module_value_to_well_known_object, AstPathRange},
@@ -3437,21 +3438,43 @@ fn detect_dynamic_export(p: &Program) -> DetectedDynamicExportType {
34373438
self.cjs = true;
34383439
self.found = true;
34393440
}
3440-
// TODO these are members now
34413441
if &*i.sym == "__turbopack_export_value__" {
34423442
self.value = true;
34433443
self.found = true;
34443444
}
3445-
// TODO these are members now
34463445
if &*i.sym == "__turbopack_export_namespace__" {
34473446
self.namespace = true;
34483447
self.found = true;
34493448
}
34503449
}
3450+
34513451
fn visit_expr(&mut self, n: &Expr) {
34523452
if self.found {
34533453
return;
34543454
}
3455+
3456+
if let Expr::Member(member) = n {
3457+
if member.obj.is_ident_ref_to("__turbopack_context__") {
3458+
if let MemberProp::Ident(prop) = &member.prop {
3459+
const TURBOPACK_EXPORT_VALUE_SHORTCUT: &str =
3460+
TURBOPACK_EXPORT_VALUE.shortcut;
3461+
const TURBOPACK_EXPORT_NAMESPACE_SHORTCUT: &str =
3462+
TURBOPACK_EXPORT_NAMESPACE.shortcut;
3463+
match &*prop.sym {
3464+
TURBOPACK_EXPORT_VALUE_SHORTCUT => {
3465+
self.value = true;
3466+
self.found = true;
3467+
}
3468+
TURBOPACK_EXPORT_NAMESPACE_SHORTCUT => {
3469+
self.namespace = true;
3470+
self.found = true;
3471+
}
3472+
_ => {}
3473+
}
3474+
}
3475+
}
3476+
}
3477+
34553478
n.visit_children_with(self);
34563479
}
34573480

Diff for: turbopack/crates/turbopack-ecmascript/src/tree_shake/util.rs

-1
Original file line numberDiff line numberDiff line change
@@ -481,7 +481,6 @@ impl Visit for ShouldSkip {
481481
..
482482
}) = &*n.arg
483483
{
484-
// TODO this is a member expression now
485484
if expr.is_ident_ref_to("__turbopack_wasm_module__") {
486485
self.skip = true;
487486
return;

0 commit comments

Comments
 (0)