@samitouri / QOS-React-1 / commits / 5dcf3ca8d4

Add FB RSC Entry for React Package (#30310)

I noticed that the www-modern builds pick up the `.experimental.js` entry points but these flags that are associated with these exports are not enabled in www, so it gets the wrong builds. This file is just a clone over the stable `ReactServer.js` one. We should probably do the reexport pattern instead.

Sebastian Markbåge committed Jul 11, 2024 at 18:44 UTC 5dcf3ca8d45a276a8b4cee0cedd234967661ca35
1 file changed +60
packages/react/src/ReactServer.fb.js new
+60
@@ -0,0 +1,60 @@
1 +/**
2 + * Copyright (c) Meta Platforms, Inc. and affiliates.
3 + *
4 + * This source code is licensed under the MIT license found in the
5 + * LICENSE file in the root directory of this source tree.
6 + *
7 + * @flow
8 + */
9 +
10 +export {default as __SERVER_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE} from './ReactSharedInternalsServer';
11 +
12 +import {forEach, map, count, toArray, only} from './ReactChildren';
13 +import {
14 + REACT_FRAGMENT_TYPE,
15 + REACT_PROFILER_TYPE,
16 + REACT_STRICT_MODE_TYPE,
17 + REACT_SUSPENSE_TYPE,
18 +} from 'shared/ReactSymbols';
19 +import {
20 + cloneElement,
21 + createElement,
22 + isValidElement,
23 +} from './jsx/ReactJSXElement';
24 +import {createRef} from './ReactCreateRef';
25 +import {use, useId, useCallback, useDebugValue, useMemo} from './ReactHooks';
26 +import {forwardRef} from './ReactForwardRef';
27 +import {lazy} from './ReactLazy';
28 +import {memo} from './ReactMemo';
29 +import {cache} from './ReactCacheServer';
30 +import version from 'shared/ReactVersion';
31 +
32 +const Children = {
33 + map,
34 + forEach,
35 + count,
36 + toArray,
37 + only,
38 +};
39 +
40 +export {
41 + Children,
42 + REACT_FRAGMENT_TYPE as Fragment,
43 + REACT_PROFILER_TYPE as Profiler,
44 + REACT_STRICT_MODE_TYPE as StrictMode,
45 + REACT_SUSPENSE_TYPE as Suspense,
46 + cloneElement,
47 + createElement,
48 + createRef,
49 + use,
50 + forwardRef,
51 + isValidElement,
52 + lazy,
53 + memo,
54 + cache,
55 + useId,
56 + useCallback,
57 + useDebugValue,
58 + useMemo,
59 + version,
60 +};