mirror of
https://github.com/facebook/react.git
synced 2025-11-01 09:12:30 +00:00
* Update transforms to handle ES modules
* Update Jest to handle ES modules
* Convert react package to ES modules
* Convert react-art package to ES Modules
* Convert react-call-return package to ES Modules
* Convert react-test-renderer package to ES Modules
* Convert react-cs-renderer package to ES Modules
* Convert react-rt-renderer package to ES Modules
* Convert react-noop-renderer package to ES Modules
* Convert react-dom/server to ES modules
* Convert react-dom/{client,events,test-utils} to ES modules
* Convert react-dom/shared to ES modules
* Convert react-native-renderer to ES modules
* Convert react-reconciler to ES modules
* Convert events to ES modules
* Convert shared to ES modules
* Remove CommonJS support from transforms
* Move ReactDOMFB entry point code into react-dom/src
This is clearer because we can use ES imports in it.
* Fix Rollup shim configuration to work with ESM
* Fix incorrect comment
* Exclude external imports without side effects
* Fix ReactDOM FB build
* Remove TODOs I don’t intend to fix yet
44 lines
1.5 KiB
JavaScript
44 lines
1.5 KiB
JavaScript
/**
|
|
* Copyright (c) 2013-present, Facebook, Inc.
|
|
*
|
|
* This source code is licensed under the MIT license found in the
|
|
* LICENSE file in the root directory of this source tree.
|
|
*/
|
|
|
|
'use strict';
|
|
|
|
import EventPluginHub from 'events/EventPluginHub';
|
|
import EventPluginUtils from 'events/EventPluginUtils';
|
|
|
|
import ReactDOMComponentTree from './ReactDOMComponentTree';
|
|
import BeforeInputEventPlugin from '../events/BeforeInputEventPlugin';
|
|
import ChangeEventPlugin from '../events/ChangeEventPlugin';
|
|
import DOMEventPluginOrder from '../events/DOMEventPluginOrder';
|
|
import EnterLeaveEventPlugin from '../events/EnterLeaveEventPlugin';
|
|
import ReactBrowserEventEmitter from '../events/ReactBrowserEventEmitter';
|
|
import ReactDOMEventListener from '../events/ReactDOMEventListener';
|
|
import SelectEventPlugin from '../events/SelectEventPlugin';
|
|
import SimpleEventPlugin from '../events/SimpleEventPlugin';
|
|
|
|
ReactDOMEventListener.setHandleTopLevel(
|
|
ReactBrowserEventEmitter.handleTopLevel,
|
|
);
|
|
|
|
/**
|
|
* Inject modules for resolving DOM hierarchy and plugin ordering.
|
|
*/
|
|
EventPluginHub.injection.injectEventPluginOrder(DOMEventPluginOrder);
|
|
EventPluginUtils.injection.injectComponentTree(ReactDOMComponentTree);
|
|
|
|
/**
|
|
* Some important event plugins included by default (without having to require
|
|
* them).
|
|
*/
|
|
EventPluginHub.injection.injectEventPluginsByName({
|
|
SimpleEventPlugin: SimpleEventPlugin,
|
|
EnterLeaveEventPlugin: EnterLeaveEventPlugin,
|
|
ChangeEventPlugin: ChangeEventPlugin,
|
|
SelectEventPlugin: SelectEventPlugin,
|
|
BeforeInputEventPlugin: BeforeInputEventPlugin,
|
|
});
|