mirror of
https://github.com/facebook/react.git
synced 2025-11-01 09:12:30 +00:00
Object literals should be faster at least on React Native with Hermes as the JS engine. It might also be interesting to confirm the old comments in this file from years ago are even still valid. Creating an object from a literal should be a simpler operation. It's a bit unfortunate that this introduces a bunch of copied code, but since we rearely update the fields on fibers, this seems like an okay tradeoff for a hot code path. An alternative would be some sort of macro system, but that doesn't seem worth the extra complexity.
28 lines
1.1 KiB
JavaScript
28 lines
1.1 KiB
JavaScript
/**
|
|
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
*
|
|
* This source code is licensed under the MIT license found in the
|
|
* LICENSE file in the root directory of this source tree.
|
|
*
|
|
* @flow strict
|
|
*/
|
|
|
|
// In xplat, these flags are controlled by GKs. Because most GKs have some
|
|
// population running in either mode, we should run our tests that way, too,
|
|
//
|
|
// Use __VARIANT__ to simulate a GK. The tests will be run twice: once
|
|
// with the __VARIANT__ set to `true`, and once set to `false`.
|
|
//
|
|
// TODO: __VARIANT__ isn't supported for React Native flags yet. You can set the
|
|
// flag here but it won't be set to `true` in any of our test runs. Need to
|
|
// add a test configuration for React Native.
|
|
|
|
export const alwaysThrottleRetries = __VARIANT__;
|
|
export const consoleManagedByDevToolsDuringStrictMode = __VARIANT__;
|
|
export const disableDefaultPropsExceptForClasses = __VARIANT__;
|
|
export const enableAddPropertiesFastPath = __VARIANT__;
|
|
export const enableFastJSX = __VARIANT__;
|
|
export const enableObjectFiber = __VARIANT__;
|
|
export const enableShallowPropDiffing = __VARIANT__;
|
|
export const passChildrenWhenCloningPersistedNodes = __VARIANT__;
|