@@ -3587,6 +3587,9 @@ describe('ReactDOMFizzServer', () => {
35873587 '<script type="importmap">' +
35883588 JSON . stringify ( importMap ) +
35893589 '</script><script async="" src="foo"></script>' +
3590+ ( gate ( flags => flags . shouldUseFizzExternalRuntime )
3591+ ? '<script src="react-dom-bindings/src/server/ReactDOMServerExternalRuntime.js" async=""></script>'
3592+ : '' ) +
35903593 '<link rel="expect" href="#«R»" blocking="render">' ,
35913594 ) ;
35923595 } ) ;
@@ -4501,7 +4504,8 @@ describe('ReactDOMFizzServer', () => {
45014504 expect ( document . getElementsByTagName ( 'script' ) . length ) . toEqual ( 1 ) ;
45024505 } ) ;
45034506
4504- it ( 'does not send the external runtime for static pages' , async ( ) => {
4507+ // @gate shouldUseFizzExternalRuntime
4508+ it ( 'does (unfortunately) send the external runtime for static pages' , async ( ) => {
45054509 await act ( ( ) => {
45064510 const { pipe} = renderToPipeableStream (
45074511 < html >
@@ -4515,11 +4519,11 @@ describe('ReactDOMFizzServer', () => {
45154519 } ) ;
45164520
45174521 // no scripts should be sent
4518- expect ( document . getElementsByTagName ( 'script' ) . length ) . toEqual ( 0 ) ;
4522+ expect ( document . getElementsByTagName ( 'script' ) . length ) . toEqual ( 1 ) ;
45194523
45204524 // the html should be as-is
45214525 expect ( document . documentElement . innerHTML ) . toEqual (
4522- '<head><link rel="expect" href="#«R»" blocking="render"></head><body><p>hello world!</p><template id="«R»"></template></body>' ,
4526+ '<head><script src="react-dom-bindings/src/server/ReactDOMServerExternalRuntime.js" async=""></script>< link rel="expect" href="#«R»" blocking="render"></head><body><p>hello world!</p><template id="«R»"></template></body>' ,
45234527 ) ;
45244528 } ) ;
45254529
@@ -5317,7 +5321,9 @@ describe('ReactDOMFizzServer', () => {
53175321 } ) ;
53185322
53195323 expect ( container . innerHTML ) . toEqual (
5320- '<div>hello<b>world, <!-- -->Foo</b>!</div>' ,
5324+ ( gate ( flags => flags . shouldUseFizzExternalRuntime )
5325+ ? '<script src="react-dom-bindings/src/server/ReactDOMServerExternalRuntime.js" async=""></script>'
5326+ : '' ) + '<div>hello<b>world, <!-- -->Foo</b>!</div>' ,
53215327 ) ;
53225328 const errors = [ ] ;
53235329 ReactDOMClient . hydrateRoot ( container , < App name = "Foo" /> , {
@@ -5518,7 +5524,7 @@ describe('ReactDOMFizzServer', () => {
55185524 pipe ( writable ) ;
55195525 } ) ;
55205526
5521- expect ( container . firstElementChild . outerHTML ) . toEqual (
5527+ expect ( container . lastElementChild . outerHTML ) . toEqual (
55225528 '<div>hello<b>world<!-- --></b></div>' ,
55235529 ) ;
55245530
@@ -5556,7 +5562,7 @@ describe('ReactDOMFizzServer', () => {
55565562 pipe ( writable ) ;
55575563 } ) ;
55585564
5559- expect ( container . firstElementChild . outerHTML ) . toEqual (
5565+ expect ( container . lastElementChild . outerHTML ) . toEqual (
55605566 '<div>hello<b>world</b></div>' ,
55615567 ) ;
55625568
@@ -5696,7 +5702,10 @@ describe('ReactDOMFizzServer', () => {
56965702 } ) ;
56975703
56985704 expect ( container . innerHTML ) . toEqual (
5699- '<div><!--$-->hello<!-- -->world<!-- --><!--/$--><!--$-->world<!-- --><!--/$--><!--$-->hello<!-- -->world<!-- --><br><!--/$--><!--$-->world<!-- --><br><!--/$--></div>' ,
5705+ ( gate ( flags => flags . shouldUseFizzExternalRuntime )
5706+ ? '<script src="react-dom-bindings/src/server/ReactDOMServerExternalRuntime.js" async=""></script>'
5707+ : '' ) +
5708+ '<div><!--$-->hello<!-- -->world<!-- --><!--/$--><!--$-->world<!-- --><!--/$--><!--$-->hello<!-- -->world<!-- --><br><!--/$--><!--$-->world<!-- --><br><!--/$--></div>' ,
57005709 ) ;
57015710
57025711 const errors = [ ] ;
@@ -6499,7 +6508,11 @@ describe('ReactDOMFizzServer', () => {
64996508 } ) ;
65006509
65016510 expect ( document . documentElement . outerHTML ) . toEqual (
6502- '<html><head><link rel="expect" href="#«R»" blocking="render"></head><body><script>try { foo() } catch (e) {} ;</script><template id="«R»"></template></body></html>' ,
6511+ '<html><head>' +
6512+ ( gate ( flags => flags . shouldUseFizzExternalRuntime )
6513+ ? '<script src="react-dom-bindings/src/server/ReactDOMServerExternalRuntime.js" async=""></script>'
6514+ : '' ) +
6515+ '<link rel="expect" href="#«R»" blocking="render"></head><body><script>try { foo() } catch (e) {} ;</script><template id="«R»"></template></body></html>' ,
65036516 ) ;
65046517 } ) ;
65056518
0 commit comments