@@ -470,29 +470,7 @@ function runTests({ mode }: TestConfig) {
470470 ) . toBe ( true ) ;
471471 } ) ;
472472
473- it ( 'should keep callback runtime wiring out of component sources' , ( ) => {
474- const getFilesRecursively = ( directory : string ) : string [ ] =>
475- fs . readdirSync ( directory , { withFileTypes : true } ) . flatMap ( entry => {
476- const entryPath = path . join ( directory , entry . name ) ;
477- if ( entry . isDirectory ( ) ) {
478- return getFilesRecursively ( entryPath ) ;
479- }
480- return [ entryPath ] ;
481- } ) ;
482-
483- const componentFilePaths = getFilesRecursively (
484- path . join ( remoteDir , 'src/components' ) ,
485- ) ;
486- const hostSourceFilePaths = getFilesRecursively (
487- path . join ( hostDir , 'src' ) ,
488- ) . filter ( filePath => / \. ( t s | t s x ) $ / . test ( filePath ) ) ;
489-
490- const componentSources = componentFilePaths . map ( filePath =>
491- fs . readFileSync ( filePath , 'utf-8' ) ,
492- ) ;
493- const hostSourceTexts = hostSourceFilePaths . map ( filePath =>
494- fs . readFileSync ( filePath , 'utf-8' ) ,
495- ) ;
473+ it ( 'should keep callback helper surface constrained to runtime files' , ( ) => {
496474 const remoteRuntimeExposesDir = path . join (
497475 remoteDir ,
498476 'src/runtime/exposes' ,
@@ -510,33 +488,6 @@ function runTests({ mode }: TestConfig) {
510488 entryName => entryName !== 'exposes' ,
511489 ) ;
512490
513- expect (
514- componentSources . every (
515- source => ! source . includes ( 'initServerCallback' ) ,
516- ) ,
517- ) . toBe ( true ) ;
518- expect (
519- componentSources . every (
520- source => ! source . includes ( 'registerRemoteServerCallback' ) ,
521- ) ,
522- ) . toBe ( true ) ;
523- expect (
524- componentSources . every (
525- source =>
526- ! source . includes ( 'setServerCallback' ) &&
527- ! source . includes ( 'rsc-mf-react-server-dom-client-browser' ) ,
528- ) ,
529- ) . toBe ( true ) ;
530- expect (
531- hostSourceTexts . every (
532- source =>
533- ! source . includes ( 'registerRemoteServerCallback' ) &&
534- ! source . includes ( 'initServerCallback' ) &&
535- ! source . includes ( 'registerServerCallback' ) &&
536- ! source . includes ( 'setServerCallback' ) &&
537- ! source . includes ( 'rsc-mf-react-server-dom-client-browser' ) ,
538- ) ,
539- ) . toBe ( true ) ;
540491 expect ( remoteRuntimeExposeEntries ) . toEqual ( [ ] ) ;
541492 expect ( remoteRuntimeEntriesWithoutExposeDir ) . toEqual ( [
542493 'initServerCallback.ts' ,
0 commit comments