@@ -3587,6 +3587,9 @@ describe('ReactDOMFizzServer', () => {
3587
3587
'<script type="importmap">' +
3588
3588
JSON . stringify ( importMap ) +
3589
3589
'</script><script async="" src="foo"></script>' +
3590
+ ( gate ( flags => flags . shouldUseFizzExternalRuntime )
3591
+ ? '<script src="react-dom-bindings/src/server/ReactDOMServerExternalRuntime.js" async=""></script>'
3592
+ : '' ) +
3590
3593
'<link rel="expect" href="#«R»" blocking="render">' ,
3591
3594
) ;
3592
3595
} ) ;
@@ -4501,7 +4504,7 @@ describe('ReactDOMFizzServer', () => {
4501
4504
expect ( document . getElementsByTagName ( 'script' ) . length ) . toEqual ( 1 ) ;
4502
4505
} ) ;
4503
4506
4504
- it ( 'does not send the external runtime for static pages' , async ( ) => {
4507
+ it ( 'does (unfortunately) send the external runtime for static pages' , async ( ) => {
4505
4508
await act ( ( ) => {
4506
4509
const { pipe} = renderToPipeableStream (
4507
4510
< html >
@@ -4515,11 +4518,11 @@ describe('ReactDOMFizzServer', () => {
4515
4518
} ) ;
4516
4519
4517
4520
// no scripts should be sent
4518
- expect ( document . getElementsByTagName ( 'script' ) . length ) . toEqual ( 0 ) ;
4521
+ expect ( document . getElementsByTagName ( 'script' ) . length ) . toEqual ( 1 ) ;
4519
4522
4520
4523
// the html should be as-is
4521
4524
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>' ,
4525
+ '<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>' ,
4523
4526
) ;
4524
4527
} ) ;
4525
4528
@@ -5317,7 +5320,9 @@ describe('ReactDOMFizzServer', () => {
5317
5320
} ) ;
5318
5321
5319
5322
expect ( container . innerHTML ) . toEqual (
5320
- '<div>hello<b>world, <!-- -->Foo</b>!</div>' ,
5323
+ ( gate ( flags => flags . shouldUseFizzExternalRuntime )
5324
+ ? '<script src="react-dom-bindings/src/server/ReactDOMServerExternalRuntime.js" async=""></script>'
5325
+ : '' ) + '<div>hello<b>world, <!-- -->Foo</b>!</div>' ,
5321
5326
) ;
5322
5327
const errors = [ ] ;
5323
5328
ReactDOMClient . hydrateRoot ( container , < App name = "Foo" /> , {
@@ -5518,7 +5523,7 @@ describe('ReactDOMFizzServer', () => {
5518
5523
pipe ( writable ) ;
5519
5524
} ) ;
5520
5525
5521
- expect ( container . firstElementChild . outerHTML ) . toEqual (
5526
+ expect ( container . lastElementChild . outerHTML ) . toEqual (
5522
5527
'<div>hello<b>world<!-- --></b></div>' ,
5523
5528
) ;
5524
5529
@@ -5556,7 +5561,7 @@ describe('ReactDOMFizzServer', () => {
5556
5561
pipe ( writable ) ;
5557
5562
} ) ;
5558
5563
5559
- expect ( container . firstElementChild . outerHTML ) . toEqual (
5564
+ expect ( container . lastElementChild . outerHTML ) . toEqual (
5560
5565
'<div>hello<b>world</b></div>' ,
5561
5566
) ;
5562
5567
@@ -5696,7 +5701,10 @@ describe('ReactDOMFizzServer', () => {
5696
5701
} ) ;
5697
5702
5698
5703
expect ( container . innerHTML ) . toEqual (
5699
- '<div><!--$-->hello<!-- -->world<!-- --><!--/$--><!--$-->world<!-- --><!--/$--><!--$-->hello<!-- -->world<!-- --><br><!--/$--><!--$-->world<!-- --><br><!--/$--></div>' ,
5704
+ ( gate ( flags => flags . shouldUseFizzExternalRuntime )
5705
+ ? '<script src="react-dom-bindings/src/server/ReactDOMServerExternalRuntime.js" async=""></script>'
5706
+ : '' ) +
5707
+ '<div><!--$-->hello<!-- -->world<!-- --><!--/$--><!--$-->world<!-- --><!--/$--><!--$-->hello<!-- -->world<!-- --><br><!--/$--><!--$-->world<!-- --><br><!--/$--></div>' ,
5700
5708
) ;
5701
5709
5702
5710
const errors = [ ] ;
@@ -6499,7 +6507,11 @@ describe('ReactDOMFizzServer', () => {
6499
6507
} ) ;
6500
6508
6501
6509
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>' ,
6510
+ '<html><head>' +
6511
+ ( gate ( flags => flags . shouldUseFizzExternalRuntime )
6512
+ ? '<script src="react-dom-bindings/src/server/ReactDOMServerExternalRuntime.js" async=""></script>'
6513
+ : '' ) +
6514
+ '<link rel="expect" href="#«R»" blocking="render"></head><body><script>try { foo() } catch (e) {} ;</script><template id="«R»"></template></body></html>' ,
6503
6515
) ;
6504
6516
} ) ;
6505
6517
0 commit comments