Skip to content

Commit 6bcf811

Browse files
authored
Merge branch 'canary' into fix-rspack-split-chunks
2 parents 6439e32 + 2279884 commit 6bcf811

File tree

1,262 files changed

+16750
-3132
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

1,262 files changed

+16750
-3132
lines changed

.github/workflows/build_and_test.yml

Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -521,6 +521,50 @@ jobs:
521521

522522
secrets: inherit
523523

524+
# TODO: Remove this once we bump minimum Node.js version to v22
525+
test-next-config-ts-native-ts-dev:
526+
name: test next-config-ts-native-ts dev
527+
needs: ['changes', 'build-next', 'build-native']
528+
if: ${{ needs.changes.outputs.docs-only == 'false' }}
529+
530+
strategy:
531+
fail-fast: false
532+
matrix:
533+
node: [22, 24]
534+
535+
uses: ./.github/workflows/build_reusable.yml
536+
with:
537+
nodeVersion: ${{ matrix.node }}
538+
afterBuild: |
539+
export NEXT_TEST_MODE=dev
540+
export NODE_OPTIONS=--experimental-transform-types
541+
node run-tests.js test/e2e/app-dir/next-config-ts-native-ts/**/*.test.ts
542+
stepName: 'test-next-config-ts-native-ts-dev-${{ matrix.node }}'
543+
544+
secrets: inherit
545+
546+
# TODO: Remove this once we bump minimum Node.js version to v22
547+
test-next-config-ts-native-ts-prod:
548+
name: test next-config-ts-native-ts prod
549+
needs: ['changes', 'build-next', 'build-native']
550+
if: ${{ needs.changes.outputs.docs-only == 'false' }}
551+
552+
strategy:
553+
fail-fast: false
554+
matrix:
555+
node: [22, 24]
556+
557+
uses: ./.github/workflows/build_reusable.yml
558+
with:
559+
nodeVersion: ${{ matrix.node }}
560+
afterBuild: |
561+
export NEXT_TEST_MODE=start
562+
export NODE_OPTIONS=--experimental-transform-types
563+
node run-tests.js test/e2e/app-dir/next-config-ts-native-ts/**/*.test.ts
564+
stepName: 'test-next-config-ts-native-ts-prod-${{ matrix.node }}'
565+
566+
secrets: inherit
567+
524568
test-unit-windows:
525569
name: test unit windows
526570
needs: ['changes', 'build-native', 'build-native-windows']
@@ -956,6 +1000,8 @@ jobs:
9561000
'validate-docs-links',
9571001
'check-types-precompiled',
9581002
'test-unit',
1003+
'test-next-config-ts-native-ts-dev',
1004+
'test-next-config-ts-native-ts-prod',
9591005
'test-dev',
9601006
'test-prod',
9611007
'test-integration',

.github/workflows/build_reusable.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -227,7 +227,7 @@ jobs:
227227

228228
- name: Install node-file-trace test dependencies
229229
if: ${{ inputs.needsNextest == 'yes' }}
230-
working-directory: turbopack/crates/turbopack/tests/node-file-trace
230+
working-directory: turbopack/crates/turbopack-tracing/tests/node-file-trace
231231
run: pnpm install -r --side-effects-cache false
232232

233233
- run: ANALYZE=1 pnpm build

.prettierignore

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -71,6 +71,8 @@ test/e2e/async-modules/amp-validator-wasm.js
7171
/turbopack/crates/turbopack-tests/tests/snapshot/source_maps/*
7272
/turbopack/crates/turbopack-tests/tests/**/output*
7373
/turbopack/crates/turbopack-tests/tests/**/static
74+
/turbopack/crates/turbopack-tracing/tests/node-file-trace/test/unit/syntax-err/input.js
75+
/turbopack/crates/turbopack-tracing/tests/node-file-trace/test/unit/tsx/lib.tsx
7476

7577
/apps/docs/.source/*
7678

@@ -84,7 +86,6 @@ test/integration/edge-runtime-configurable-guards/node_modules/lib
8486
test/production/app-dir/symbolic-file-links/src/i18n.ts
8587
test/production/app-dir/symbolic-file-links/src/app/layout.tsx
8688
test/production/app-dir/symbolic-file-links/src/app/page.tsx
87-
turbopack/crates/turbopack/tests/node-file-trace/integration/pnpm/node_modules/foo
88-
turbopack/crates/turbopack/tests/node-file-trace/integration/pnpm/node_modules/.pnpm/[email protected]/node_modules/lodash-pnpm-test
89-
turbopack/crates/turbopack/tests/node-file-trace/integration/symlink-to-file/linked.js
89+
turbopack/crates/turbopack-tracing/tests/node-file-trace/integration/pnpm/node_modules/*
90+
turbopack/crates/turbopack-tracing/tests/node-file-trace/integration/symlink-to-file/linked.js
9091
turbopack/crates/turbopack-tests/tests/snapshot/swc_transforms/mono_transforms/input/node_modules/component

Cargo.lock

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

crates/napi/src/next_api/project.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -525,8 +525,7 @@ async fn benchmark_file_io(
525525
directory: FileSystemPath,
526526
) -> Result<Vc<Completion>> {
527527
// try to get the real file path on disk so that we can use it with tokio
528-
let fs = Vc::try_resolve_downcast_type::<DiskFileSystem>(directory.fs())
529-
.await?
528+
let fs = ResolvedVc::try_downcast_type::<DiskFileSystem>(directory.fs)
530529
.context(anyhow!(
531530
"expected node_root to be a DiskFileSystem, cannot benchmark"
532531
))?

crates/next-api/src/app.rs

Lines changed: 21 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -383,7 +383,7 @@ impl AppProject {
383383
)),
384384
module_styles_rule_condition(),
385385
]),
386-
ResolvedVc::upcast(self.css_client_reference_transition().to_resolved().await?),
386+
self.css_client_reference_transition().to_resolved().await?,
387387
),
388388
// Don't wrap in marker module but change context, this is used to determine
389389
// the list of CSS module classes.
@@ -399,7 +399,7 @@ impl AppProject {
399399
// Mark as client reference all regular CSS imports
400400
TransitionRule::new(
401401
styles_rule_condition(),
402-
ResolvedVc::upcast(self.css_client_reference_transition().to_resolved().await?),
402+
self.css_client_reference_transition().to_resolved().await?,
403403
),
404404
],
405405
..Default::default()
@@ -413,7 +413,7 @@ impl AppProject {
413413
self.get_rsc_transitions(
414414
self.ecmascript_client_reference_transition(),
415415
Vc::upcast(self.ssr_transition()),
416-
Vc::upcast(self.shared_transition()),
416+
self.shared_transition(),
417417
),
418418
self.project().server_compile_time_info(),
419419
self.rsc_module_options_context(),
@@ -428,7 +428,7 @@ impl AppProject {
428428
self.get_rsc_transitions(
429429
self.edge_ecmascript_client_reference_transition(),
430430
Vc::upcast(self.edge_ssr_transition()),
431-
Vc::upcast(self.edge_shared_transition()),
431+
self.edge_shared_transition(),
432432
),
433433
self.project().edge_compile_time_info(),
434434
self.edge_rsc_module_options_context(),
@@ -467,7 +467,7 @@ impl AppProject {
467467
),
468468
(
469469
rcstr!("next-shared"),
470-
ResolvedVc::upcast(self.shared_transition().to_resolved().await?),
470+
self.shared_transition().to_resolved().await?,
471471
),
472472
(
473473
rcstr!("next-server-utility"),
@@ -518,7 +518,7 @@ impl AppProject {
518518
),
519519
(
520520
rcstr!("next-shared"),
521-
ResolvedVc::upcast(self.edge_shared_transition().to_resolved().await?),
521+
self.edge_shared_transition().to_resolved().await?,
522522
),
523523
(
524524
rcstr!("next-server-utility"),
@@ -640,7 +640,7 @@ impl AppProject {
640640
),
641641
(
642642
rcstr!("next-shared"),
643-
ResolvedVc::upcast(self.shared_transition().to_resolved().await?),
643+
self.shared_transition().to_resolved().await?,
644644
),
645645
]
646646
.into_iter()
@@ -712,7 +712,7 @@ impl AppProject {
712712
),
713713
(
714714
rcstr!("next-shared"),
715-
ResolvedVc::upcast(self.edge_shared_transition().to_resolved().await?),
715+
self.edge_shared_transition().to_resolved().await?,
716716
),
717717
]
718718
.into_iter()
@@ -877,8 +877,7 @@ impl AppProject {
877877
// Implements layout segment optimization to compute a graph "chain" for each layout
878878
// segment
879879
async move {
880-
let rsc_entry_chunk_group =
881-
ChunkGroupEntry::Entry(vec![ResolvedVc::upcast(rsc_entry)]);
880+
let rsc_entry_chunk_group = ChunkGroupEntry::Entry(vec![rsc_entry]);
882881

883882
let mut graphs = vec![];
884883
let mut visited_modules = if has_layout_segments {
@@ -1389,18 +1388,16 @@ impl AppEndpoint {
13891388
polyfill_files: vec![polyfill_output_asset],
13901389
..Default::default()
13911390
};
1392-
let build_manifest_output = ResolvedVc::upcast(
1393-
build_manifest
1394-
.build_output(
1395-
node_root.join(&format!(
1396-
"server/app{manifest_path_prefix}/build-manifest.json",
1397-
))?,
1398-
client_relative_path.clone(),
1399-
)
1400-
.await?
1401-
.to_resolved()
1402-
.await?,
1403-
);
1391+
let build_manifest_output = build_manifest
1392+
.build_output(
1393+
node_root.join(&format!(
1394+
"server/app{manifest_path_prefix}/build-manifest.json",
1395+
))?,
1396+
client_relative_path.clone(),
1397+
)
1398+
.await?
1399+
.to_resolved()
1400+
.await?;
14041401
server_assets.insert(build_manifest_output);
14051402
}
14061403

@@ -1548,7 +1545,7 @@ impl AppEndpoint {
15481545
if emit_manifests == EmitManifests::Full {
15491546
let dynamic_import_entries = collect_next_dynamic_chunks(
15501547
*module_graphs.full,
1551-
*ResolvedVc::upcast(client_chunking_context),
1548+
*client_chunking_context,
15521549
next_dynamic_imports,
15531550
NextDynamicChunkAvailability::ClientReferences(
15541551
&*(client_references_chunks.await?),
@@ -1663,7 +1660,7 @@ impl AppEndpoint {
16631660
// create react-loadable-manifest for next/dynamic
16641661
let dynamic_import_entries = collect_next_dynamic_chunks(
16651662
*module_graphs.full,
1666-
*ResolvedVc::upcast(client_chunking_context),
1663+
*client_chunking_context,
16671664
next_dynamic_imports,
16681665
NextDynamicChunkAvailability::ClientReferences(
16691666
&*(client_references_chunks.await?),

crates/next-api/src/dynamic_imports.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@ pub(crate) async fn collect_next_dynamic_chunks(
8080
let async_chunk_group = async_loader.references().to_resolved().await?;
8181

8282
let module_id = dynamic_entry
83-
.chunk_item_id(Vc::upcast(chunking_context))
83+
.chunk_item_id(chunking_context)
8484
.to_resolved()
8585
.await?;
8686

crates/next-api/src/nft_json.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -398,7 +398,7 @@ pub async fn all_assets_from_entries_filtered(
398398
.iter()
399399
.map(async |asset| {
400400
Ok((
401-
ResolvedVc::upcast(*asset),
401+
*asset,
402402
if emit_spans {
403403
Some(asset.path().to_string().await?)
404404
} else {

crates/next-api/src/pages.rs

Lines changed: 11 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -322,7 +322,7 @@ impl PagesProject {
322322
(
323323
rcstr!("next-dynamic-client"),
324324
ResolvedVc::upcast(
325-
NextDynamicTransition::new_client(Vc::upcast(self.client_transition()))
325+
NextDynamicTransition::new_client(self.client_transition())
326326
.to_resolved()
327327
.await?,
328328
),
@@ -1073,7 +1073,7 @@ impl PageEndpoint {
10731073
{
10741074
collect_next_dynamic_chunks(
10751075
self.client_module_graph(),
1076-
Vc::upcast(project.client_chunking_context()),
1076+
project.client_chunking_context(),
10771077
next_dynamic_imports,
10781078
NextDynamicChunkAvailability::AvailabilityInfo(client_availability_info),
10791079
)
@@ -1084,7 +1084,7 @@ impl PageEndpoint {
10841084

10851085
let chunking_context: Vc<Box<dyn ChunkingContext>> = match runtime {
10861086
NextRuntime::NodeJs => Vc::upcast(node_chunking_context),
1087-
NextRuntime::Edge => Vc::upcast(edge_chunking_context),
1087+
NextRuntime::Edge => edge_chunking_context,
10881088
};
10891089

10901090
let mut current_chunks = OutputAssets::empty();
@@ -1342,16 +1342,14 @@ impl PageEndpoint {
13421342
..Default::default()
13431343
};
13441344
let manifest_path_prefix = get_asset_prefix_from_pathname(&self.pathname);
1345-
Ok(Vc::upcast(
1346-
build_manifest
1347-
.build_output(
1348-
node_root.join(&format!(
1349-
"server/pages{manifest_path_prefix}/build-manifest.json",
1350-
))?,
1351-
client_relative_path,
1352-
)
1353-
.await?,
1354-
))
1345+
build_manifest
1346+
.build_output(
1347+
node_root.join(&format!(
1348+
"server/pages{manifest_path_prefix}/build-manifest.json",
1349+
))?,
1350+
client_relative_path,
1351+
)
1352+
.await
13551353
}
13561354

13571355
#[turbo_tasks::function]

crates/next-api/src/project.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1380,7 +1380,7 @@ impl Project {
13801380

13811381
let middleware = self.find_middleware();
13821382
let FindContextFileResult::Found(fs_path, _) = &*middleware.await? else {
1383-
return Ok(Vc::upcast(edge_module_context));
1383+
return Ok(edge_module_context);
13841384
};
13851385
let source = Vc::upcast(FileSource::new(fs_path.clone()));
13861386

0 commit comments

Comments
 (0)