@@ -101,14 +101,14 @@ pub async fn get_app_page_entry(
101
101
let file = File :: from ( result. build ( ) ) ;
102
102
let source = VirtualSource :: new ( source. ident ( ) . path ( ) , AssetContent :: file ( file. into ( ) ) ) ;
103
103
104
- let rsc_entry = context. process (
104
+ let mut rsc_entry = context. process (
105
105
Vc :: upcast ( source) ,
106
106
Value :: new ( ReferenceType :: Internal ( Vc :: cell ( inner_assets) ) ) ,
107
107
) ;
108
108
109
109
if is_edge {
110
- todo ! ( "edge pages are not supported yet" )
111
- }
110
+ rsc_entry = wrap_edge_entry ( context , project_root , rsc_entry ) . await ? ;
111
+ } ;
112
112
113
113
let Some ( rsc_entry) =
114
114
Vc :: try_resolve_downcast :: < Box < dyn EcmascriptChunkPlaceable > > ( rsc_entry) . await ?
@@ -124,3 +124,30 @@ pub async fn get_app_page_entry(
124
124
}
125
125
. cell ( ) )
126
126
}
127
+
128
+ async fn wrap_edge_entry (
129
+ context : Vc < ModuleAssetContext > ,
130
+ project_root : Vc < FileSystemPath > ,
131
+ entry : Vc < Box < dyn Module > > ,
132
+ ) -> Result < Vc < Box < dyn Module > > > {
133
+ const INNER : & str = "INNER_RSC_ENTRY" ;
134
+
135
+ let source = load_next_js_template (
136
+ "edge-app-route.js" ,
137
+ project_root,
138
+ indexmap ! {
139
+ "VAR_USERLAND" => INNER . to_string( ) ,
140
+ } ,
141
+ indexmap ! { } ,
142
+ )
143
+ . await ?;
144
+
145
+ let inner_assets = indexmap ! {
146
+ INNER . to_string( ) => entry
147
+ } ;
148
+
149
+ Ok ( context. process (
150
+ Vc :: upcast ( source) ,
151
+ Value :: new ( ReferenceType :: Internal ( Vc :: cell ( inner_assets) ) ) ,
152
+ ) )
153
+ }
0 commit comments