Skip to content

Commit

Permalink
Ship diffInCommitPhase (#27409)
Browse files Browse the repository at this point in the history
Performance tests at Meta showed neutral results.
  • Loading branch information
sophiebits authored Sep 23, 2023
1 parent d9e00f7 commit 7f62018
Show file tree
Hide file tree
Showing 21 changed files with 53 additions and 686 deletions.
6 changes: 0 additions & 6 deletions packages/react-art/src/ReactFiberConfigART.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,8 @@ import {DefaultEventPriority} from 'react-reconciler/src/ReactEventPriorities';
const pooledTransform = new Transform();

const NO_CONTEXT = {};
const UPDATE_SIGNAL = {};
if (__DEV__) {
Object.freeze(NO_CONTEXT);
Object.freeze(UPDATE_SIGNAL);
}

/** Helper Methods */
Expand Down Expand Up @@ -312,10 +310,6 @@ export function prepareForCommit() {
return null;
}

export function prepareUpdate(domElement, type, oldProps, newProps) {
return UPDATE_SIGNAL;
}

export function resetAfterCommit() {
// Noop
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ import hyphenateStyleName from '../shared/hyphenateStyleName';
import warnValidStyle from '../shared/warnValidStyle';
import isUnitlessNumber from '../shared/isUnitlessNumber';
import {checkCSSPropertyStringCoercion} from 'shared/CheckStringCoercion';
import {diffInCommitPhase} from 'shared/ReactFeatureFlags';

/**
* Operations for dealing with CSS properties.
Expand Down Expand Up @@ -126,7 +125,7 @@ export function setValueForStyles(node, styles, prevStyles) {

const style = node.style;

if (diffInCommitPhase && prevStyles != null) {
if (prevStyles != null) {
if (__DEV__) {
validateShorthandPropertyCollisionInDev(prevStyles, styles);
}
Expand Down Expand Up @@ -200,10 +199,7 @@ function expandShorthandMap(styles) {
* {font: 'foo', fontVariant: 'bar'} -> {font: 'foo'}
* becomes .style.fontVariant = ''
*/
export function validateShorthandPropertyCollisionInDev(
prevStyles,
nextStyles,
) {
function validateShorthandPropertyCollisionInDev(prevStyles, nextStyles) {
if (__DEV__) {
if (!nextStyles) {
return;
Expand Down
Loading

0 comments on commit 7f62018

Please sign in to comment.