mirror of
https://github.com/facebook/react-native.git
synced 2025-11-01 09:14:26 +00:00
Migrate vendored code from Haste to path-based imports (#24807)
Summary: This is the next step in moving RN towards standard path-based requires. All the requires in `Libraries/vendor` have been rewritten to use relative requires. Talking to cpojer, the vendored code in RN can be modified directly. This commit uses relative requires instead of `react-native/...` so that if Facebook were to stop syncing out certain folders and therefore remove code from the react-native package, internal code at Facebook would not need to change. Closes #24769. [General] [Changed] - Migrate vendored code from Haste to path-based imports Pull Request resolved: https://github.com/facebook/react-native/pull/24807 Differential Revision: D15316831 Pulled By: cpojer fbshipit-source-id: 19475823ce9f506600bd09b001156e306bff4db8
This commit is contained in:
1 parent
f0770b6b37
commit
346417caac
11 files changed
+24
-24
No files matched your search
Vendored
+3
-3
@@ -13,9 +13,9 @@
|
||||
|
||||
'use strict';
|
||||
|
||||
const _shouldPolyfillES6Collection = require('_shouldPolyfillES6Collection');
|
||||
const guid = require('guid');
|
||||
const toIterator = require('toIterator');
|
||||
const _shouldPolyfillES6Collection = require('./_shouldPolyfillES6Collection');
|
||||
const guid = require('./guid');
|
||||
const toIterator = require('./toIterator');
|
||||
|
||||
module.exports = (function(global, undefined) {
|
||||
// Since our implementation is spec-compliant for the most part we can safely
|
||||
|
||||
Vendored
+3
-3
@@ -13,10 +13,10 @@
|
||||
|
||||
'use strict';
|
||||
|
||||
const Map = require('Map');
|
||||
const Map = require('./Map');
|
||||
|
||||
const _shouldPolyfillES6Collection = require('_shouldPolyfillES6Collection');
|
||||
const toIterator = require('toIterator');
|
||||
const _shouldPolyfillES6Collection = require('./_shouldPolyfillES6Collection');
|
||||
const toIterator = require('./toIterator');
|
||||
|
||||
module.exports = (function(global) {
|
||||
// Since our implementation is spec-compliant for the most part we can safely
|
||||
|
||||
Vendored
+1
-1
@@ -7,7 +7,7 @@
|
||||
|
||||
"use strict";
|
||||
|
||||
const mergeInto = require('mergeInto');
|
||||
const mergeInto = require('./mergeInto');
|
||||
|
||||
/**
|
||||
* Shallow merges two structures into a return value, without mutating either.
|
||||
|
||||
Vendored
+1
-1
@@ -7,7 +7,7 @@
|
||||
|
||||
"use strict";
|
||||
|
||||
var mergeHelpers = require('mergeHelpers');
|
||||
var mergeHelpers = require('./mergeHelpers');
|
||||
|
||||
var checkMergeObjectArg = mergeHelpers.checkMergeObjectArg;
|
||||
var checkMergeIntoObjectArg = mergeHelpers.checkMergeIntoObjectArg;
|
||||
|
||||
@@ -10,7 +10,7 @@
|
||||
|
||||
'use strict';
|
||||
|
||||
const mixInEventEmitter = require('mixInEventEmitter');
|
||||
const mixInEventEmitter = require('../../emitter/mixInEventEmitter');
|
||||
|
||||
/**
|
||||
* DocumentSelectionState is responsible for maintaining selection information
|
||||
|
||||
+3
-3
@@ -10,10 +10,10 @@
|
||||
|
||||
'use strict';
|
||||
|
||||
const EventSubscription = require('EventSubscription');
|
||||
const EventSubscription = require('./EventSubscription');
|
||||
|
||||
import type EventEmitter from 'EventEmitter';
|
||||
import type EventSubscriptionVendor from 'EventSubscriptionVendor';
|
||||
import type EventEmitter from './EventEmitter';
|
||||
import type EventSubscriptionVendor from './EventSubscriptionVendor';
|
||||
|
||||
/**
|
||||
* EmitterSubscription represents a subscription with listener and context data.
|
||||
|
||||
+2
-2
@@ -11,8 +11,8 @@
|
||||
|
||||
'use strict';
|
||||
|
||||
const EmitterSubscription = require('EmitterSubscription');
|
||||
const EventSubscriptionVendor = require('EventSubscriptionVendor');
|
||||
const EmitterSubscription = require('./EmitterSubscription');
|
||||
const EventSubscriptionVendor = require('./EventSubscriptionVendor');
|
||||
|
||||
const invariant = require('invariant');
|
||||
|
||||
|
||||
+3
-3
@@ -10,9 +10,9 @@
|
||||
|
||||
'use strict';
|
||||
|
||||
import type EmitterSubscription from 'EmitterSubscription';
|
||||
import type EventEmitter from 'EventEmitter';
|
||||
import type EventHolder from 'EventHolder';
|
||||
import type EmitterSubscription from './EmitterSubscription';
|
||||
import type EventEmitter from './EventEmitter';
|
||||
import type EventHolder from './EventHolder';
|
||||
|
||||
/**
|
||||
* @class EventEmitterWithHolding
|
||||
|
||||
+1
-1
@@ -10,7 +10,7 @@
|
||||
|
||||
'use strict';
|
||||
|
||||
import type EventSubscriptionVendor from 'EventSubscriptionVendor';
|
||||
import type EventSubscriptionVendor from './EventSubscriptionVendor';
|
||||
|
||||
/**
|
||||
* EventSubscription represents a subscription to a particular event. It can
|
||||
|
||||
+1
-1
@@ -12,7 +12,7 @@
|
||||
|
||||
const invariant = require('invariant');
|
||||
|
||||
import type EventSubscription from 'EventSubscription';
|
||||
import type EventSubscription from './EventSubscription';
|
||||
|
||||
/**
|
||||
* EventSubscriptionVendor stores a set of EventSubscriptions that are
|
||||
|
||||
+5
-5
@@ -10,14 +10,14 @@
|
||||
|
||||
'use strict';
|
||||
|
||||
const EventEmitter = require('EventEmitter');
|
||||
const EventEmitterWithHolding = require('EventEmitterWithHolding');
|
||||
const EventHolder = require('EventHolder');
|
||||
const EventEmitter = require('./EventEmitter');
|
||||
const EventEmitterWithHolding = require('./EventEmitterWithHolding');
|
||||
const EventHolder = require('./EventHolder');
|
||||
|
||||
const invariant = require('invariant');
|
||||
const keyOf = require('fbjs/lib/keyOf');
|
||||
|
||||
import type EmitterSubscription from 'EmitterSubscription';
|
||||
import type EmitterSubscription from './EmitterSubscription';
|
||||
|
||||
const TYPES_KEY = keyOf({__types: true});
|
||||
|
||||
@@ -120,7 +120,7 @@ const EventEmitterMixin = {
|
||||
if (!this.__eventEmitter) {
|
||||
let emitter = new EventEmitter();
|
||||
if (__DEV__) {
|
||||
const EventValidator = require('EventValidator');
|
||||
const EventValidator = require('./EventValidator');
|
||||
emitter = EventValidator.addValidation(emitter, this.__types);
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user