File tree Expand file tree Collapse file tree 2 files changed +13
-3
lines changed Expand file tree Collapse file tree 2 files changed +13
-3
lines changed Original file line number Diff line number Diff line change @@ -1262,17 +1262,26 @@ function vitePluginUseServer(
12621262              ) }  , ${ JSON . stringify ( name ) }  )`, 
12631263            rejectNonAsyncFunction : true , 
12641264            encode : enableEncryption 
1265-               ? ( value )  =>  `$$ReactServer.encryptActionBoundArgs(${ value }  )` 
1265+               ? ( value )  => 
1266+                   `__vite_rsc_encryption_runtime.encryptActionBoundArgs(${ value }  )` 
12661267              : undefined , 
12671268            decode : enableEncryption 
12681269              ? ( value )  => 
1269-                   `await $$ReactServer .decryptActionBoundArgs(${ value }  )` 
1270+                   `await __vite_rsc_encryption_runtime .decryptActionBoundArgs(${ value }  )` 
12701271              : undefined , 
12711272          } ) 
12721273          if  ( ! output . hasChanged ( ) )  return 
12731274          serverReferences [ getNormalizedId ( ) ]  =  id 
1274-           const  importSource  =  resolvePackage ( `${ PKG_NAME }  /rsc` ) 
1275+           const  importSource  =  resolvePackage ( `${ PKG_NAME }  /react/ rsc` ) 
12751276          output . prepend ( `import * as $$ReactServer from "${ importSource }  ";\n` ) 
1277+           if  ( enableEncryption )  { 
1278+             const  importSource  =  resolvePackage ( 
1279+               `${ PKG_NAME }  /utils/encryption-runtime` , 
1280+             ) 
1281+             output . prepend ( 
1282+               `import * as __vite_rsc_encryption_runtime from ${ JSON . stringify ( importSource ) }  ;\n` , 
1283+             ) 
1284+           } 
12761285          return  { 
12771286            code : output . toString ( ) , 
12781287            map : output . generateMap ( {  hires : 'boundary'  } ) , 
Original file line number Diff line number Diff line change @@ -22,6 +22,7 @@ export default defineConfig({
2222    'src/rsc-html-stream/ssr.ts' , 
2323    'src/rsc-html-stream/browser.ts' , 
2424    'src/utils/rpc.ts' , 
25+     'src/utils/encryption-runtime.ts' , 
2526  ] , 
2627  format : [ 'esm' ] , 
2728  external : [ / ^ v i r t u a l : / ,  / ^ @ v i t e j s \/ p l u g i n - r s c \/ v e n d o r \/ / ] , 
    
 
   
 
     
   
   
          
     
  
    
     
 
    
      
     
 
     
    You can’t perform that action at this time.
  
 
    
  
     
    
      
        
     
 
       
      
     
   
 
    
    
  
 
  
 
     
    
0 commit comments