Enable no-longer experimental (#24727)
Sebastian Markbåge committed
Jun 14, 2022 at 17:11 UTC
6522179f43949d3b5d9b7d46f7a2f9574eebce81
4 files changed
+16
-115
packages/react-dom/src/__tests__/ReactDOMFizzServer-test.js
+12
-67
@@ -37,9 +37,7 @@ describe('ReactDOMFizzServer', () => {
37
Scheduler = require('scheduler');
38
React = require('react');
39
ReactDOMClient = require('react-dom/client');
40
- if (__EXPERIMENTAL__) {
41
- ReactDOMFizzServer = require('react-dom/server');
42
- }
40
+ ReactDOMFizzServer = require('react-dom/server');
41
Stream = require('stream');
42
Suspense = React.Suspense;
43
if (gate(flags => flags.enableSuspenseList)) {
@@ -263,7 +261,6 @@ describe('ReactDOMFizzServer', () => {
261
return <As>{readText(text)}</As>;
262
}
263
266
- // @gate experimental
264
it('should asynchronously load a lazy component', async () => {
265
let resolveA;
266
const LazyA = React.lazy(() => {
@@ -330,7 +327,6 @@ describe('ReactDOMFizzServer', () => {
327
);
328
});
329
333
- // @gate experimental
330
it('#23331: does not warn about hydration mismatches if something suspended in an earlier sibling', async () => {
331
const makeApp = () => {
332
let resolve;
@@ -396,7 +392,6 @@ describe('ReactDOMFizzServer', () => {
392
);
393
});
394
399
- // @gate experimental
395
it('should support nonce scripts', async () => {
396
CSPnonce = 'R4nd0m';
397
try {
@@ -428,7 +423,6 @@ describe('ReactDOMFizzServer', () => {
423
}
424
});
425
431
- // @gate experimental
426
it('should client render a boundary if a lazy component rejects', async () => {
427
let rejectComponent;
428
const LazyComponent = React.lazy(() => {
@@ -522,7 +516,6 @@ describe('ReactDOMFizzServer', () => {
516
expect(loggedErrors).toEqual([theError]);
517
});
518
525
- // @gate experimental
519
it('should asynchronously load a lazy element', async () => {
520
let resolveElement;
521
const lazyElement = React.lazy(() => {
@@ -552,7 +545,6 @@ describe('ReactDOMFizzServer', () => {
545
expect(getVisibleChildren(container)).toEqual(<div>Hello</div>);
546
});
547
555
- // @gate experimental
548
it('should client render a boundary if a lazy element rejects', async () => {
549
let rejectElement;
550
const element = <Text text="Hello" />;
@@ -642,7 +634,6 @@ describe('ReactDOMFizzServer', () => {
634
expect(loggedErrors).toEqual([theError]);
635
});
636
645
- // @gate experimental
637
it('Errors in boundaries should be sent to the client and reported on client render - Error before flushing', async () => {
638
function Indirection({level, children}) {
639
if (level > 0) {
@@ -719,7 +710,6 @@ describe('ReactDOMFizzServer', () => {
710
);
711
});
712
722
- // @gate experimental
713
it('Errors in boundaries should be sent to the client and reported on client render - Error after flushing', async () => {
714
let rejectComponent;
715
const LazyComponent = React.lazy(() => {
@@ -802,7 +792,6 @@ describe('ReactDOMFizzServer', () => {
792
expect(loggedErrors).toEqual([theError]);
793
});
794
805
- // @gate experimental
795
it('should asynchronously load the suspense boundary', async () => {
796
await act(async () => {
797
const {pipe} = ReactDOMFizzServer.renderToPipeableStream(
@@ -821,7 +810,6 @@ describe('ReactDOMFizzServer', () => {
810
expect(getVisibleChildren(container)).toEqual(<div>Hello World</div>);
811
});
812
824
- // @gate experimental
813
it('waits for pending content to come in from the server and then hydrates it', async () => {
814
const ref = React.createRef();
815
@@ -885,7 +873,6 @@ describe('ReactDOMFizzServer', () => {
873
expect(ref.current).toBe(h1);
874
});
875
888
- // @gate experimental
876
it('handles an error on the client if the server ends up erroring', async () => {
877
const ref = React.createRef();
878
@@ -967,7 +954,7 @@ describe('ReactDOMFizzServer', () => {
954
});
955
956
// @gate enableSuspenseList
970
- // @gate experimental
957
+
958
it('shows inserted items before pending in a SuspenseList as fallbacks while hydrating', async () => {
959
const ref = React.createRef();
960
@@ -1056,7 +1043,6 @@ describe('ReactDOMFizzServer', () => {
1043
expect(ref.current).toBe(span);
1044
});
1045
1059
- // @gate experimental
1046
it('client renders a boundary if it does not resolve before aborting', async () => {
1047
function App() {
1048
return (
@@ -1134,7 +1120,6 @@ describe('ReactDOMFizzServer', () => {
1120
);
1121
});
1122
1137
- // @gate experimental
1123
it('should allow for two containers to be written to the same document', async () => {
1124
// We create two passthrough streams for each container to write into.
1125
// Notably we don't implement a end() call for these. Because we don't want to
@@ -1225,7 +1210,6 @@ describe('ReactDOMFizzServer', () => {
1210
]);
1211
});
1212
1228
- // @gate experimental
1213
it('can resolve async content in esoteric parents', async () => {
1214
function AsyncOption({text}) {
1215
return <option>{readText(text)}</option>;
@@ -1323,7 +1307,6 @@ describe('ReactDOMFizzServer', () => {
1307
);
1308
});
1309
1326
- // @gate experimental
1310
it('can resolve async content in table parents', async () => {
1311
function AsyncTableBody({className, children}) {
1312
return <tbody className={readText(className)}>{children}</tbody>;
@@ -1396,7 +1379,6 @@ describe('ReactDOMFizzServer', () => {
1379
);
1380
});
1381
1399
- // @gate experimental
1382
it('can stream into an SVG container', async () => {
1383
function AsyncPath({id}) {
1384
return <path id={readText(id)} />;
@@ -1461,7 +1443,6 @@ describe('ReactDOMFizzServer', () => {
1443
);
1444
}
1445
1464
- // @gate experimental
1446
it('should include a component stack across suspended boundaries', async () => {
1447
function B() {
1448
const children = [readText('Hello'), readText('World')];
@@ -1561,7 +1542,6 @@ describe('ReactDOMFizzServer', () => {
1542
}
1543
});
1544
1564
- // @gate experimental
1545
it('should can suspend in a class component with legacy context', async () => {
1546
class TestProvider extends React.Component {
1547
static childContextTypes = {
@@ -1629,7 +1609,6 @@ describe('ReactDOMFizzServer', () => {
1609
);
1610
});
1611
1632
- // @gate experimental
1612
it('should resume the context from where it left off', async () => {
1613
const ContextA = React.createContext('A0');
1614
const ContextB = React.createContext('B0');
@@ -1694,7 +1673,6 @@ describe('ReactDOMFizzServer', () => {
1673
);
1674
});
1675
1697
- // @gate experimental
1676
it('should recover the outer context when an error happens inside a provider', async () => {
1677
const ContextA = React.createContext('A0');
1678
const ContextB = React.createContext('B0');
@@ -1761,7 +1739,6 @@ describe('ReactDOMFizzServer', () => {
1739
);
1740
});
1741
1764
- // @gate experimental
1742
it('client renders a boundary if it errors before finishing the fallback', async () => {
1743
function App({isClient}) {
1744
return (
@@ -1869,7 +1846,6 @@ describe('ReactDOMFizzServer', () => {
1846
expect(loggedErrors).toEqual([theError]);
1847
});
1848
1872
- // @gate experimental
1849
it('should be able to abort the fallback if the main content finishes first', async () => {
1850
await act(async () => {
1851
const {pipe} = ReactDOMFizzServer.renderToPipeableStream(
@@ -1899,7 +1875,7 @@ describe('ReactDOMFizzServer', () => {
1875
expect(getVisibleChildren(container)).toEqual(<div>Hello</div>);
1876
});
1877
1902
- // @gate experimental && enableSuspenseAvoidThisFallbackFizz
1878
+ // @gate enableSuspenseAvoidThisFallbackFizz
1879
it('should respect unstable_avoidThisFallback', async () => {
1880
const resolved = {
1881
0: false,
@@ -2046,7 +2022,6 @@ describe('ReactDOMFizzServer', () => {
2022
);
2023
});
2024
2049
- // @gate experimental
2025
it('calls getServerSnapshot instead of getSnapshot', async () => {
2026
const ref = React.createRef();
2027
@@ -2127,7 +2102,7 @@ describe('ReactDOMFizzServer', () => {
2102
});
2103
2104
// The selector implementation uses the lazy ref initialization pattern
2130
- // @gate experimental
2105
+
2106
it('calls getServerSnapshot instead of getSnapshot (with selector and isEqual)', async () => {
2107
// Same as previous test, but with a selector that returns a complex object
2108
// that is memoized with a custom `isEqual` function.
@@ -2212,7 +2187,6 @@ describe('ReactDOMFizzServer', () => {
2187
expect(getVisibleChildren(container)).toEqual(<div>client</div>);
2188
});
2189
2215
- // @gate experimental
2190
it(
2191
'errors during hydration in the shell force a client render at the ' +
2192
'root, and during the client render it recovers',
@@ -2295,7 +2269,6 @@ describe('ReactDOMFizzServer', () => {
2269
},
2270
);
2271
2298
- // @gate experimental
2272
it(
2273
'errors during hydration force a client render at the nearest Suspense ' +
2274
'boundary, and during the client render it recovers',
@@ -2389,7 +2362,6 @@ describe('ReactDOMFizzServer', () => {
2362
},
2363
);
2364
2392
- // @gate experimental
2365
it(
2366
'errors during hydration force a client render at the nearest Suspense ' +
2367
'boundary, and during the client render it fails again',
@@ -2464,7 +2436,7 @@ describe('ReactDOMFizzServer', () => {
2436
2437
// Disabled because of a WWW late mutations regression.
2438
// We may want to re-enable this if we figure out why.
2467
- // @gate experimental
2439
+
2440
// @gate FIXME
2441
it('does not recreate the fallback if server errors and hydration suspends', async () => {
2442
let isClient = false;
@@ -2546,7 +2518,7 @@ describe('ReactDOMFizzServer', () => {
2518
2519
// Disabled because of a WWW late mutations regression.
2520
// We may want to re-enable this if we figure out why.
2549
- // @gate experimental
2521
+
2522
// @gate FIXME
2523
it(
2524
'does not recreate the fallback if server errors and hydration suspends ' +
@@ -2645,7 +2617,7 @@ describe('ReactDOMFizzServer', () => {
2617
2618
// Disabled because of a WWW late mutations regression.
2619
// We may want to re-enable this if we figure out why.
2648
- // @gate experimental
2620
+
2621
// @gate FIXME
2622
it(
2623
'recreates the fallback if server errors and hydration suspends but ' +
@@ -2751,7 +2723,6 @@ describe('ReactDOMFizzServer', () => {
2723
},
2724
);
2725
2754
- // @gate experimental
2726
it(
2727
'errors during hydration force a client render at the nearest Suspense ' +
2728
'boundary, and during the client render it recovers, then a deeper ' +
@@ -2921,7 +2892,6 @@ describe('ReactDOMFizzServer', () => {
2892
expect(container.textContent).toEqual('AB');
2893
});
2894
2924
- // @gate experimental
2895
it('logs multiple hydration errors in the same render', async () => {
2896
let isClient = false;
2897
@@ -2991,7 +2961,7 @@ describe('ReactDOMFizzServer', () => {
2961
]);
2962
});
2963
2994
- // @gate enableServerContext && experimental
2964
+ // @gate enableServerContext
2965
it('supports ServerContext', async () => {
2966
let ServerContext;
2967
function inlineLazyServerContextInitialization() {
@@ -3040,7 +3010,6 @@ describe('ReactDOMFizzServer', () => {
3010
]);
3011
});
3012
3043
- // @gate experimental
3013
it('Supports iterable', async () => {
3014
const Immutable = require('immutable');
3015
@@ -3063,7 +3032,6 @@ describe('ReactDOMFizzServer', () => {
3032
);
3033
});
3034
3066
- // @gate experimental
3035
it('Supports custom abort reasons with a string', async () => {
3036
function App() {
3037
return (
@@ -3150,7 +3118,6 @@ describe('ReactDOMFizzServer', () => {
3118
);
3119
});
3120
3153
- // @gate experimental
3121
it('Supports custom abort reasons with an Error', async () => {
3122
function App() {
3123
return (
@@ -3236,7 +3203,6 @@ describe('ReactDOMFizzServer', () => {
3203
});
3204
3205
describe('error escaping', () => {
3239
- //@gate experimental
3206
it('escapes error hash, message, and component stack values in directly flushed errors (html escaping)', async () => {
3207
window.__outlet = {};
3208
@@ -3281,7 +3247,7 @@ describe('ReactDOMFizzServer', () => {
3247
});
3248
expect(window.__outlet).toEqual({});
3249
});
3284
- //@gate experimental
3250
+
3251
it('escapes error hash, message, and component stack values in clientRenderInstruction (javascript escaping)', async () => {
3252
window.__outlet = {};
3253
@@ -3333,7 +3299,7 @@ describe('ReactDOMFizzServer', () => {
3299
});
3300
expect(window.__outlet).toEqual({});
3301
});
3336
- //@gate experimental
3302
+
3303
it('escapes such that attributes cannot be masked', async () => {
3304
const dangerousErrorString = '" data-msg="bad message" data-foo="';
3305
const theError = new Error(dangerousErrorString);
@@ -3399,7 +3365,6 @@ describe('ReactDOMFizzServer', () => {
3365
});
3366
3367
describe('bootstrapScriptContent escaping', () => {
3402
- // @gate experimental
3368
it('the "S" in "</?[Ss]cript" strings are replaced with unicode escaped lowercase s or S depending on case, preserving case sensitivity of nearby characters', async () => {
3369
window.__test_outlet = '';
3370
const stringWithScriptsInIt =
@@ -3416,7 +3381,6 @@ describe('ReactDOMFizzServer', () => {
3381
expect(window.__test_outlet).toMatch(stringWithScriptsInIt);
3382
});
3383
3419
- // @gate experimental
3384
it('does not escape \\u2028, or \\u2029 characters', async () => {
3385
// these characters are ignored in engines support https://github.com/tc39/proposal-json-superset
3386
// in this test with JSDOM the characters are silently dropped and thus don't need to be encoded.
@@ -3441,7 +3405,6 @@ describe('ReactDOMFizzServer', () => {
3405
);
3406
});
3407
3444
- // @gate experimental
3408
it('does not escape <, >, or & characters', async () => {
3409
// these characters valid javascript and may be necessary in scripts and won't be interpretted properly
3410
// escaped outside of a string context within javascript
@@ -3459,7 +3422,6 @@ describe('ReactDOMFizzServer', () => {
3422
});
3423
});
3424
3462
- // @gate experimental
3425
it('#24384: Suspending should halt hydration warnings and not emit any if hydration completes successfully after unsuspending', async () => {
3426
const makeApp = () => {
3427
let resolve, resolved;
@@ -3535,7 +3497,6 @@ describe('ReactDOMFizzServer', () => {
3497
);
3498
});
3499
3538
- // @gate experimental
3500
it('#24384: Suspending should halt hydration warnings but still emit hydration warnings after unsuspending if mismatches are genuine', async () => {
3501
const makeApp = () => {
3502
let resolve, resolved;
@@ -3625,7 +3586,6 @@ describe('ReactDOMFizzServer', () => {
3586
expect(Scheduler).toFlushAndYield([]);
3587
});
3588
3628
- // @gate experimental
3589
it('only warns once on hydration mismatch while within a suspense boundary', async () => {
3590
const originalConsoleError = console.error;
3591
const mockError = jest.fn();
@@ -3704,7 +3664,6 @@ describe('ReactDOMFizzServer', () => {
3664
}
3665
});
3666
3707
- // @gate experimental
3667
it('supresses hydration warnings when an error occurs within a Suspense boundary', async () => {
3668
let isClient = false;
3669
let shouldThrow = true;
@@ -3778,7 +3737,7 @@ describe('ReactDOMFizzServer', () => {
3737
expect(Scheduler).toFlushAndYield([]);
3738
});
3739
3781
- // @gate experimental && __DEV__
3740
+ // @gate __DEV__
3741
it('does not invokeGuardedCallback for errors after the first hydration error', async () => {
3742
// We can't use the toErrorDev helper here because this is async.
3743
const originalConsoleError = console.error;
@@ -3890,7 +3849,6 @@ describe('ReactDOMFizzServer', () => {
3849
}
3850
});
3851
3893
- // @gate experimental
3852
it('does not invokeGuardedCallback for errors after a preceding fiber suspends', async () => {
3853
// We can't use the toErrorDev helper here because this is async.
3854
const originalConsoleError = console.error;
@@ -4013,7 +3971,7 @@ describe('ReactDOMFizzServer', () => {
3971
}
3972
});
3973
4016
- // @gate experimental && __DEV__
3974
+ // @gate __DEV__
3975
it('suspending after erroring will cause errors previously queued to be silenced until the boundary resolves', async () => {
3976
// We can't use the toErrorDev helper here because this is async.
3977
const originalConsoleError = console.error;
@@ -4141,7 +4099,6 @@ describe('ReactDOMFizzServer', () => {
4099
}
4100
});
4101
4144
- // @gate experimental
4102
it('#24578 Hydration errors caused by a suspending component should not become recoverable when nested in an ancestor Suspense that is showing primary content', async () => {
4103
// this test failed before because hydration errors on the inner boundary were upgraded to recoverable by
4104
// a codepath of the outer boundary
@@ -4196,7 +4153,6 @@ describe('ReactDOMFizzServer', () => {
4153
});
4154
}
4155
4199
- // @gate experimental
4156
it('it only includes separators between adjacent text nodes', async () => {
4157
function App({name}) {
4158
return (
@@ -4231,7 +4187,6 @@ describe('ReactDOMFizzServer', () => {
4187
);
4188
});
4189
4234
- // @gate experimental
4190
it('it does not insert text separators even when adjacent text is in a delayed segment', async () => {
4191
function App({name}) {
4192
return (
@@ -4287,7 +4242,6 @@ describe('ReactDOMFizzServer', () => {
4242
);
4243
});
4244
4290
- // @gate experimental
4245
it('it works with multiple adjacent segments', async () => {
4246
function App() {
4247
return (
@@ -4333,7 +4287,6 @@ describe('ReactDOMFizzServer', () => {
4287
);
4288
});
4289
4336
- // @gate experimental
4290
it('it works when some segments are flushed and others are patched', async () => {
4291
function App() {
4292
return (
@@ -4376,7 +4329,6 @@ describe('ReactDOMFizzServer', () => {
4329
);
4330
});
4331
4379
- // @gate experimental
4332
it('it does not prepend a text separators if the segment follows a non-Text Node', async () => {
4333
function App() {
4334
return (
@@ -4417,7 +4369,6 @@ describe('ReactDOMFizzServer', () => {
4369
);
4370
});
4371
4420
- // @gate experimental
4372
it('it does not prepend a text separators if the segments first emission is a non-Text Node', async () => {
4373
function App() {
4374
return (
@@ -4456,7 +4407,6 @@ describe('ReactDOMFizzServer', () => {
4407
);
4408
});
4409
4459
- // @gate experimental
4410
it('should not insert separators for text inside Suspense boundaries even if they would otherwise be considered text-embedded', async () => {
4411
function App() {
4412
return (
@@ -4541,7 +4491,6 @@ describe('ReactDOMFizzServer', () => {
4491
);
4492
});
4493
4544
- // @gate experimental
4494
it('(only) includes extraneous text separators in segments that complete before flushing, followed by nothing or a non-Text node', async () => {
4495
function App() {
4496
return (
@@ -4615,7 +4564,6 @@ describe('ReactDOMFizzServer', () => {
4564
container = document.getElementsByTagName('head')[0];
4565
}
4566
4618
- // @gate experimental
4567
it('should accept a single string child', async () => {
4568
// a Single string child
4569
function App() {
@@ -4640,7 +4588,6 @@ describe('ReactDOMFizzServer', () => {
4588
expect(getVisibleChildren(container)).toEqual(<title>hello</title>);
4589
});
4590
4643
- // @gate experimental
4591
it('should accept children array of length 1 containing a string', async () => {
4592
// a Single string child
4593
function App() {
@@ -4665,7 +4612,6 @@ describe('ReactDOMFizzServer', () => {
4612
expect(getVisibleChildren(container)).toEqual(<title>hello</title>);
4613
});
4614
4668
- // @gate experimental
4615
it('should warn in dev when given an array of length 2 or more', async () => {
4616
const originalConsoleError = console.error;
4617
const mockError = jest.fn();
@@ -4728,7 +4674,6 @@ describe('ReactDOMFizzServer', () => {
4674
}
4675
});
4676
4731
- // @gate experimental
4677
it('should warn in dev if you pass a React Component as a child to <title>', async () => {
4678
const originalConsoleError = console.error;
4679
const mockError = jest.fn();
packages/react-dom/src/__tests__/ReactDOMFizzServerBrowser-test.js
+1
-15
@@ -21,9 +21,7 @@ describe('ReactDOMFizzServer', () => {
21
beforeEach(() => {
22
jest.resetModules();
23
React = require('react');
24
- if (__EXPERIMENTAL__) {
25
- ReactDOMFizzServer = require('react-dom/server.browser');
26
- }
24
+ ReactDOMFizzServer = require('react-dom/server.browser');
25
Suspense = React.Suspense;
26
});
27
@@ -48,7 +46,6 @@ describe('ReactDOMFizzServer', () => {
46
}
47
}
48
51
- // @gate experimental
49
it('should call renderToReadableStream', async () => {
50
const stream = await ReactDOMFizzServer.renderToReadableStream(
51
<div>hello world</div>,
@@ -57,7 +54,6 @@ describe('ReactDOMFizzServer', () => {
54
expect(result).toMatchInlineSnapshot(`"<div>hello world</div>"`);
55
});
56
60
- // @gate experimental
57
it('should emit DOCTYPE at the root of the document', async () => {
58
const stream = await ReactDOMFizzServer.renderToReadableStream(
59
<html>
@@ -70,7 +66,6 @@ describe('ReactDOMFizzServer', () => {
66
);
67
});
68
73
- // @gate experimental
69
it('should emit bootstrap script src at the end', async () => {
70
const stream = await ReactDOMFizzServer.renderToReadableStream(
71
<div>hello world</div>,
@@ -86,7 +81,6 @@ describe('ReactDOMFizzServer', () => {
81
);
82
});
83
89
- // @gate experimental
84
it('emits all HTML as one unit if we wait until the end to start', async () => {
85
let hasLoaded = false;
86
let resolve;
@@ -124,7 +118,6 @@ describe('ReactDOMFizzServer', () => {
118
);
119
});
120
127
- // @gate experimental
121
it('should reject the promise when an error is thrown at the root', async () => {
122
const reportedErrors = [];
123
let caughtError = null;
@@ -146,7 +139,6 @@ describe('ReactDOMFizzServer', () => {
139
expect(reportedErrors).toEqual([theError]);
140
});
141
149
- // @gate experimental
142
it('should reject the promise when an error is thrown inside a fallback', async () => {
143
const reportedErrors = [];
144
let caughtError = null;
@@ -170,7 +162,6 @@ describe('ReactDOMFizzServer', () => {
162
expect(reportedErrors).toEqual([theError]);
163
});
164
173
- // @gate experimental
165
it('should not error the stream when an error is thrown inside suspense boundary', async () => {
166
const reportedErrors = [];
167
const stream = await ReactDOMFizzServer.renderToReadableStream(
@@ -191,7 +182,6 @@ describe('ReactDOMFizzServer', () => {
182
expect(reportedErrors).toEqual([theError]);
183
});
184
194
- // @gate experimental
185
it('should be able to complete by aborting even if the promise never resolves', async () => {
186
const errors = [];
187
const controller = new AbortController();
@@ -219,7 +209,6 @@ describe('ReactDOMFizzServer', () => {
209
]);
210
});
211
222
- // @gate experimental
212
it('should not continue rendering after the reader cancels', async () => {
213
let hasLoaded = false;
214
let resolve;
@@ -268,7 +257,6 @@ describe('ReactDOMFizzServer', () => {
257
expect(isComplete).toBe(true);
258
});
259
271
- // @gate experimental
260
it('should stream large contents that might overlow individual buffers', async () => {
261
const str492 = `(492) This string is intentionally 492 bytes long because we want to make sure we process chunks that will overflow buffer boundaries. It will repeat to fill out the bytes required (inclusive of this prompt):: foo bar qux quux corge grault garply waldo fred plugh xyzzy thud foo bar qux quux corge grault garply waldo fred plugh xyzzy thud foo bar qux quux corge grault garply waldo fred plugh xyzzy thud foo bar qux quux corge grault garply waldo fred plugh xyzzy thud foo bar qux q :: total count (492)`;
262
const str2049 = `(2049) This string is intentionally 2049 bytes long because we want to make sure we process chunks that will overflow buffer boundaries. It will repeat to fill out the bytes required (inclusive of this prompt):: foo bar qux quux corge grault garply waldo fred plugh xyzzy thud foo bar qux quux corge grault garply waldo fred plugh xyzzy thud foo bar qux quux corge grault garply waldo fred plugh xyzzy thud foo bar qux quux corge grault garply waldo fred plugh xyzzy thud foo bar qux quux corge grault garply waldo fred plugh xyzzy thud foo bar qux quux corge grault garply waldo fred plugh xyzzy thud foo bar qux quux corge grault garply waldo fred plugh xyzzy thud foo bar qux quux corge grault garply waldo fred plugh xyzzy thud foo bar qux quux corge grault garply waldo fred plugh xyzzy thud foo bar qux quux corge grault garply waldo fred plugh xyzzy thud foo bar qux quux corge grault garply waldo fred plugh xyzzy thud foo bar qux quux corge grault garply waldo fred plugh xyzzy thud foo bar qux quux corge grault garply waldo fred plugh xyzzy thud foo bar qux quux corge grault garply waldo fred plugh xyzzy thud foo bar qux quux corge grault garply waldo fred plugh xyzzy thud foo bar qux quux corge grault garply waldo fred plugh xyzzy thud foo bar qux quux corge grault garply waldo fred plugh xyzzy thud foo bar qux quux corge grault garply waldo fred plugh xyzzy thud foo bar qux quux corge grault garply waldo fred plugh xyzzy thud foo bar qux quux corge grault garply waldo fred plugh xyzzy thud foo bar qux quux corge grault garply waldo fred plugh xyzzy thud foo bar qux quux corge grault garply waldo fred plugh xyzzy thud foo bar qux quux corge grault garply waldo fred plugh xyzzy thud foo bar qux quux corge grault garply waldo fred plugh xyzzy thud foo bar qux quux corge grault garply waldo fred plugh xyzzy thud foo bar qux quux corge grault garply waldo fred plugh xyzzy thud foo bar qux quux corge grault garply waldo fred plugh xyzzy thud foo bar qux quux corge grault garply waldo fred plugh xyzzy :: total count (2049)`;
@@ -308,7 +296,6 @@ describe('ReactDOMFizzServer', () => {
296
expect(result).toMatchInlineSnapshot(`"<div>${str2049}</div>"`);
297
});
298
311
- // @gate experimental
299
it('Supports custom abort reasons with a string', async () => {
300
const promise = new Promise(r => {});
301
function Wait() {
@@ -350,7 +337,6 @@ describe('ReactDOMFizzServer', () => {
337
expect(errors).toEqual(['foobar', 'foobar']);
338
});
339
353
- // @gate experimental
340
it('Supports custom abort reasons with an Error', async () => {
341
const promise = new Promise(r => {});
342
function Wait() {
packages/react-dom/src/__tests__/ReactDOMFizzServerNode-test.js
+1
-18
@@ -19,9 +19,7 @@ describe('ReactDOMFizzServer', () => {
19
beforeEach(() => {
20
jest.resetModules();
21
React = require('react');
22
- if (__EXPERIMENTAL__) {
23
- ReactDOMFizzServer = require('react-dom/server');
24
- }
22
+ ReactDOMFizzServer = require('react-dom/server');
23
Stream = require('stream');
24
Suspense = React.Suspense;
25
});
@@ -56,7 +54,6 @@ describe('ReactDOMFizzServer', () => {
54
throw theInfinitePromise;
55
}
56
59
- // @gate experimental
57
it('should call renderToPipeableStream', () => {
58
const {writable, output} = getTestWritable();
59
const {pipe} = ReactDOMFizzServer.renderToPipeableStream(
@@ -67,7 +64,6 @@ describe('ReactDOMFizzServer', () => {
64
expect(output.result).toMatchInlineSnapshot(`"<div>hello world</div>"`);
65
});
66
70
- // @gate experimental
67
it('should emit DOCTYPE at the root of the document', () => {
68
const {writable, output} = getTestWritable();
69
const {pipe} = ReactDOMFizzServer.renderToPipeableStream(
@@ -82,7 +78,6 @@ describe('ReactDOMFizzServer', () => {
78
);
79
});
80
85
- // @gate experimental
81
it('should emit bootstrap script src at the end', () => {
82
const {writable, output} = getTestWritable();
83
const {pipe} = ReactDOMFizzServer.renderToPipeableStream(
@@ -100,7 +95,6 @@ describe('ReactDOMFizzServer', () => {
95
);
96
});
97
103
- // @gate experimental
98
it('should start writing after pipe', () => {
99
const {writable, output} = getTestWritable();
100
const {pipe} = ReactDOMFizzServer.renderToPipeableStream(
@@ -117,7 +111,6 @@ describe('ReactDOMFizzServer', () => {
111
);
112
});
113
120
- // @gate experimental
114
it('emits all HTML as one unit if we wait until the end to start', async () => {
115
let hasLoaded = false;
116
let resolve;
@@ -165,7 +158,6 @@ describe('ReactDOMFizzServer', () => {
158
);
159
});
160
168
- // @gate experimental
161
it('should error the stream when an error is thrown at the root', async () => {
162
const reportedErrors = [];
163
const reportedShellErrors = [];
@@ -197,7 +189,6 @@ describe('ReactDOMFizzServer', () => {
189
expect(reportedShellErrors).toEqual([theError]);
190
});
191
200
- // @gate experimental
192
it('should error the stream when an error is thrown inside a fallback', async () => {
193
const reportedErrors = [];
194
const reportedShellErrors = [];
@@ -231,7 +222,6 @@ describe('ReactDOMFizzServer', () => {
222
expect(reportedShellErrors).toEqual([theError]);
223
});
224
234
- // @gate experimental
225
it('should not error the stream when an error is thrown inside suspense boundary', async () => {
226
const reportedErrors = [];
227
const reportedShellErrors = [];
@@ -263,7 +253,6 @@ describe('ReactDOMFizzServer', () => {
253
expect(reportedShellErrors).toEqual([]);
254
});
255
266
- // @gate experimental
256
it('should not attempt to render the fallback if the main content completes first', async () => {
257
const {writable, output, completed} = getTestWritable();
258
@@ -289,7 +278,6 @@ describe('ReactDOMFizzServer', () => {
278
expect(renderedFallback).toBe(false);
279
});
280
292
- // @gate experimental
281
it('should be able to complete by aborting even if the promise never resolves', async () => {
282
let isCompleteCalls = 0;
283
const errors = [];
@@ -327,7 +315,6 @@ describe('ReactDOMFizzServer', () => {
315
expect(isCompleteCalls).toBe(1);
316
});
317
330
- // @gate experimental
318
it('should be able to complete by abort when the fallback is also suspended', async () => {
319
let isCompleteCalls = 0;
320
const errors = [];
@@ -371,7 +358,6 @@ describe('ReactDOMFizzServer', () => {
358
expect(isCompleteCalls).toBe(1);
359
});
360
374
- // @gate experimental
361
it('should be able to get context value when promise resolves', async () => {
362
class DelayClient {
363
get() {
@@ -422,7 +408,6 @@ describe('ReactDOMFizzServer', () => {
408
expect(output.result).toContain('OK');
409
});
410
425
- // @gate experimental
411
it('should be able to get context value when calls renderToPipeableStream twice at the same time', async () => {
412
class DelayClient {
413
get() {
@@ -497,7 +482,6 @@ describe('ReactDOMFizzServer', () => {
482
expect(output1.result).toContain('OK');
483
});
484
500
- // @gate experimental
485
it('should be able to pop context after suspending', async () => {
486
class DelayClient {
487
get() {
@@ -555,7 +539,6 @@ describe('ReactDOMFizzServer', () => {
539
expect(output.result).toContain('OK');
540
});
541
558
- // @gate experimental
542
it('should not continue rendering after the writable ends unexpectedly', async () => {
543
let hasLoaded = false;
544
let resolve;
packages/react-dom/src/__tests__/ReactDOMFizzSuppressHydrationWarning-test.js
+2
-15
@@ -29,9 +29,7 @@ describe('ReactDOMFizzServerHydrationWarning', () => {
29
Scheduler = require('scheduler');
30
React = require('react');
31
ReactDOMClient = require('react-dom/client');
32
- if (__EXPERIMENTAL__) {
33
- ReactDOMFizzServer = require('react-dom/server');
34
- }
32
+ ReactDOMFizzServer = require('react-dom/server');
33
Stream = require('stream');
34
35
// Test Environment
@@ -127,7 +125,6 @@ describe('ReactDOMFizzServerHydrationWarning', () => {
125
: children;
126
}
127
130
- // @gate experimental
128
it('suppresses and fixes text mismatches with suppressHydrationWarning', async () => {
129
function App({isClient}) {
130
return (
@@ -167,7 +164,6 @@ describe('ReactDOMFizzServerHydrationWarning', () => {
164
);
165
});
166
170
- // @gate experimental
167
it('suppresses and fixes multiple text node mismatches with suppressHydrationWarning', async () => {
168
function App({isClient}) {
169
return (
@@ -209,7 +205,6 @@ describe('ReactDOMFizzServerHydrationWarning', () => {
205
);
206
});
207
212
- // @gate experimental
208
it('errors on text-to-element mismatches with suppressHydrationWarning', async () => {
209
function App({isClient}) {
210
return (
@@ -261,7 +256,6 @@ describe('ReactDOMFizzServerHydrationWarning', () => {
256
);
257
});
258
264
- // @gate experimental
259
it('suppresses and fixes client-only single text node mismatches with suppressHydrationWarning', async () => {
260
function App({isClient}) {
261
return (
@@ -297,7 +291,7 @@ describe('ReactDOMFizzServerHydrationWarning', () => {
291
});
292
293
// TODO: This behavior is not consistent with client-only single text node.
300
- // @gate experimental
294
+
295
it('errors on server-only single text node mismatches with suppressHydrationWarning', async () => {
296
function App({isClient}) {
297
return (
@@ -343,7 +337,6 @@ describe('ReactDOMFizzServerHydrationWarning', () => {
337
);
338
});
339
346
- // @gate experimental
340
it('errors on client-only extra text node mismatches with suppressHydrationWarning', async () => {
341
function App({isClient}) {
342
return (
@@ -395,7 +388,6 @@ describe('ReactDOMFizzServerHydrationWarning', () => {
388
);
389
});
390
398
- // @gate experimental
391
it('errors on server-only extra text node mismatches with suppressHydrationWarning', async () => {
392
function App({isClient}) {
393
return (
@@ -446,7 +438,6 @@ describe('ReactDOMFizzServerHydrationWarning', () => {
438
);
439
});
440
449
- // @gate experimental
441
it('errors on element-to-text mismatches with suppressHydrationWarning', async () => {
442
function App({isClient}) {
443
return (
@@ -499,7 +490,6 @@ describe('ReactDOMFizzServerHydrationWarning', () => {
490
);
491
});
492
502
- // @gate experimental
493
it('suppresses and does not fix attribute mismatches with suppressHydrationWarning', async () => {
494
function App({isClient}) {
495
return (
@@ -538,7 +528,6 @@ describe('ReactDOMFizzServerHydrationWarning', () => {
528
);
529
});
530
541
- // @gate experimental
531
it('suppresses and does not fix html mismatches with suppressHydrationWarning', async () => {
532
function App({isClient}) {
533
return (
@@ -576,7 +565,6 @@ describe('ReactDOMFizzServerHydrationWarning', () => {
565
);
566
});
567
579
- // @gate experimental
568
it('errors on insertions with suppressHydrationWarning', async () => {
569
function App({isClient}) {
570
return (
@@ -622,7 +610,6 @@ describe('ReactDOMFizzServerHydrationWarning', () => {
610
);
611
});
612
625
- // @gate experimental
613
it('errors on deletions with suppressHydrationWarning', async () => {
614
function App({isClient}) {
615
return (