Skip to content

Commit 4d25156

Browse files
committed
Test fixes
1 parent 7c4338f commit 4d25156

16 files changed

+27
-62
lines changed

turbopack/crates/turbopack-ecmascript/src/references/pattern_mapping.rs

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ use swc_core::{
1212
};
1313
use turbo_rcstr::{RcStr, rcstr};
1414
use turbo_tasks::{
15-
FxIndexMap, NonLocalValue, ResolvedVc, TaskInput, TryJoinIterExt, Vc, debug::ValueDebugFormat,
15+
FxIndexMap, NonLocalValue, TaskInput, TryJoinIterExt, Vc, debug::ValueDebugFormat,
1616
trace::TraceRawVcs,
1717
};
1818
use turbopack_core::{
@@ -28,7 +28,6 @@ use turbopack_core::{
2828
};
2929

3030
use crate::{
31-
chunk::EcmascriptChunkPlaceable,
3231
references::util::{
3332
request_to_string, throw_module_not_found_error_expr, throw_module_not_found_expr,
3433
throw_module_not_found_expr_async,
@@ -356,7 +355,12 @@ async fn to_single_pattern_mapping(
356355
return Ok(SinglePatternMapping::Invalid);
357356
}
358357
};
359-
if ResolvedVc::try_sidecast::<Box<dyn EcmascriptChunkPlaceable>>(module).is_some() {
358+
if chunking_context
359+
.chunking_configs()
360+
.await?
361+
.is_chunkable(module)
362+
.await
363+
{
360364
match resolve_type {
361365
ResolveType::AsyncChunkLoader => {
362366
let ident = chunking_context.async_loader_chunk_item_ident(*module);
@@ -375,9 +379,9 @@ async fn to_single_pattern_mapping(
375379
}
376380
CodeGenerationIssue {
377381
severity: IssueSeverity::Bug,
378-
title: StyledString::Text(rcstr!("non-ecmascript placeable asset")).resolved_cell(),
382+
title: StyledString::Text(rcstr!("non-chunkable asset")).resolved_cell(),
379383
message: StyledString::Text(rcstr!(
380-
"asset is not placeable in ESM chunks, so it doesn't have a module id"
384+
"asset is not chunkable, so it doesn't have a module id"
381385
))
382386
.resolved_cell(),
383387
path: origin.origin_path().owned().await?,

turbopack/crates/turbopack-tests/tests/snapshot/css/css/issues/non-ecmascript placeable asset-4544ad.txt

Lines changed: 0 additions & 3 deletions
This file was deleted.

turbopack/crates/turbopack-tests/tests/snapshot/css/css/output/turbopack_crates_turbopack-tests_tests_snapshot_css_css_input_afc361f3._.js

Lines changed: 1 addition & 3 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

turbopack/crates/turbopack-tests/tests/snapshot/css/css/output/turbopack_crates_turbopack-tests_tests_snapshot_css_css_input_afc361f3._.js.map

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

turbopack/crates/turbopack-tests/tests/snapshot/css/cycle/issues/non-ecmascript placeable asset-9a4d50.txt

Lines changed: 0 additions & 3 deletions
This file was deleted.

turbopack/crates/turbopack-tests/tests/snapshot/css/cycle/output/turbopack_crates_turbopack-tests_tests_snapshot_css_cycle_input_index_39005623.js

Lines changed: 5 additions & 15 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

turbopack/crates/turbopack-tests/tests/snapshot/css/cycle/output/turbopack_crates_turbopack-tests_tests_snapshot_css_cycle_input_index_39005623.js.map

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

turbopack/crates/turbopack-tests/tests/snapshot/css/cycle2/issues/non-ecmascript placeable asset-eb6e9e.txt

Lines changed: 0 additions & 3 deletions
This file was deleted.

turbopack/crates/turbopack-tests/tests/snapshot/css/cycle2/output/turbopack_crates_turbopack-tests_tests_snapshot_css_cycle2_input_index_be143712.js

Lines changed: 2 additions & 6 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

turbopack/crates/turbopack-tests/tests/snapshot/css/cycle2/output/turbopack_crates_turbopack-tests_tests_snapshot_css_cycle2_input_index_be143712.js.map

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)