Skip to content

Commit dc132a5

Browse files
authored
Merge branch 'canary' into otel-span-name
2 parents f61b75e + 33016f3 commit dc132a5

File tree

190 files changed

+8687
-5029
lines changed

Some content is hidden

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

190 files changed

+8687
-5029
lines changed

.github/workflows/build_and_test.yml

Lines changed: 35 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -269,9 +269,9 @@ jobs:
269269
group: [1/6, 2/6, 3/6, 4/6, 5/6, 6/6]
270270
# Empty value uses default
271271
# TODO: Run with React 18.
272-
# Integration tests use the installed React version in next/package.json.include:
272+
# Integration tests use the installed React version in next/package.json.
273273
# We can't easily switch like we do for e2e tests.
274-
# Skipping this dimensions until we can figure out a way to test multiple React versions.
274+
# Skipping this dimension until we can figure out a way to test multiple React versions.
275275
react: ['']
276276
uses: ./.github/workflows/build_reusable.yml
277277
with:
@@ -301,10 +301,6 @@ jobs:
301301
- react: ${{ github.event_name == 'pull_request' && !contains(github.event.pull_request.labels.*.name, 'run-react-18-tests') && '18.3.1' }}
302302
group: [1/7, 2/7, 3/7, 4/7, 5/7, 6/7, 7/7]
303303
# Empty value uses default
304-
# TODO: Run with React 18.
305-
# Integration tests use the installed React version in next/package.json.include:
306-
# We can't easily switch like we do for e2e tests.
307-
# Skipping this dimensions until we can figure out a way to test multiple React versions.
308304
react: ['', '18.3.1']
309305
uses: ./.github/workflows/build_reusable.yml
310306
with:
@@ -328,18 +324,25 @@ jobs:
328324
fail-fast: false
329325
matrix:
330326
group: [1/7, 2/7, 3/7, 4/7, 5/7, 6/7, 7/7]
327+
# Empty value uses default
328+
# TODO: Run with React 18.
329+
# Integration tests use the installed React version in next/package.json.
330+
# We can't easily switch like we do for e2e tests.
331+
# Skipping this dimension until we can figure out a way to test multiple React versions.
332+
react: ['']
331333
uses: ./.github/workflows/build_reusable.yml
332334
with:
333335
nodeVersion: 20.9.0
334336
afterBuild: |
335337
export IS_TURBOPACK_TEST=1
336338
export TURBOPACK_BUILD=1
339+
export NEXT_TEST_REACT_VERSION="${{ matrix.react }}"
337340
338341
node run-tests.js \
339342
--timings \
340343
-g ${{ matrix.group }} \
341344
--type integration
342-
stepName: 'test-turbopack-production-integration-${{ matrix.group }}'
345+
stepName: 'test-turbopack-production-integration-react-${{ matrix.react }}-${{ matrix.group }}'
343346
secrets: inherit
344347

345348
test-rspack-dev:
@@ -349,12 +352,18 @@ jobs:
349352
strategy:
350353
fail-fast: false
351354
matrix:
355+
exclude:
356+
# Excluding React 18 tests unless on `canary` branch until budget is approved.
357+
- react: ${{ github.event_name == 'pull_request' && !contains(github.event.pull_request.labels.*.name, 'run-react-18-tests') && '18.3.1' }}
352358
group: [1/5, 2/5, 3/5, 4/5, 5/5]
359+
# Empty value uses default
360+
react: ['', '18.3.1']
353361
uses: ./.github/workflows/build_reusable.yml
354362
with:
355363
afterBuild: |
356364
export NEXT_EXTERNAL_TESTS_FILTERS="$(pwd)/test/rspack-dev-tests-manifest.json"
357365
export NEXT_TEST_MODE=dev
366+
export NEXT_TEST_REACT_VERSION="${{ matrix.react }}"
358367
359368
# rspack flags
360369
export NEXT_RSPACK=1
@@ -379,11 +388,18 @@ jobs:
379388
fail-fast: false
380389
matrix:
381390
group: [1/6, 2/6, 3/6, 4/6, 5/6, 6/6]
391+
# Empty value uses default
392+
# TODO: Run with React 18.
393+
# Integration tests use the installed React version in next/package.json.
394+
# We can't easily switch like we do for e2e tests.
395+
# Skipping this dimension until we can figure out a way to test multiple React versions.
396+
react: ['']
382397
uses: ./.github/workflows/build_reusable.yml
383398
with:
384399
nodeVersion: 20.9.0
385400
afterBuild: |
386401
export NEXT_EXTERNAL_TESTS_FILTERS="$(pwd)/test/rspack-dev-tests-manifest.json"
402+
export NEXT_TEST_REACT_VERSION="${{ matrix.react }}"
387403
388404
# rspack flags
389405
export NEXT_RSPACK=1
@@ -412,12 +428,14 @@ jobs:
412428
- react: ${{ github.event_name == 'pull_request' && !contains(github.event.pull_request.labels.*.name, 'run-react-18-tests') && '18.3.1' }}
413429
group: [1/7, 2/7, 3/7, 4/7, 5/7, 6/7, 7/7]
414430
# Empty value uses default
431+
react: ['', '18.3.1']
415432
uses: ./.github/workflows/build_reusable.yml
416433
with:
417434
nodeVersion: 20.9.0
418435
afterBuild: |
419436
export NEXT_EXTERNAL_TESTS_FILTERS="$(pwd)/test/rspack-build-tests-manifest.json"
420437
export NEXT_TEST_MODE=start
438+
export NEXT_TEST_REACT_VERSION="${{ matrix.react }}"
421439
422440
# rspack flags
423441
export NEXT_RSPACK=1
@@ -439,11 +457,18 @@ jobs:
439457
fail-fast: false
440458
matrix:
441459
group: [1/7, 2/7, 3/7, 4/7, 5/7, 6/7, 7/7]
460+
# Empty value uses default
461+
# TODO: Run with React 18.
462+
# Integration tests use the installed React version in next/package.json.
463+
# We can't easily switch like we do for e2e tests.
464+
# Skipping this dimension until we can figure out a way to test multiple React versions.
465+
react: ['']
442466
uses: ./.github/workflows/build_reusable.yml
443467
with:
444468
nodeVersion: 20.9.0
445469
afterBuild: |
446470
export NEXT_EXTERNAL_TESTS_FILTERS="$(pwd)/test/rspack-build-tests-manifest.json"
471+
export NEXT_TEST_REACT_VERSION="${{ matrix.react }}"
447472
448473
# rspack flags
449474
export NEXT_RSPACK=1
@@ -457,7 +482,7 @@ jobs:
457482
--timings \
458483
-g ${{ matrix.group }} \
459484
--type integration
460-
stepName: 'test-rspack-production-integration-${{ matrix.group }}'
485+
stepName: 'test-rspack-production-integration-react-${{ matrix.react }}-${{ matrix.group }}'
461486
secrets: inherit
462487

463488
test-next-swc-wasm:
@@ -813,9 +838,9 @@ jobs:
813838
- 13/13
814839
# Empty value uses default
815840
# TODO: Run with React 18.
816-
# Integration tests use the installed React version in next/package.json.include:
841+
# Integration tests use the installed React version in next/package.json.
817842
# We can't easily switch like we do for e2e tests.
818-
# Skipping this dimensions until we can figure out a way to test multiple React versions.
843+
# Skipping this dimension until we can figure out a way to test multiple React versions.
819844
react: ['']
820845
uses: ./.github/workflows/build_reusable.yml
821846
with:

crates/next-api/src/app.rs

Lines changed: 42 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -218,6 +218,7 @@ impl AppProject {
218218
NextRuntime::NodeJs,
219219
self.project().encryption_key(),
220220
self.project().server_compile_time_info().environment(),
221+
self.project().client_compile_time_info().environment(),
221222
))
222223
}
223224

@@ -232,6 +233,7 @@ impl AppProject {
232233
NextRuntime::Edge,
233234
self.project().encryption_key(),
234235
self.project().edge_compile_time_info().environment(),
236+
self.project().client_compile_time_info().environment(),
235237
))
236238
}
237239

@@ -246,6 +248,7 @@ impl AppProject {
246248
NextRuntime::NodeJs,
247249
self.project().encryption_key(),
248250
self.project().server_compile_time_info().environment(),
251+
self.project().client_compile_time_info().environment(),
249252
))
250253
}
251254

@@ -260,6 +263,7 @@ impl AppProject {
260263
NextRuntime::Edge,
261264
self.project().encryption_key(),
262265
self.project().edge_compile_time_info().environment(),
266+
self.project().client_compile_time_info().environment(),
263267
))
264268
}
265269

@@ -582,6 +586,7 @@ impl AppProject {
582586
NextRuntime::NodeJs,
583587
self.project().encryption_key(),
584588
self.project().server_compile_time_info().environment(),
589+
self.project().client_compile_time_info().environment(),
585590
))
586591
}
587592

@@ -596,6 +601,7 @@ impl AppProject {
596601
NextRuntime::Edge,
597602
self.project().encryption_key(),
598603
self.project().edge_compile_time_info().environment(),
604+
self.project().client_compile_time_info().environment(),
599605
))
600606
}
601607

@@ -1207,13 +1213,21 @@ impl AppEndpoint {
12071213
let runtime = app_entry.config.await?.runtime.unwrap_or_default();
12081214

12091215
let rsc_entry = app_entry.rsc_entry;
1216+
1217+
let is_app_page = matches!(this.ty, AppEndpointType::Page { .. });
1218+
12101219
let module_graphs = this
12111220
.app_project
12121221
.app_module_graphs(
12131222
self,
12141223
*rsc_entry,
1215-
this.app_project.client_runtime_entries(),
1216-
matches!(this.ty, AppEndpointType::Page { .. }),
1224+
// We only need the client runtime entries for pages not for Route Handlers
1225+
if is_app_page {
1226+
this.app_project.client_runtime_entries()
1227+
} else {
1228+
EvaluatableAssets::empty()
1229+
},
1230+
is_app_page,
12171231
)
12181232
.await?;
12191233

@@ -1235,25 +1249,34 @@ impl AppEndpoint {
12351249
None
12361250
};
12371251

1238-
let client_shared_chunk_group = get_app_client_shared_chunk_group(
1239-
AssetIdent::from_path(project.project_path().owned().await?)
1240-
.with_modifier(rcstr!("client-shared-chunks")),
1241-
this.app_project.client_runtime_entries(),
1242-
*module_graphs.full,
1243-
*client_chunking_context,
1244-
)
1245-
.await?;
1252+
// We only need the client runtime entries for pages not for Route Handlers
1253+
let (availability_info, client_shared_chunks) = if is_app_page {
1254+
let client_shared_chunk_group = get_app_client_shared_chunk_group(
1255+
AssetIdent::from_path(project.project_path().owned().await?)
1256+
.with_modifier(rcstr!("client-shared-chunks")),
1257+
this.app_project.client_runtime_entries(),
1258+
*module_graphs.full,
1259+
*client_chunking_context,
1260+
)
1261+
.await?;
12461262

1247-
let mut client_shared_chunks = vec![];
1248-
for chunk in client_shared_chunk_group.assets.await?.iter().copied() {
1249-
client_assets.insert(chunk);
1263+
let mut client_shared_chunks = vec![];
1264+
for chunk in client_shared_chunk_group.assets.await?.iter().copied() {
1265+
client_assets.insert(chunk);
12501266

1251-
let chunk_path = chunk.path().await?;
1252-
if chunk_path.has_extension(".js") {
1253-
client_shared_chunks.push(chunk);
1267+
let chunk_path = chunk.path().await?;
1268+
if chunk_path.has_extension(".js") {
1269+
client_shared_chunks.push(chunk);
1270+
}
12541271
}
1255-
}
1256-
let client_shared_availability_info = client_shared_chunk_group.availability_info;
1272+
1273+
(
1274+
client_shared_chunk_group.availability_info,
1275+
client_shared_chunks,
1276+
)
1277+
} else {
1278+
(AvailabilityInfo::Root, vec![])
1279+
};
12571280

12581281
let global_information = get_global_information_for_endpoint(
12591282
*module_graphs.base,
@@ -1276,7 +1299,7 @@ impl AppEndpoint {
12761299
*client_references,
12771300
*module_graphs.full,
12781301
*client_chunking_context,
1279-
client_shared_availability_info,
1302+
availability_info,
12801303
ssr_chunking_context.map(|ctx| *ctx),
12811304
)
12821305
.to_resolved()

crates/next-api/src/pages.rs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -460,6 +460,7 @@ impl PagesProject {
460460
NextRuntime::NodeJs,
461461
self.project().encryption_key(),
462462
self.project().server_compile_time_info().environment(),
463+
self.project().client_compile_time_info().environment(),
463464
))
464465
}
465466

@@ -476,6 +477,7 @@ impl PagesProject {
476477
NextRuntime::Edge,
477478
self.project().encryption_key(),
478479
self.project().edge_compile_time_info().environment(),
480+
self.project().client_compile_time_info().environment(),
479481
))
480482
}
481483

@@ -492,6 +494,7 @@ impl PagesProject {
492494
NextRuntime::NodeJs,
493495
self.project().encryption_key(),
494496
self.project().server_compile_time_info().environment(),
497+
self.project().client_compile_time_info().environment(),
495498
))
496499
}
497500

@@ -508,6 +511,7 @@ impl PagesProject {
508511
NextRuntime::Edge,
509512
self.project().encryption_key(),
510513
self.project().edge_compile_time_info().environment(),
514+
self.project().client_compile_time_info().environment(),
511515
))
512516
}
513517

@@ -524,6 +528,7 @@ impl PagesProject {
524528
NextRuntime::NodeJs,
525529
self.project().encryption_key(),
526530
self.project().server_compile_time_info().environment(),
531+
self.project().client_compile_time_info().environment(),
527532
))
528533
}
529534

@@ -542,6 +547,7 @@ impl PagesProject {
542547
NextRuntime::Edge,
543548
self.project().encryption_key(),
544549
self.project().edge_compile_time_info().environment(),
550+
self.project().client_compile_time_info().environment(),
545551
))
546552
}
547553

crates/next-api/src/project.rs

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -984,7 +984,6 @@ impl Project {
984984
format!("/ROOT/{}", self.project_path().await?.path).into(),
985985
this.define_env.nodejs(),
986986
self.current_node_js_version(),
987-
this.browserslist_query.clone(),
988987
))
989988
}
990989

@@ -995,7 +994,6 @@ impl Project {
995994
self.project_path().owned().await?,
996995
this.define_env.edge(),
997996
self.current_node_js_version(),
998-
this.browserslist_query.clone(),
999997
))
1000998
}
1001999

@@ -1296,6 +1294,7 @@ impl Project {
12961294
NextRuntime::Edge,
12971295
self.encryption_key(),
12981296
self.edge_compile_time_info().environment(),
1297+
self.client_compile_time_info().environment(),
12991298
),
13001299
get_edge_resolve_options_context(
13011300
self.project_path().owned().await?,
@@ -1358,6 +1357,7 @@ impl Project {
13581357
NextRuntime::NodeJs,
13591358
self.encryption_key(),
13601359
self.server_compile_time_info().environment(),
1360+
self.client_compile_time_info().environment(),
13611361
),
13621362
get_server_resolve_options_context(
13631363
self.project_path().owned().await?,
@@ -1472,6 +1472,7 @@ impl Project {
14721472
NextRuntime::NodeJs,
14731473
self.encryption_key(),
14741474
self.server_compile_time_info().environment(),
1475+
self.client_compile_time_info().environment(),
14751476
),
14761477
get_server_resolve_options_context(
14771478
self.project_path().owned().await?,
@@ -1534,6 +1535,7 @@ impl Project {
15341535
NextRuntime::Edge,
15351536
self.encryption_key(),
15361537
self.edge_compile_time_info().environment(),
1538+
self.client_compile_time_info().environment(),
15371539
),
15381540
get_edge_resolve_options_context(
15391541
self.project_path().owned().await?,

0 commit comments

Comments
 (0)