File tree Expand file tree Collapse file tree 3 files changed +10
-10
lines changed
Expand file tree Collapse file tree 3 files changed +10
-10
lines changed Original file line number Diff line number Diff line change @@ -100,7 +100,7 @@ async function createVirtualRouteModuleCode({
100100 }
101101 }
102102 if ( viteCommand === "serve" && ! hasClientExports ) {
103- code += `export { __ensureClientRouteModuleForHmr } from "${ clientModuleId } ";\n` ;
103+ code += `export { __ensureClientRouteModuleForHMR } from "${ clientModuleId } ";\n` ;
104104 }
105105 } else {
106106 for ( const staticExport of staticExports ) {
@@ -183,7 +183,7 @@ function createVirtualClientRouteModuleCode({
183183 }
184184
185185 if ( viteCommand === "serve" && isServerFirstRoute && ! hasClientExports ) {
186- generatorResult . code += `\nexport const __ensureClientRouteModuleForHmr = true;` ;
186+ generatorResult . code += `\nexport const __ensureClientRouteModuleForHMR = true;` ;
187187 }
188188
189189 return generatorResult ;
@@ -198,9 +198,9 @@ export function parseRouteExports(code: string) {
198198 return {
199199 staticExports,
200200 isServerFirstRoute,
201- hasClientExports : isServerFirstRoute
202- ? staticExports . some ( isClientNonComponentExport )
203- : staticExports . some ( isClientRouteExport ) ,
201+ hasClientExports : staticExports . some (
202+ isServerFirstRoute ? isClientNonComponentExport : isClientRouteExport ,
203+ ) ,
204204 } ;
205205}
206206
Original file line number Diff line number Diff line change @@ -78,7 +78,7 @@ function validateRefreshBoundaryAndEnqueueUpdate(
7878 nextExports ,
7979 ( key , value ) => {
8080 hasExports = true ;
81- // Remix can handle Remix-specific exports (e.g. `meta` and `links`)
81+ // React Router can handle additional exports (e.g. `meta` and `links`)
8282 if ( acceptExports . includes ( key ) ) return true ;
8383 // React Fast Refresh can handle component exports
8484 if ( exports . isLikelyComponentType ( value ) ) return true ;
Original file line number Diff line number Diff line change @@ -1111,11 +1111,11 @@ async function getRSCRouteMatch(
11111111 pathnameBase : match . pathnameBase ,
11121112 shouldRevalidate : ( match . route as any ) . shouldRevalidate ,
11131113 // Add an unused client-only export (if present) so HMR can support
1114- // switching from server-first to client-only routes during development
1115- ...( ( match . route as any ) . __ensureClientRouteModuleForHmr
1114+ // switching between server-first and client-only routes during development
1115+ ...( ( match . route as any ) . __ensureClientRouteModuleForHMR
11161116 ? {
1117- __ensureClientRouteModuleForHmr : ( match . route as any )
1118- . __ensureClientRouteModuleForHmr ,
1117+ __ensureClientRouteModuleForHMR : ( match . route as any )
1118+ . __ensureClientRouteModuleForHMR ,
11191119 }
11201120 : { } ) ,
11211121 } ;
You can’t perform that action at this time.
0 commit comments