-
Notifications
You must be signed in to change notification settings - Fork 47.5k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Expose persistent reconciler to custom renderers (#12156)
- Loading branch information
Showing
7 changed files
with
90 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
'use strict'; | ||
|
||
if (process.env.NODE_ENV === 'production') { | ||
module.exports = require('./cjs/react-reconciler-persistent.production.min.js'); | ||
} else { | ||
module.exports = require('./cjs/react-reconciler-persistent.development.js'); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -12,6 +12,7 @@ | |
"LICENSE", | ||
"README.md", | ||
"index.js", | ||
"persistent.js", | ||
"reflection.js", | ||
"cjs/" | ||
], | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
/** | ||
* Copyright (c) 2013-present, Facebook, Inc. | ||
* | ||
* This source code is licensed under the MIT license found in the | ||
* LICENSE file in the root directory of this source tree. | ||
* | ||
* @flow | ||
*/ | ||
|
||
'use strict'; | ||
|
||
// This is the same export as in index.js, | ||
// with persistent reconciler flags turned on. | ||
const ReactFiberReconciler = require('./src/ReactFiberReconciler'); | ||
|
||
// TODO: decide on the top-level export form. | ||
// This is hacky but makes it work with both Rollup and Jest. | ||
module.exports = ReactFiberReconciler.default | ||
? ReactFiberReconciler.default | ||
: ReactFiberReconciler; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
/** | ||
* Copyright (c) 2013-present, Facebook, Inc. | ||
* | ||
* This source code is licensed under the MIT license found in the | ||
* LICENSE file in the root directory of this source tree. | ||
* | ||
* @flow | ||
*/ | ||
|
||
import invariant from 'fbjs/lib/invariant'; | ||
|
||
import typeof * as FeatureFlagsType from 'shared/ReactFeatureFlags'; | ||
import typeof * as PersistentFeatureFlagsType from './ReactFeatureFlags.persistent'; | ||
|
||
export const debugRenderPhaseSideEffects = false; | ||
export const debugRenderPhaseSideEffectsForStrictMode = false; | ||
export const enableCreateRoot = false; | ||
export const enableUserTimingAPI = __DEV__; | ||
export const warnAboutDeprecatedLifecycles = false; | ||
|
||
// react-reconciler/persistent entry point | ||
// uses a persistent reconciler. | ||
export const enableMutatingReconciler = false; | ||
export const enableNoopReconciler = false; | ||
export const enablePersistentReconciler = true; | ||
|
||
// Only used in www builds. | ||
export function addUserTimingListener() { | ||
invariant(false, 'Not implemented.'); | ||
} | ||
|
||
// Flow magic to verify the exports of this file match the original version. | ||
// eslint-disable-next-line no-unused-vars | ||
type Check<_X, Y: _X, X: Y = _X> = null; | ||
// eslint-disable-next-line no-unused-expressions | ||
(null: Check<PersistentFeatureFlagsType, FeatureFlagsType>); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters