@@ -39,7 +39,7 @@ use turbo_tasks_fs::{
39
39
use turbopack:: {
40
40
module_options:: ModuleOptionsContext ,
41
41
resolve_options_context:: ResolveOptionsContext ,
42
- transition:: { ContextTransition , TransitionOptions } ,
42
+ transition:: { FullContextTransition , Transition , TransitionOptions } ,
43
43
ModuleAssetContext ,
44
44
} ;
45
45
use turbopack_core:: {
@@ -290,7 +290,27 @@ impl PagesProject {
290
290
}
291
291
292
292
#[ turbo_tasks:: function]
293
- async fn transitions ( self : Vc < Self > ) -> Result < Vc < TransitionOptions > > {
293
+ async fn client_transitions ( self : Vc < Self > ) -> Result < Vc < TransitionOptions > > {
294
+ Ok ( TransitionOptions {
295
+ named_transitions : [
296
+ (
297
+ "next-dynamic" . into ( ) ,
298
+ ResolvedVc :: upcast ( NextDynamicTransition :: new_marker ( ) . to_resolved ( ) . await ?) ,
299
+ ) ,
300
+ (
301
+ "next-dynamic-client" . into ( ) ,
302
+ ResolvedVc :: upcast ( NextDynamicTransition :: new_marker ( ) . to_resolved ( ) . await ?) ,
303
+ ) ,
304
+ ]
305
+ . into_iter ( )
306
+ . collect ( ) ,
307
+ ..Default :: default ( )
308
+ }
309
+ . cell ( ) )
310
+ }
311
+
312
+ #[ turbo_tasks:: function]
313
+ async fn server_transitions ( self : Vc < Self > ) -> Result < Vc < TransitionOptions > > {
294
314
Ok ( TransitionOptions {
295
315
named_transitions : [
296
316
(
@@ -314,13 +334,16 @@ impl PagesProject {
314
334
}
315
335
316
336
#[ turbo_tasks:: function]
317
- fn client_transition ( self : Vc < Self > ) -> Vc < ContextTransition > {
318
- ContextTransition :: new (
319
- self . project ( ) . client_compile_time_info ( ) ,
320
- self . client_module_options_context ( ) ,
321
- self . client_resolve_options_context ( ) ,
322
- client_layer ( ) ,
323
- )
337
+ fn client_transition ( self : Vc < Self > ) -> Vc < Box < dyn Transition > > {
338
+ Vc :: upcast ( FullContextTransition :: new ( self . client_module_context ( ) ) )
339
+
340
+ // Vc::upcast(ContextTransition::new(
341
+ // self.project().client_compile_time_info(),
342
+ // self.client_module_options_context(),
343
+ // self.client_resolve_options_context(),
344
+ // TransitionOptions::value_default(),
345
+ // client_layer(),
346
+ // ))
324
347
}
325
348
326
349
#[ turbo_tasks:: function]
@@ -353,20 +376,20 @@ impl PagesProject {
353
376
}
354
377
355
378
#[ turbo_tasks:: function]
356
- pub ( super ) fn client_module_context ( self : Vc < Self > ) -> Vc < Box < dyn AssetContext > > {
357
- Vc :: upcast ( ModuleAssetContext :: new (
358
- self . transitions ( ) ,
379
+ pub ( super ) fn client_module_context ( self : Vc < Self > ) -> Vc < ModuleAssetContext > {
380
+ ModuleAssetContext :: new (
381
+ self . client_transitions ( ) ,
359
382
self . project ( ) . client_compile_time_info ( ) ,
360
383
self . client_module_options_context ( ) ,
361
384
self . client_resolve_options_context ( ) ,
362
385
client_layer ( ) ,
363
- ) )
386
+ )
364
387
}
365
388
366
389
#[ turbo_tasks:: function]
367
390
pub ( super ) fn ssr_module_context ( self : Vc < Self > ) -> Vc < ModuleAssetContext > {
368
391
ModuleAssetContext :: new (
369
- self . transitions ( ) ,
392
+ self . server_transitions ( ) ,
370
393
self . project ( ) . server_compile_time_info ( ) ,
371
394
self . ssr_module_options_context ( ) ,
372
395
self . ssr_resolve_options_context ( ) ,
@@ -379,7 +402,7 @@ impl PagesProject {
379
402
#[ turbo_tasks:: function]
380
403
pub ( super ) fn api_module_context ( self : Vc < Self > ) -> Vc < ModuleAssetContext > {
381
404
ModuleAssetContext :: new (
382
- self . transitions ( ) ,
405
+ self . server_transitions ( ) ,
383
406
self . project ( ) . server_compile_time_info ( ) ,
384
407
self . api_module_options_context ( ) ,
385
408
self . ssr_resolve_options_context ( ) ,
@@ -390,7 +413,7 @@ impl PagesProject {
390
413
#[ turbo_tasks:: function]
391
414
pub ( super ) fn ssr_data_module_context ( self : Vc < Self > ) -> Vc < ModuleAssetContext > {
392
415
ModuleAssetContext :: new (
393
- self . transitions ( ) ,
416
+ self . server_transitions ( ) ,
394
417
self . project ( ) . server_compile_time_info ( ) ,
395
418
self . ssr_data_module_options_context ( ) ,
396
419
self . ssr_resolve_options_context ( ) ,
@@ -566,7 +589,7 @@ impl PagesProject {
566
589
self . project ( ) . next_config ( ) ,
567
590
self . project ( ) . execution_context ( ) ,
568
591
) ;
569
- Ok ( client_runtime_entries. resolve_entries ( self . client_module_context ( ) ) )
592
+ Ok ( client_runtime_entries. resolve_entries ( Vc :: upcast ( self . client_module_context ( ) ) ) )
570
593
}
571
594
572
595
#[ turbo_tasks:: function]
@@ -615,7 +638,7 @@ impl PagesProject {
615
638
616
639
#[ turbo_tasks:: function]
617
640
pub async fn client_main_module ( self : Vc < Self > ) -> Result < Vc < Box < dyn Module > > > {
618
- let client_module_context = self . client_module_context ( ) ;
641
+ let client_module_context = Vc :: upcast ( self . client_module_context ( ) ) ;
619
642
620
643
let client_main_module = esm_resolve (
621
644
Vc :: upcast ( PlainResolveOrigin :: new (
@@ -722,7 +745,7 @@ impl PageEndpoint {
722
745
async fn client_module ( self : Vc < Self > ) -> Result < Vc < Box < dyn Module > > > {
723
746
let this = self . await ?;
724
747
let page_loader = create_page_loader_entry_module (
725
- this. pages_project . client_module_context ( ) ,
748
+ Vc :: upcast ( this. pages_project . client_module_context ( ) ) ,
726
749
self . source ( ) ,
727
750
* this. pathname ,
728
751
) ;
0 commit comments