Skip to content

Commit

Permalink
Delete unused DOM files (#26387)
Browse files Browse the repository at this point in the history
These used to be used by partial render.

ReactDOMDispatcher ended up not being used in this way.

Move shared DOM files to client. These are only used by client
abstractions now. They're inlined in the Fizz code so they're no longer
shared.
  • Loading branch information
sebmarkbage authored Mar 14, 2023
1 parent 56a3c18 commit 21aee59
Show file tree
Hide file tree
Showing 28 changed files with 25 additions and 145 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@

import {shorthandToLonghand} from './CSSShorthandProperty';

import dangerousStyleValue from '../shared/dangerousStyleValue';
import dangerousStyleValue from './dangerousStyleValue';
import hyphenateStyleName from '../shared/hyphenateStyleName';
import warnValidStyle from '../shared/warnValidStyle';

Expand Down
6 changes: 3 additions & 3 deletions packages/react-dom-bindings/src/client/ReactDOMComponent.js
Original file line number Diff line number Diff line change
Expand Up @@ -55,14 +55,14 @@ import {
setValueForStyles,
validateShorthandPropertyCollisionInDev,
} from './CSSPropertyOperations';
import {HTML_NAMESPACE, getIntrinsicNamespace} from '../shared/DOMNamespaces';
import {HTML_NAMESPACE, getIntrinsicNamespace} from './DOMNamespaces';
import {
getPropertyInfo,
shouldIgnoreAttribute,
shouldRemoveAttribute,
} from '../shared/DOMProperty';
import assertValidProps from '../shared/assertValidProps';
import {DOCUMENT_NODE} from '../shared/HTMLNodeType';
import assertValidProps from './assertValidProps';
import {DOCUMENT_NODE} from './HTMLNodeType';
import isCustomComponent from '../shared/isCustomComponent';
import possibleStandardNames from '../shared/possibleStandardNames';
import {validateProperties as validateARIAProperties} from '../shared/ReactDOMInvalidARIAHook';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ import type {ReactScopeInstance} from 'shared/ReactTypes';
import type {
ReactDOMEventHandle,
ReactDOMEventHandleListener,
} from '../shared/ReactDOMTypes';
} from './ReactDOMEventHandleTypes';
import type {
Container,
TextInstance,
Expand Down
4 changes: 2 additions & 2 deletions packages/react-dom-bindings/src/client/ReactDOMEventHandle.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ import type {ReactScopeInstance} from 'shared/ReactTypes';
import type {
ReactDOMEventHandle,
ReactDOMEventHandleListener,
} from '../shared/ReactDOMTypes';
} from './ReactDOMEventHandleTypes';

import {allNativeEvents} from '../events/EventRegistry';
import {
Expand All @@ -21,7 +21,7 @@ import {
doesTargetHaveEventHandle,
addEventHandleToTarget,
} from './ReactDOMComponentTree';
import {ELEMENT_NODE} from '../shared/HTMLNodeType';
import {ELEMENT_NODE} from './HTMLNodeType';
import {listenToNativeEventForNonManagedEventTarget} from '../events/DOMPluginEventSystem';

import {
Expand Down
4 changes: 2 additions & 2 deletions packages/react-dom-bindings/src/client/ReactDOMFloatClient.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@ import ReactDOMSharedInternals from 'shared/ReactDOMSharedInternals.js';
const {Dispatcher} = ReactDOMSharedInternals;
import {checkAttributeStringCoercion} from 'shared/CheckStringCoercion';

import {DOCUMENT_NODE} from '../shared/HTMLNodeType';
import {SVG_NAMESPACE} from '../shared/DOMNamespaces';
import {DOCUMENT_NODE} from './HTMLNodeType';
import {SVG_NAMESPACE} from './DOMNamespaces';
import {
validatePreloadArguments,
validatePreinitArguments,
Expand Down
6 changes: 3 additions & 3 deletions packages/react-dom-bindings/src/client/ReactDOMHostConfig.js
Original file line number Diff line number Diff line change
Expand Up @@ -61,16 +61,16 @@ import {
getChildNamespace,
SVG_NAMESPACE,
MATH_NAMESPACE,
} from '../shared/DOMNamespaces';
} from './DOMNamespaces';
import {
ELEMENT_NODE,
TEXT_NODE,
COMMENT_NODE,
DOCUMENT_NODE,
DOCUMENT_TYPE_NODE,
DOCUMENT_FRAGMENT_NODE,
} from '../shared/HTMLNodeType';
import dangerousStyleValue from '../shared/dangerousStyleValue';
} from './HTMLNodeType';
import dangerousStyleValue from './dangerousStyleValue';

import {retryIfBlockedOn} from '../events/ReactDOMEventReplaying';

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
*/

import getNodeForCharacterOffset from './getNodeForCharacterOffset';
import {TEXT_NODE} from '../shared/HTMLNodeType';
import {TEXT_NODE} from './HTMLNodeType';

/**
* @param {DOMElement} outerNode
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
import getActiveElement from './getActiveElement';

import {getOffsets, setOffsets} from './ReactDOMSelection';
import {ELEMENT_NODE, TEXT_NODE} from '../shared/HTMLNodeType';
import {ELEMENT_NODE, TEXT_NODE} from './HTMLNodeType';

function isTextNode(node) {
return node && node.nodeType === TEXT_NODE;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
* LICENSE file in the root directory of this source tree.
*/

import {isUnitlessNumber} from './CSSProperty';
import {isUnitlessNumber} from '../shared/CSSProperty';
import {checkCSSPropertyStringCoercion} from 'shared/CheckStringCoercion';

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
* @flow
*/

import {TEXT_NODE} from '../shared/HTMLNodeType';
import {TEXT_NODE} from './HTMLNodeType';

/**
* Given any node return the first leaf node without children.
Expand Down
2 changes: 1 addition & 1 deletion packages/react-dom-bindings/src/client/setInnerHTML.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
* @flow
*/

import {SVG_NAMESPACE} from '../shared/DOMNamespaces';
import {SVG_NAMESPACE} from './DOMNamespaces';
import createMicrosoftUnsafeLocalFunction from './createMicrosoftUnsafeLocalFunction';
import {enableTrustedTypesIntegration} from 'shared/ReactFeatureFlags';

Expand Down
2 changes: 1 addition & 1 deletion packages/react-dom-bindings/src/client/setTextContent.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
* @flow
*/

import {TEXT_NODE} from '../shared/HTMLNodeType';
import {TEXT_NODE} from './HTMLNodeType';

/**
* Set the textContent property of a node. For text updates, it's faster
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ import {
getEventListenerSet,
getEventHandlerListeners,
} from '../client/ReactDOMComponentTree';
import {COMMENT_NODE, DOCUMENT_NODE} from '../shared/HTMLNodeType';
import {COMMENT_NODE, DOCUMENT_NODE} from '../client/HTMLNodeType';
import {batchedUpdates} from './ReactDOMUpdateBatching';
import getListener from './getListener';
import {passiveBrowserEventsSupported} from './checkPassiveEvents';
Expand Down
2 changes: 1 addition & 1 deletion packages/react-dom-bindings/src/events/getEventTarget.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
* LICENSE file in the root directory of this source tree.
*/

import {TEXT_NODE} from '../shared/HTMLNodeType';
import {TEXT_NODE} from '../client/HTMLNodeType';

/**
* Gets the target node from a native browser event by accounting for
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ import {registerTwoPhaseEvent} from '../EventRegistry';
import getActiveElement from '../../client/getActiveElement';
import {getNodeFromInstance} from '../../client/ReactDOMComponentTree';
import {hasSelectionCapabilities} from '../../client/ReactInputSelection';
import {DOCUMENT_NODE} from '../../shared/HTMLNodeType';
import {DOCUMENT_NODE} from '../../client/HTMLNodeType';
import {accumulateTwoPhaseListeners} from '../DOMPluginEventSystem';

const skipSelectionChangeEvent =
Expand Down
82 changes: 0 additions & 82 deletions packages/react-dom-bindings/src/server/DOMMarkupOperations.js

This file was deleted.

This file was deleted.

18 changes: 0 additions & 18 deletions packages/react-dom-bindings/src/shared/ReactDOMDispatcher.js

This file was deleted.

2 changes: 1 addition & 1 deletion packages/react-dom/src/__tests__/ReactMount-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@

'use strict';

const {COMMENT_NODE} = require('react-dom-bindings/src/shared/HTMLNodeType');
const {COMMENT_NODE} = require('react-dom-bindings/src/client/HTMLNodeType');

let React;
let ReactDOM;
Expand Down
2 changes: 1 addition & 1 deletion packages/react-dom/src/client/ReactDOMLegacy.js
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ import {
DOCUMENT_NODE,
ELEMENT_NODE,
COMMENT_NODE,
} from 'react-dom-bindings/src/shared/HTMLNodeType';
} from 'react-dom-bindings/src/client/HTMLNodeType';

import {
createContainer,
Expand Down
2 changes: 1 addition & 1 deletion packages/react-dom/src/client/ReactDOMRoot.js
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ import {
COMMENT_NODE,
DOCUMENT_NODE,
DOCUMENT_FRAGMENT_NODE,
} from 'react-dom-bindings/src/shared/HTMLNodeType';
} from 'react-dom-bindings/src/client/HTMLNodeType';

import {
createContainer,
Expand Down
2 changes: 1 addition & 1 deletion packages/react-dom/src/test-utils/ReactTestUtils.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ import {
HostText,
} from 'react-reconciler/src/ReactWorkTags';
import {SyntheticEvent} from 'react-dom-bindings/src/events/SyntheticEvent';
import {ELEMENT_NODE} from 'react-dom-bindings/src/shared/HTMLNodeType';
import {ELEMENT_NODE} from 'react-dom-bindings/src/client/HTMLNodeType';
import {
rethrowCaughtError,
invokeGuardedCallbackAndCatchFirstError,
Expand Down

0 comments on commit 21aee59

Please sign in to comment.