Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Set enableFastJSX flag to true #30343

Merged
merged 1 commit into from
Jul 22, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion packages/react/src/__tests__/ReactJSXRuntime-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -377,7 +377,7 @@ describe('ReactJSXRuntime', () => {
expect(didCall).toBe(false);
});

// @gate enableFastJSX && enableRefAsProp
// @gate enableRefAsProp
it('does not clone props object if key and ref is not spread', async () => {
const config = {
foo: 'foo',
Expand Down
9 changes: 3 additions & 6 deletions packages/react/src/jsx/ReactJSXElement.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@ import {
enableRefAsProp,
disableStringRefs,
disableDefaultPropsExceptForClasses,
enableFastJSX,
enableOwnerStacks,
} from 'shared/ReactFeatureFlags';
import {checkPropStringCoercion} from 'shared/CheckStringCoercion';
Expand Down Expand Up @@ -82,9 +81,7 @@ if (__DEV__) {
didWarnAboutElementRef = {};
}

const enableFastJSXWithStringRefs = enableFastJSX && enableRefAsProp;
const enableFastJSXWithoutStringRefs =
enableFastJSXWithStringRefs && disableStringRefs;
const enableFastJSXWithoutStringRefs = enableRefAsProp && disableStringRefs;

function hasValidRef(config) {
if (__DEV__) {
Expand Down Expand Up @@ -416,7 +413,7 @@ export function jsxProd(type, config, maybeKey) {
let props;
if (
(enableFastJSXWithoutStringRefs ||
(enableFastJSXWithStringRefs && !('ref' in config))) &&
(enableRefAsProp && !('ref' in config))) &&
!('key' in config)
) {
// If key was not spread in, we can reuse the original props object. This
Expand Down Expand Up @@ -701,7 +698,7 @@ function jsxDEVImpl(
let props;
if (
(enableFastJSXWithoutStringRefs ||
(enableFastJSXWithStringRefs && !('ref' in config))) &&
(enableRefAsProp && !('ref' in config))) &&
!('key' in config)
) {
// If key was not spread in, we can reuse the original props object. This
Expand Down
1 change: 0 additions & 1 deletion packages/shared/ReactFeatureFlags.js
Original file line number Diff line number Diff line change
Expand Up @@ -195,7 +195,6 @@ export const enableInfiniteRenderLoopDetection = true;
// during element creation.
export const enableRefAsProp = true;
export const disableStringRefs = true;
export const enableFastJSX = true;

// Warn on any usage of ReactTestRenderer
export const enableReactTestRendererWarning = true;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@

export const alwaysThrottleRetries = __VARIANT__;
export const enableAddPropertiesFastPath = __VARIANT__;
export const enableFastJSX = __VARIANT__;
export const enableObjectFiber = __VARIANT__;
export const enableShallowPropDiffing = __VARIANT__;
export const passChildrenWhenCloningPersistedNodes = __VARIANT__;
1 change: 0 additions & 1 deletion packages/shared/forks/ReactFeatureFlags.native-fb.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@ const dynamicFlags: DynamicExportsType = (dynamicFlagsUntyped: any);
export const {
alwaysThrottleRetries,
enableAddPropertiesFastPath,
enableFastJSX,
enableObjectFiber,
enableShallowPropDiffing,
passChildrenWhenCloningPersistedNodes,
Expand Down
1 change: 0 additions & 1 deletion packages/shared/forks/ReactFeatureFlags.native-oss.js
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,6 @@ export const enableCreateEventHandleAPI = false;
export const enableDebugTracing = false;
export const enableDeferRootSchedulingToMicrotask = true;
export const enableDO_NOT_USE_disableStrictPassiveEffect = false;
export const enableFastJSX = true;
export const enableFilterEmptyStringAttributesDOM = true;
export const enableFizzExternalRuntime = true;
export const enableFlightReadableStream = true;
Expand Down
1 change: 0 additions & 1 deletion packages/shared/forks/ReactFeatureFlags.test-renderer.js
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,6 @@ export const enableShallowPropDiffing = false;
// const __NEXT_MAJOR__ = __EXPERIMENTAL__;
export const enableRefAsProp = true;
export const disableStringRefs = true;
export const enableFastJSX = true;
export const disableLegacyMode = true;
export const disableLegacyContext = true;
export const disableLegacyContextForFunctionComponents = true;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,6 @@ export const enableCreateEventHandleAPI = false;
export const enableDebugTracing = false;
export const enableDeferRootSchedulingToMicrotask = true;
export const enableDO_NOT_USE_disableStrictPassiveEffect = false;
export const enableFastJSX = true;
export const enableFilterEmptyStringAttributesDOM = true;
export const enableFizzExternalRuntime = true;
export const enableFlightReadableStream = true;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,6 @@ export const enableInfiniteRenderLoopDetection = false;

export const enableRefAsProp = true;
export const disableStringRefs = false;
export const enableFastJSX = false;

export const enableReactTestRendererWarning = false;
export const disableLegacyMode = true;
Expand Down
1 change: 0 additions & 1 deletion packages/shared/forks/ReactFeatureFlags.www-dynamic.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@ export const disableSchedulerTimeoutInWorkLoop = __VARIANT__;
export const enableAddPropertiesFastPath = __VARIANT__;
export const enableDeferRootSchedulingToMicrotask = __VARIANT__;
export const enableDO_NOT_USE_disableStrictPassiveEffect = __VARIANT__;
export const enableFastJSX = __VARIANT__;
export const enableLazyContextPropagation = __VARIANT__;
export const enableNoCloningMemoCache = __VARIANT__;
export const enableObjectFiber = __VARIANT__;
Expand Down
1 change: 0 additions & 1 deletion packages/shared/forks/ReactFeatureFlags.www.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@ export const {
enableDebugTracing,
enableDeferRootSchedulingToMicrotask,
enableDO_NOT_USE_disableStrictPassiveEffect,
enableFastJSX,
enableInfiniteRenderLoopDetection,
enableLazyContextPropagation,
enableNoCloningMemoCache,
Expand Down