Skip to content

Commit 1eed302

Browse files
authored
Drop Haste (#11303)
* Use relative paths in packages/react * Use relative paths in packages/react-art * Use relative paths in packages/react-cs * Use relative paths in other packages * Fix as many issues as I can This uncovered an interesting problem where ./b from package/src/a would resolve to a different instantiation of package/src/b in Jest. Either this is a showstopper or we can solve it by completely fobbidding remaining /src/. * Fix all tests It seems we can't use relative requires in tests anymore. Otherwise Jest becomes confused between real file and symlink. jestjs/jest#3830 This seems bad... Except that we already *don't* want people to create tests that import individual source files. All existing cases of us doing so are actually TODOs waiting to be fixed. So perhaps this requirement isn't too bad because it makes bad code looks bad. Of course, if we go with this, we'll have to lint against relative requires in tests. It also makes moving things more painful. * Prettier * Remove @providesModule * Fix remaining Haste imports I missed earlier * Fix up paths to reflect new flat structure * Fix Flow * Fix CJS and UMD builds * Fix FB bundles * Fix RN bundles * Prettier * Fix lint * Fix warning printing and error codes * Fix buggy return * Fix lint and Flow * Use Yarn on CI * Unbreak Jest * Fix lint * Fix aliased originals getting included in DEV Shouldn't affect correctness (they were ignored) but fixes DEV size regression. * Record sizes * Fix weird version in package.json * Tweak bundle labels * Get rid of output option by introducing react-dom/server.node * Reconciler should depend on prop-types * Update sizes last time
1 parent 37baacb commit 1eed302

File tree

262 files changed

+1180
-1809
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

262 files changed

+1180
-1809
lines changed

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -116,7 +116,7 @@
116116
".*": "./scripts/jest/preprocessor.js"
117117
},
118118
"transformIgnorePatterns": [
119-
"/node_modules/(?!react)"
119+
"/node_modules/(?!react|shared|events)"
120120
],
121121
"setupFiles": [
122122
"./scripts/jest/setup.js",

packages/events/EventPluginHub.js

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -3,18 +3,16 @@
33
*
44
* This source code is licensed under the MIT license found in the
55
* LICENSE file in the root directory of this source tree.
6-
*
7-
* @providesModule EventPluginHub
86
*/
97

108
'use strict';
119

12-
var EventPluginRegistry = require('EventPluginRegistry');
13-
var EventPluginUtils = require('EventPluginUtils');
14-
var ReactErrorUtils = require('ReactErrorUtils');
10+
var EventPluginRegistry = require('./EventPluginRegistry');
11+
var EventPluginUtils = require('./EventPluginUtils');
12+
var ReactErrorUtils = require('shared/ReactErrorUtils');
1513

16-
var accumulateInto = require('accumulateInto');
17-
var forEachAccumulated = require('forEachAccumulated');
14+
var accumulateInto = require('./accumulateInto');
15+
var forEachAccumulated = require('./forEachAccumulated');
1816
var invariant = require('fbjs/lib/invariant');
1917

2018
/**

packages/events/EventPluginRegistry.js

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,15 +4,18 @@
44
* This source code is licensed under the MIT license found in the
55
* LICENSE file in the root directory of this source tree.
66
*
7-
* @providesModule EventPluginRegistry
87
* @flow
98
*/
109

1110
'use strict';
1211

13-
import type {DispatchConfig} from 'ReactSyntheticEventType';
12+
import type {DispatchConfig} from './ReactSyntheticEventType';
1413

15-
import type {AnyNativeEvent, PluginName, PluginModule} from 'PluginModuleType';
14+
import type {
15+
AnyNativeEvent,
16+
PluginName,
17+
PluginModule,
18+
} from './PluginModuleType';
1619

1720
type NamesToPlugins = {[key: PluginName]: PluginModule<AnyNativeEvent>};
1821

packages/events/EventPluginUtils.js

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,13 +3,11 @@
33
*
44
* This source code is licensed under the MIT license found in the
55
* LICENSE file in the root directory of this source tree.
6-
*
7-
* @providesModule EventPluginUtils
86
*/
97

108
'use strict';
119

12-
var ReactErrorUtils = require('ReactErrorUtils');
10+
var ReactErrorUtils = require('shared/ReactErrorUtils');
1311

1412
var invariant = require('fbjs/lib/invariant');
1513

packages/events/EventPropagators.js

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3,17 +3,15 @@
33
*
44
* This source code is licensed under the MIT license found in the
55
* LICENSE file in the root directory of this source tree.
6-
*
7-
* @providesModule EventPropagators
86
*/
97

108
'use strict';
119

12-
var EventPluginHub = require('EventPluginHub');
13-
var ReactTreeTraversal = require('ReactTreeTraversal');
10+
var EventPluginHub = require('./EventPluginHub');
11+
var ReactTreeTraversal = require('shared/ReactTreeTraversal');
1412

15-
var accumulateInto = require('accumulateInto');
16-
var forEachAccumulated = require('forEachAccumulated');
13+
var accumulateInto = require('./accumulateInto');
14+
var forEachAccumulated = require('./forEachAccumulated');
1715

1816
type PropagationPhases = 'bubbled' | 'captured';
1917

packages/events/PluginModuleType.js

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,17 +4,16 @@
44
* This source code is licensed under the MIT license found in the
55
* LICENSE file in the root directory of this source tree.
66
*
7-
* @providesModule PluginModuleType
87
* @flow
98
*/
109

1110
'use strict';
1211

13-
import type {Fiber} from 'ReactFiber';
12+
import type {Fiber} from 'react-reconciler/src/ReactFiber';
1413
import type {
1514
DispatchConfig,
1615
ReactSyntheticEvent,
17-
} from 'ReactSyntheticEventType';
16+
} from './ReactSyntheticEventType';
1817

1918
export type EventTypes = {[key: string]: DispatchConfig};
2019

packages/events/ReactControlledComponent.js

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,13 +3,11 @@
33
*
44
* This source code is licensed under the MIT license found in the
55
* LICENSE file in the root directory of this source tree.
6-
*
7-
* @providesModule ReactControlledComponent
86
*/
97

108
'use strict';
119

12-
var EventPluginUtils = require('EventPluginUtils');
10+
var EventPluginUtils = require('./EventPluginUtils');
1311

1412
var invariant = require('fbjs/lib/invariant');
1513

packages/events/ReactEventEmitterMixin.js

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,13 +3,11 @@
33
*
44
* This source code is licensed under the MIT license found in the
55
* LICENSE file in the root directory of this source tree.
6-
*
7-
* @providesModule ReactEventEmitterMixin
86
*/
97

108
'use strict';
119

12-
var EventPluginHub = require('EventPluginHub');
10+
var EventPluginHub = require('./EventPluginHub');
1311

1412
function runEventQueueInBatch(events) {
1513
EventPluginHub.enqueueEvents(events);

packages/events/ReactGenericBatching.js

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,13 +3,11 @@
33
*
44
* This source code is licensed under the MIT license found in the
55
* LICENSE file in the root directory of this source tree.
6-
*
7-
* @providesModule ReactGenericBatching
86
*/
97

108
'use strict';
119

12-
var ReactControlledComponent = require('ReactControlledComponent');
10+
var ReactControlledComponent = require('./ReactControlledComponent');
1311

1412
// Used as a way to call batchedUpdates when we don't have a reference to
1513
// the renderer. Such as when we're dispatching events or if third party

packages/events/ReactSyntheticEventType.js

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,14 +5,12 @@
55
* LICENSE file in the root directory of this source tree.
66
*
77
* Flow type for SyntheticEvent class that includes private properties
8-
*
9-
* @providesModule ReactSyntheticEventType
108
* @flow
119
*/
1210

1311
'use strict';
1412

15-
import type {Fiber} from 'ReactFiber';
13+
import type {Fiber} from 'react-reconciler/src/ReactFiber';
1614

1715
export type DispatchConfig = {
1816
dependencies: Array<string>,

0 commit comments

Comments
 (0)