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

Drop Haste #11303

Merged
merged 29 commits into from
Oct 24, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
29 commits
Select commit Hold shift + click to select a range
2917505
Use relative paths in packages/react
gaearon Oct 20, 2017
ecc8061
Use relative paths in packages/react-art
gaearon Oct 20, 2017
3b5d962
Use relative paths in packages/react-cs
gaearon Oct 20, 2017
c3f23f4
Use relative paths in other packages
gaearon Oct 20, 2017
6aba381
Fix as many issues as I can
gaearon Oct 20, 2017
f73928d
Fix all tests
gaearon Oct 20, 2017
20c8538
Prettier
gaearon Oct 20, 2017
81f6675
Remove @providesModule
gaearon Oct 20, 2017
d5eb021
Fix remaining Haste imports I missed earlier
gaearon Oct 20, 2017
707b36a
Fix up paths to reflect new flat structure
gaearon Oct 20, 2017
3a93972
Fix Flow
gaearon Oct 20, 2017
905f253
Fix CJS and UMD builds
gaearon Oct 20, 2017
265360d
Fix FB bundles
gaearon Oct 24, 2017
7be1b8d
Fix RN bundles
gaearon Oct 24, 2017
bfbcb72
Prettier
gaearon Oct 24, 2017
a15dc5c
Fix lint
gaearon Oct 24, 2017
18f3f61
Fix warning printing and error codes
gaearon Oct 24, 2017
a9ac2f5
Fix buggy return
gaearon Oct 24, 2017
174df0a
Fix lint and Flow
gaearon Oct 24, 2017
4d42358
Use Yarn on CI
gaearon Oct 24, 2017
958792f
Unbreak Jest
gaearon Oct 24, 2017
4de7c15
Fix lint
gaearon Oct 24, 2017
474fd26
Fix aliased originals getting included in DEV
gaearon Oct 24, 2017
eceb301
Record sizes
gaearon Oct 24, 2017
e566728
Fix weird version in package.json
gaearon Oct 24, 2017
42b6613
Tweak bundle labels
gaearon Oct 24, 2017
3499f38
Get rid of output option by introducing react-dom/server.node
gaearon Oct 24, 2017
7aae950
Reconciler should depend on prop-types
gaearon Oct 24, 2017
5179733
Update sizes last time
gaearon Oct 24, 2017
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 package.json
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@
".*": "./scripts/jest/preprocessor.js"
},
"transformIgnorePatterns": [
"/node_modules/(?!react)"
"/node_modules/(?!react|shared|events)"
],
"setupFiles": [
"./scripts/jest/setup.js",
Expand Down
12 changes: 5 additions & 7 deletions packages/events/EventPluginHub.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,18 +3,16 @@
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*
* @providesModule EventPluginHub
*/

'use strict';

var EventPluginRegistry = require('EventPluginRegistry');
var EventPluginUtils = require('EventPluginUtils');
var ReactErrorUtils = require('ReactErrorUtils');
var EventPluginRegistry = require('./EventPluginRegistry');
var EventPluginUtils = require('./EventPluginUtils');
var ReactErrorUtils = require('shared/ReactErrorUtils');

var accumulateInto = require('accumulateInto');
var forEachAccumulated = require('forEachAccumulated');
var accumulateInto = require('./accumulateInto');
var forEachAccumulated = require('./forEachAccumulated');
var invariant = require('fbjs/lib/invariant');

/**
Expand Down
9 changes: 6 additions & 3 deletions packages/events/EventPluginRegistry.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,18 @@
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*
* @providesModule EventPluginRegistry
* @flow
*/

'use strict';

import type {DispatchConfig} from 'ReactSyntheticEventType';
import type {DispatchConfig} from './ReactSyntheticEventType';

import type {AnyNativeEvent, PluginName, PluginModule} from 'PluginModuleType';
import type {
AnyNativeEvent,
PluginName,
PluginModule,
} from './PluginModuleType';

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

Expand Down
4 changes: 1 addition & 3 deletions packages/events/EventPluginUtils.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,11 @@
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*
* @providesModule EventPluginUtils
*/

'use strict';

var ReactErrorUtils = require('ReactErrorUtils');
var ReactErrorUtils = require('shared/ReactErrorUtils');

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

Expand Down
10 changes: 4 additions & 6 deletions packages/events/EventPropagators.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,17 +3,15 @@
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*
* @providesModule EventPropagators
*/

'use strict';

var EventPluginHub = require('EventPluginHub');
var ReactTreeTraversal = require('ReactTreeTraversal');
var EventPluginHub = require('./EventPluginHub');
var ReactTreeTraversal = require('shared/ReactTreeTraversal');

var accumulateInto = require('accumulateInto');
var forEachAccumulated = require('forEachAccumulated');
var accumulateInto = require('./accumulateInto');
var forEachAccumulated = require('./forEachAccumulated');

type PropagationPhases = 'bubbled' | 'captured';

Expand Down
5 changes: 2 additions & 3 deletions packages/events/PluginModuleType.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,17 +4,16 @@
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*
* @providesModule PluginModuleType
* @flow
*/

'use strict';

import type {Fiber} from 'ReactFiber';
import type {Fiber} from 'react-reconciler/src/ReactFiber';
import type {
DispatchConfig,
ReactSyntheticEvent,
} from 'ReactSyntheticEventType';
} from './ReactSyntheticEventType';

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

Expand Down
4 changes: 1 addition & 3 deletions packages/events/ReactControlledComponent.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,11 @@
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*
* @providesModule ReactControlledComponent
*/

'use strict';

var EventPluginUtils = require('EventPluginUtils');
var EventPluginUtils = require('./EventPluginUtils');

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

Expand Down
4 changes: 1 addition & 3 deletions packages/events/ReactEventEmitterMixin.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,11 @@
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*
* @providesModule ReactEventEmitterMixin
*/

'use strict';

var EventPluginHub = require('EventPluginHub');
var EventPluginHub = require('./EventPluginHub');

function runEventQueueInBatch(events) {
EventPluginHub.enqueueEvents(events);
Expand Down
4 changes: 1 addition & 3 deletions packages/events/ReactGenericBatching.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,11 @@
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*
* @providesModule ReactGenericBatching
*/

'use strict';

var ReactControlledComponent = require('ReactControlledComponent');
var ReactControlledComponent = require('./ReactControlledComponent');

// Used as a way to call batchedUpdates when we don't have a reference to
// the renderer. Such as when we're dispatching events or if third party
Expand Down
4 changes: 1 addition & 3 deletions packages/events/ReactSyntheticEventType.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,12 @@
* LICENSE file in the root directory of this source tree.
*
* Flow type for SyntheticEvent class that includes private properties
*
* @providesModule ReactSyntheticEventType
* @flow
*/

'use strict';

import type {Fiber} from 'ReactFiber';
import type {Fiber} from 'react-reconciler/src/ReactFiber';

export type DispatchConfig = {
dependencies: Array<string>,
Expand Down
14 changes: 6 additions & 8 deletions packages/events/ResponderEventPlugin.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,19 +3,17 @@
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*
* @providesModule ResponderEventPlugin
*/

'use strict';

var EventPluginUtils = require('EventPluginUtils');
var EventPropagators = require('EventPropagators');
var ReactTreeTraversal = require('ReactTreeTraversal');
var ResponderSyntheticEvent = require('ResponderSyntheticEvent');
var ResponderTouchHistoryStore = require('ResponderTouchHistoryStore');
var EventPluginUtils = require('./EventPluginUtils');
var EventPropagators = require('./EventPropagators');
var ReactTreeTraversal = require('shared/ReactTreeTraversal');
var ResponderSyntheticEvent = require('./ResponderSyntheticEvent');
var ResponderTouchHistoryStore = require('./ResponderTouchHistoryStore');

var accumulate = require('accumulate');
var accumulate = require('./accumulate');

var isStartish = EventPluginUtils.isStartish;
var isMoveish = EventPluginUtils.isMoveish;
Expand Down
4 changes: 1 addition & 3 deletions packages/events/ResponderSyntheticEvent.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,11 @@
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*
* @providesModule ResponderSyntheticEvent
*/

'use strict';

var SyntheticEvent = require('SyntheticEvent');
var SyntheticEvent = require('./SyntheticEvent');

/**
* `touchHistory` isn't actually on the native event, but putting it in the
Expand Down
3 changes: 1 addition & 2 deletions packages/events/ResponderTouchHistoryStore.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,12 @@
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*
* @providesModule ResponderTouchHistoryStore
* @flow
*/

'use strict';

const EventPluginUtils = require('EventPluginUtils');
const EventPluginUtils = require('./EventPluginUtils');

const invariant = require('fbjs/lib/invariant');

Expand Down
2 changes: 0 additions & 2 deletions packages/events/SyntheticEvent.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,6 @@
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*
* @providesModule SyntheticEvent
*/

/* eslint valid-typeof: 0 */
Expand Down
2 changes: 1 addition & 1 deletion packages/events/__tests__/EventPluginRegistry-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ describe('EventPluginRegistry', () => {
beforeEach(() => {
jest.resetModuleRegistry();
// TODO: can we express this test with only public API?
EventPluginRegistry = require('EventPluginRegistry');
EventPluginRegistry = require('events/EventPluginRegistry');

createPlugin = function(properties) {
return Object.assign({extractEvents: function() {}}, properties);
Expand Down
2 changes: 1 addition & 1 deletion packages/events/__tests__/ResponderEventPlugin-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@

'use strict';

var {HostComponent} = require('ReactTypeOfWork');
var {HostComponent} = require('shared/ReactTypeOfWork');

var EventPluginHub;
var ResponderEventPlugin;
Expand Down
2 changes: 1 addition & 1 deletion packages/events/__tests__/accumulateInto-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ var accumulateInto;

describe('accumulateInto', () => {
beforeEach(() => {
accumulateInto = require('accumulateInto');
accumulateInto = require('events/accumulateInto');
});

it('throws if the second item is null', () => {
Expand Down
1 change: 0 additions & 1 deletion packages/events/accumulate.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*
* @providesModule accumulate
* @flow
*/

Expand Down
1 change: 0 additions & 1 deletion packages/events/accumulateInto.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*
* @providesModule accumulateInto
* @flow
*/

Expand Down
1 change: 0 additions & 1 deletion packages/events/forEachAccumulated.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*
* @providesModule forEachAccumulated
* @flow
*/

Expand Down
5 changes: 5 additions & 0 deletions packages/events/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"private": true,
"name": "events",
"version": "0.0.0"
}
2 changes: 0 additions & 2 deletions packages/react-art/npm/Circle.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,6 @@
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*
* @providesModule Circle.art
* @typechecks
*
* Example usage:
Expand Down
2 changes: 0 additions & 2 deletions packages/react-art/npm/Rectangle.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,6 @@
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*
* @providesModule Rectangle.art
* @typechecks
*
* Example usage:
Expand Down
2 changes: 0 additions & 2 deletions packages/react-art/npm/Wedge.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,6 @@
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*
* @providesModule Wedge.art
* @typechecks
*
* Example usage:
Expand Down
1 change: 1 addition & 0 deletions packages/react-art/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@
"prop-types": "^15.6.0"
},
"peerDependencies": {
"art": "^0.10.1",
"react": "^16.0.0"
},
"files": [
Expand Down
2 changes: 1 addition & 1 deletion packages/react-art/src/ReactART.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ const invariant = require('fbjs/lib/invariant');
const emptyObject = require('fbjs/lib/emptyObject');
const React = require('react');
const ReactFiberReconciler = require('react-reconciler');
const ReactDOMFrameScheduling = require('ReactDOMFrameScheduling');
const ReactDOMFrameScheduling = require('shared/ReactDOMFrameScheduling');

const {Component} = React;

Expand Down
6 changes: 5 additions & 1 deletion packages/react-cs-renderer/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,10 @@
"repository": "facebook/react",
"dependencies": {
"fbjs": "^0.8.16",
"object-assign": "^4.1.1"
"object-assign": "^4.1.1",
"prop-types": "^15.6.0"
},
"peerDependencies": {
"react": "^16.0.0"
}
}
11 changes: 7 additions & 4 deletions packages/react-cs-renderer/src/ReactNativeCS.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,15 @@

'use strict';

const ReactGenericBatching = require('ReactGenericBatching');
const ReactVersion = require('ReactVersion');
const ReactGenericBatching = require('events/ReactGenericBatching');
const ReactVersion = require('shared/ReactVersion');

const {injectInternals} = require('ReactFiberDevToolsHook');
// TODO: direct imports like some-package/src/* are bad. Fix me.
const {
injectInternals,
} = require('react-reconciler/src/ReactFiberDevToolsHook');
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

How do you feel about adding a lint rule for this?

Something like...

export default function(context) {
  return {
    Identifier(node) {
      if (node.name === 'require') {
        const path = node.parent.arguments[0].value;
        
        if (path.match(/^react.*\/src/)) {
	      context.report(node, 'Do not import project internals');
        }
      }
    }
  };
};

This would make us less likely to add more of these.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yea, definitely. On todo list above after we know the change itself works.


import type {ReactNativeCSType} from 'ReactNativeCSTypes';
import type {ReactNativeCSType} from './ReactNativeCSTypes';

const ReactFiberReconciler = require('react-reconciler');

Expand Down
3 changes: 1 addition & 2 deletions packages/react-cs-renderer/src/ReactNativeCSFeatureFlags.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,12 @@
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*
* @providesModule ReactNativeCSFeatureFlags
* @flow
*/

'use strict';

import type {FeatureFlags} from 'ReactFeatureFlags';
import type {FeatureFlags} from 'shared/ReactFeatureFlags';

var ReactNativeCSFeatureFlags: FeatureFlags = {
enableAsyncSubtreeAPI: true,
Expand Down
1 change: 0 additions & 1 deletion packages/react-cs-renderer/src/ReactNativeCSTypes.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*
* @providesModule ReactNativeCSTypes
* @flow
*/
'use strict';
Expand Down
Loading