mirror of
https://github.com/facebook/react.git
synced 2026-02-26 18:58:05 +00:00
* Add command to run tests in persistent mode * Convert Suspense fuzz tester to use noop renderer So we can run it in persistent mode, too. * Don't mutate stateNode in appendAllChildren We can't mutate the stateNode in appendAllChildren because the children could be current. This is a bit weird because now the child that we append is different from the one on the fiber stateNode. I think this makes conceptual sense, but I suspect this likely breaks an assumption in Fabric. With this approach, we no longer need to clone to unhide the children, so I removed those host config methods. Fixes bug surfaced by fuzz tester. (The test case that failed was the one that's already hard coded.) * In persistent mode, disable test that reads a ref Refs behave differently in persistent mode. I added a TODO to write a persistent mode version of this test. * Run persistent mode tests in CI * test-persistent should skip files without noop If a file doesn't reference react-noop-renderer, we shouldn't bother running it in persistent mode, since the results will be identical to the normal test run. * Remove module constructor from placeholder tests We don't need this now that we have the ability to run any test file in either mutation or persistent mode. * Revert "test-persistent should skip files without noop" Seb objected to adding shelljs as a dep and I'm too lazy to worry about Windows support so whatever I'll just revert this. * Delete duplicate file
33 lines
934 B
JavaScript
33 lines
934 B
JavaScript
/**
|
|
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
*
|
|
* 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 'shared/invariant';
|
|
|
|
// Renderers that don't support persistence
|
|
// can re-export everything from this module.
|
|
|
|
function shim(...args: any) {
|
|
invariant(
|
|
false,
|
|
'The current renderer does not support persistence. ' +
|
|
'This error is likely caused by a bug in React. ' +
|
|
'Please file an issue.',
|
|
);
|
|
}
|
|
|
|
// Persistence (when unsupported)
|
|
export const supportsPersistence = false;
|
|
export const cloneInstance = shim;
|
|
export const createContainerChildSet = shim;
|
|
export const appendChildToContainerChildSet = shim;
|
|
export const finalizeContainerChildren = shim;
|
|
export const replaceContainerChildren = shim;
|
|
export const cloneHiddenInstance = shim;
|
|
export const cloneHiddenTextInstance = shim;
|