File tree 3 files changed +23
-3
lines changed 3 files changed +23
-3
lines changed Original file line number Diff line number Diff line change 7
7
* @flow strict
8
8
*/
9
9
10
- import invariant from 'shared/invariant' ;
11
-
12
10
// Exports ReactDOM.createRoot
13
11
export const enableUserTimingAPI = __DEV__ ;
14
12
@@ -47,5 +45,5 @@ export const enableSuspenseServerRenderer = false;
47
45
48
46
// Only used in www builds.
49
47
export function addUserTimingListener ( ) {
50
- invariant ( false , 'Not implemented.' ) ;
48
+ throw new Error ( 'Not implemented.' ) ;
51
49
}
Original file line number Diff line number Diff line change
1
+ /**
2
+ * Copyright (c) Facebook, Inc. and its 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
+
8
+ // This is only used by bundle tests so they can *read* the default feature flags.
9
+ // It lets us determine whether we're running in Fire mode without making tests internal.
10
+ const ReactFeatureFlags = require ( '../ReactFeatureFlags' ) ;
11
+ // Forbid writes because this wouldn't work with bundle tests.
12
+ module . exports = Object . freeze ( { ...ReactFeatureFlags } ) ;
Original file line number Diff line number Diff line change @@ -18,8 +18,18 @@ const packages = readdirSync(packagesRoot).filter(dir => {
18
18
const packagePath = join ( packagesRoot , dir , 'package.json' ) ;
19
19
return statSync ( packagePath ) . isFile ( ) ;
20
20
} ) ;
21
+
21
22
// Create a module map to point React packages to the build output
22
23
const moduleNameMapper = { } ;
24
+
25
+ // Allow bundle tests to read (but not write!) default feature flags.
26
+ // This lets us determine whether we're running in Fire mode
27
+ // without making relevant tests internal-only.
28
+ moduleNameMapper [
29
+ '^shared/ReactFeatureFlags'
30
+ ] = `<rootDir>/packages/shared/forks/ReactFeatureFlags.readonly` ;
31
+
32
+ // Map packages to bundles
23
33
packages . forEach ( name => {
24
34
// Root entry point
25
35
moduleNameMapper [ `^${ name } $` ] = `<rootDir>/build/node_modules/${ name } ` ;
You can’t perform that action at this time.
0 commit comments