diff --git a/.flowconfig b/.flowconfig index 78c0582045e172..026deca0e9c935 100644 --- a/.flowconfig +++ b/.flowconfig @@ -14,12 +14,8 @@ # Ignore react and fbjs where there are overlaps, but don't ignore # anything that react-native relies on -.*/node_modules/fbjs/lib/Map.js -.*/node_modules/fbjs/lib/Promise.js .*/node_modules/fbjs/lib/fetch.js .*/node_modules/fbjs/lib/ExecutionEnvironment.js -.*/node_modules/fbjs/lib/isEmpty.js -.*/node_modules/fbjs/lib/crc32.js .*/node_modules/fbjs/lib/ErrorUtils.js # Flow has a built-in definition for the 'react' module which we prefer to use diff --git a/Libraries/Interaction/__tests__/InteractionManager-test.js b/Libraries/Interaction/__tests__/InteractionManager-test.js index 736fc93c585f64..032acf2555465b 100644 --- a/Libraries/Interaction/__tests__/InteractionManager-test.js +++ b/Libraries/Interaction/__tests__/InteractionManager-test.js @@ -6,6 +6,7 @@ jest .autoMockOff() + .mock('ErrorUtils') .mock('BatchedBridge'); function expectToBeCalledOnce(fn) { diff --git a/Libraries/Promise.js b/Libraries/Promise.js index 004741948e4d14..6484dd176807e1 100644 --- a/Libraries/Promise.js +++ b/Libraries/Promise.js @@ -1,30 +1,18 @@ /** + * Copyright (c) 2016-present, Facebook, Inc. + * All rights reserved. * - * Copyright 2013-2014 Facebook, Inc. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. + * This source code is licensed under the BSD-style license found in the + * LICENSE file in the root directory of this source tree. An additional grant + * of patent rights can be found in the PATENTS file in the same directory. * * @providesModule Promise - * - * This module wraps and augments the minimally ES6-compliant Promise - * implementation provided by the promise npm package. + * @flow */ - 'use strict'; -global.setImmediate = require('setImmediate'); -var Promise = require('promise/setimmediate/es6-extensions'); -require('promise/setimmediate/done'); +const Promise = require('fbjs/lib/Promise'); // this will require Promise.native.js + if (__DEV__) { require('promise/setimmediate/rejection-tracking').enable({ allRejections: true, @@ -46,12 +34,4 @@ if (__DEV__) { }); } -/** - * Handle either fulfillment or rejection with the same callback. - */ -Promise.prototype.finally = function(onSettled) { - return this.then(onSettled, onSettled); -}; - - module.exports = Promise; diff --git a/Libraries/vendor/core/Map.js b/Libraries/vendor/core/Map.js deleted file mode 100644 index 114add77b308ca..00000000000000 --- a/Libraries/vendor/core/Map.js +++ /dev/null @@ -1,626 +0,0 @@ -/** - * @generated SignedSource<<375749f44ce7c0f681fc1297943eaf74>> - * - * !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! - * !! This file is a check-in of a static_upstream project! !! - * !! !! - * !! You should not modify this file directly. Instead: !! - * !! 1) Use `fjs use-upstream` to temporarily replace this with !! - * !! the latest version from upstream. !! - * !! 2) Make your changes, test them, etc. !! - * !! 3) Use `fjs push-upstream` to copy your changes back to !! - * !! static_upstream. !! - * !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! - * - * Copyright 2013-2014 Facebook, Inc. - * @providesModule Map - * @preventMunge - * @typechecks - */ - -var guid = require('guid'); -var isNode = require('isNode'); -var toIterator = require('toIterator'); -var _shouldPolyfillES6Collection = require('_shouldPolyfillES6Collection'); - -module.exports = (function(global, undefined) { - // Since our implementation is spec-compliant for the most part we can safely - // delegate to a built-in version if exists and is implemented correctly. - // Firefox had gotten a few implementation details wrong across different - // versions so we guard against that. - if (!_shouldPolyfillES6Collection('Map')) { - return global.Map; - } - - /** - * == ES6 Map Collection == - * - * This module is meant to implement a Map collection as described in chapter - * 23.1 of the ES6 specification. - * - * Map objects are collections of key/value pairs where both the keys and - * values may be arbitrary ECMAScript language values. A distinct key value - * may only occur in one key/value pair within the Map's collection. - * - * https://people.mozilla.org/~jorendorff/es6-draft.html#sec-map-objects - * - * There only two -- rather small -- diviations from the spec: - * - * 1. The use of frozen objects as keys. - * We decided not to allow and simply throw an error. The reason being is - * we store a "hash" on the object for fast access to it's place in the - * internal map entries. - * If this turns out to be a popular use case it's possible to implement by - * overiding `Object.freeze` to store a "hash" property on the object - * for later use with the map. - * - * 2. The `size` property on a map object is a regular property and not a - * computed property on the prototype as described by the spec. - * The reason being is that we simply want to support ES3 environments - * which doesn't implement computed properties. - * - * == Usage == - * - * var map = new Map(iterable); - * - * map.set(key, value); - * map.get(key); // value - * map.has(key); // true - * map.delete(key); // true - * - * var iterator = map.keys(); - * iterator.next(); // {value: key, done: false} - * - * var iterator = map.values(); - * iterator.next(); // {value: value, done: false} - * - * var iterator = map.entries(); - * iterator.next(); // {value: [key, value], done: false} - * - * map.forEach(function(value, key){ this === thisArg }, thisArg); - * - * map.clear(); // resets map. - */ - - /** - * Constants - */ - - // Kinds of map iterations 23.1.5.3 - var KIND_KEY = 'key'; - var KIND_VALUE = 'value'; - var KIND_KEY_VALUE = 'key+value'; - - // In older browsers we can't create a null-prototype object so we have to - // defend against key collisions with built-in methods. - var KEY_PREFIX = '$map_'; - - // This property will be used as the internal size variable to disallow - // writing and to issue warnings for writings in development. - var SECRET_SIZE_PROP; - if (__DEV__) { - SECRET_SIZE_PROP = '$size' + guid(); - } - - // In oldIE we use the DOM Node `uniqueID` property to get create the hash. - var OLD_IE_HASH_PREFIX = 'IE_HASH_'; - - class Map { - - /** - * 23.1.1.1 - * Takes an `iterable` which is basically any object that implements a - * Symbol.iterator (@@iterator) method. The iterable is expected to be a - * collection of pairs. Each pair is a key/value pair that will be used - * to instantiate the map. - * - * @param {*} iterable - */ - constructor(iterable) { - if (!isObject(this)) { - throw new TypeError('Wrong map object type.'); - } - - initMap(this); - - if (iterable != null) { - var it = toIterator(iterable); - var next; - while (!(next = it.next()).done) { - if (!isObject(next.value)) { - throw new TypeError('Expected iterable items to be pair objects.'); - } - this.set(next.value[0], next.value[1]); - } - } - } - - /** - * 23.1.3.1 - * Clears the map from all keys and values. - */ - clear() { - initMap(this); - } - - /** - * 23.1.3.7 - * Check if a key exists in the collection. - * - * @param {*} key - * @return {boolean} - */ - has(key) { - var index = getIndex(this, key); - return !!(index != null && this._mapData[index]); - } - - /** - * 23.1.3.9 - * Adds a key/value pair to the collection. - * - * @param {*} key - * @param {*} value - * @return {map} - */ - set(key, value) { - var index = getIndex(this, key); - - if (index != null && this._mapData[index]) { - this._mapData[index][1] = value; - } else { - index = this._mapData.push([ - key, - value - ]) - 1; - setIndex(this, key, index); - if (__DEV__) { - this[SECRET_SIZE_PROP] += 1; - } else { - this.size += 1; - } - } - - return this; - } - - /** - * 23.1.3.6 - * Gets a value associated with a key in the collection. - * - * @param {*} key - * @return {*} - */ - get(key) { - var index = getIndex(this, key); - if (index == null) { - return undefined; - } else { - return this._mapData[index][1]; - } - } - - - /** - * 23.1.3.3 - * Delete a key/value from the collection. - * - * @param {*} key - * @return {boolean} Whether the key was found and deleted. - */ - delete(key) { - var index = getIndex(this, key); - if (index != null && this._mapData[index]) { - setIndex(this, key, undefined); - this._mapData[index] = undefined; - if (__DEV__) { - this[SECRET_SIZE_PROP] -= 1; - } else { - this.size -= 1; - } - return true; - } else { - return false; - } - } - - /** - * 23.1.3.4 - * Returns an iterator over the key/value pairs (in the form of an Array) in - * the collection. - * - * @return {MapIterator} - */ - entries() { - return new MapIterator(this, KIND_KEY_VALUE); - } - - /** - * 23.1.3.8 - * Returns an iterator over the keys in the collection. - * - * @return {MapIterator} - */ - keys() { - return new MapIterator(this, KIND_KEY); - } - - /** - * 23.1.3.11 - * Returns an iterator over the values pairs in the collection. - * - * @return {MapIterator} - */ - values() { - return new MapIterator(this, KIND_VALUE); - } - - /** - * 23.1.3.5 - * Iterates over the key/value pairs in the collection calling `callback` - * with [value, key, map]. An optional `thisArg` can be passed to set the - * context when `callback` is called. - * - * @param {function} callback - * @param {?object} thisArg - */ - forEach(callback, thisArg) { - if (typeof callback !== 'function') { - throw new TypeError('Callback must be callable.'); - } - - var boundCallback = callback.bind(thisArg || undefined); - var mapData = this._mapData; - - // Note that `mapData.length` should be computed on each iteration to - // support iterating over new items in the map that were added after the - // start of the iteration. - for (var i = 0; i < mapData.length; i++) { - var entry = mapData[i]; - if (entry != null) { - boundCallback(entry[1], entry[0], this); - } - } - } - } - - // 23.1.3.12 - Map.prototype[toIterator.ITERATOR_SYMBOL] = Map.prototype.entries; - - class MapIterator { - - /** - * 23.1.5.1 - * Create a `MapIterator` for a given `map`. While this class is private it - * will create objects that will be passed around publicily. - * - * @param {map} map - * @param {string} kind - */ - constructor(map, kind) { - if (!(isObject(map) && map['_mapData'])) { - throw new TypeError('Object is not a map.'); - } - - if ([KIND_KEY, KIND_KEY_VALUE, KIND_VALUE].indexOf(kind) === -1) { - throw new Error('Invalid iteration kind.'); - } - - this._map = map; - this._nextIndex = 0; - this._kind = kind; - } - - /** - * 23.1.5.2.1 - * Get the next iteration. - * - * @return {object} - */ - next() { - if (!this instanceof Map) { - throw new TypeError('Expected to be called on a MapIterator.'); - } - - var map = this._map; - var index = this._nextIndex; - var kind = this._kind; - - if (map == null) { - return createIterResultObject(undefined, true); - } - - var entries = map['_mapData']; - - while (index < entries.length) { - var record = entries[index]; - - index += 1; - this._nextIndex = index; - - if (record) { - if (kind === KIND_KEY) { - return createIterResultObject(record[0], false); - } else if (kind === KIND_VALUE) { - return createIterResultObject(record[1], false); - } else if (kind) { - return createIterResultObject(record, false); - } - } - } - - this._map = undefined; - - return createIterResultObject(undefined, true); - } - } - - // We can put this in the class definition once we have computed props - // transform. - // 23.1.5.2.2 - MapIterator.prototype[toIterator.ITERATOR_SYMBOL] = function() { - return this; - } - - /** - * Helper Functions. - */ - - /** - * Return an index to map.[[MapData]] array for a given Key. - * - * @param {map} map - * @param {*} key - * @return {?number} - */ - function getIndex(map, key) { - if (isObject(key)) { - var hash = getHash(key); - return map._objectIndex[hash]; - } else { - var prefixedKey = KEY_PREFIX + key; - if (typeof key === 'string') { - return map._stringIndex[prefixedKey]; - } else { - return map._otherIndex[prefixedKey]; - } - } - } - - /** - * Setup an index that refer to the key's location in map.[[MapData]]. - * - * @param {map} map - * @param {*} key - */ - function setIndex(map, key, index) { - var shouldDelete = index == null; - - if (isObject(key)) { - var hash = getHash(key); - if (shouldDelete) { - delete map._objectIndex[hash]; - } else { - map._objectIndex[hash] = index; - } - } else { - var prefixedKey = KEY_PREFIX + key; - if (typeof key === 'string') { - if (shouldDelete) { - delete map._stringIndex[prefixedKey]; - } else { - map._stringIndex[prefixedKey] = index; - } - } else { - if (shouldDelete) { - delete map._otherIndex[prefixedKey]; - } else { - map._otherIndex[prefixedKey] = index; - } - } - } - } - - /** - * Instantiate a map with internal slots. - * - * @param {map} map - */ - function initMap(map) { - // Data structure design inspired by Traceur's Map implementation. - // We maintain an internal array for all the entries. The array is needed - // to remember order. However, to have a reasonable HashMap performance - // i.e. O(1) for insertion, deletion, and retrieval. We maintain indices - // in objects for fast look ups. Indices are split up according to data - // types to avoid collisions. - map._mapData = []; - - // Object index maps from an object "hash" to index. The hash being a unique - // property of our choosing that we associate with the object. Association - // is done by ways of keeping a non-enumerable property on the object. - // Ideally these would be `Object.create(null)` objects but since we're - // trying to support ES3 we'll have to gaurd against collisions using - // prefixes on the keys rather than rely on null prototype objects. - map._objectIndex = {}; - - // String index maps from strings to index. - map._stringIndex = {}; - - // Numbers, booleans, undefined, and null. - map._otherIndex = {}; - - // Unfortunately we have to support ES3 and cannot have `Map.prototype.size` - // be a getter method but just a regular method. The biggest problem with - // this is safety. Clients can change the size property easily and possibly - // without noticing (e.g. `if (map.size = 1) {..}` kind of typo). What we - // can do to mitigate use getters and setters in development to disallow - // and issue a warning for changing the `size` property. - if (__DEV__) { - if (isES5) { - // If the `SECRET_SIZE_PROP` property is already defined then we're not - // in the first call to `initMap` (e.g. coming from `map.clear()`) so - // all we need to do is reset the size without defining the properties. - if (map.hasOwnProperty(SECRET_SIZE_PROP)) { - map[SECRET_SIZE_PROP] = 0; - } else { - Object.defineProperty(map, SECRET_SIZE_PROP, { - value: 0, - writable: true - }); - Object.defineProperty(map, 'size', { - set: (v) => { - console.error( - 'PLEASE FIX ME: You are changing the map size property which ' + - 'should not be writable and will break in production.' - ); - throw new Error('The map size property is not writable.'); - }, - get: () => map[SECRET_SIZE_PROP] - }); - } - - // NOTE: Early return to implement immutable `.size` in DEV. - return; - } - } - - // This is a diviation from the spec. `size` should be a getter on - // `Map.prototype`. However, we have to support IE8. - map.size = 0; - } - - /** - * Check if something is an object. - * - * @param {*} o - * @return {boolean} - */ - function isObject(o) { - return o != null && (typeof o === 'object' || typeof o === 'function'); - } - - /** - * Create an iteration object. - * - * @param {*} value - * @param {boolean} done - * @return {object} - */ - function createIterResultObject(value, done) { - return {value, done}; - } - - // Are we in a legit ES5 environment. Spoiler alert: that doesn't include IE8. - var isES5 = (function() { - try { - Object.defineProperty({}, 'x', {}); - return true; - } catch(e) { - return false; - } - })(); - - /** - * Check if an object can be extended. - * - * @param {object|array|function|regexp} o - * @return {boolean} - */ - function isExtensible(o) { - if (!isES5) { - return true; - } else { - return Object.isExtensible(o); - } - } - - /** - * IE has a `uniqueID` set on every DOM node. So we construct the hash from - * this uniqueID to avoid memory leaks and the IE cloneNode bug where it - * clones properties in addition to the attributes. - * - * @param {object} node - * @return {?string} - */ - function getIENodeHash(node) { - var uniqueID; - switch (node.nodeType) { - case 1: // Element - uniqueID = node.uniqueID; - break; - case 9: // Document - uniqueID = node.documentElement.uniqueID; - break; - default: - return null; - } - - if (uniqueID) { - return OLD_IE_HASH_PREFIX + uniqueID; - } else { - return null; - } - } - - var getHash = (function() { - var propIsEnumerable = Object.prototype.propertyIsEnumerable; - var hashProperty = guid(); - var hashCounter = 0; - - /** - * Get the "hash" associated with an object. - * - * @param {object|array|function|regexp} o - * @return {number} - */ - return function getHash(o) { - if (o[hashProperty]) { - return o[hashProperty]; - } else if (!isES5 && - o.propertyIsEnumerable && - o.propertyIsEnumerable[hashProperty]) { - return o.propertyIsEnumerable[hashProperty]; - } else if (!isES5 && - isNode(o) && - getIENodeHash(o)) { - return getIENodeHash(o); - } else if (!isES5 && o[hashProperty]) { - return o[hashProperty]; - } - - if (isExtensible(o)) { - hashCounter += 1; - if (isES5) { - Object.defineProperty(o, hashProperty, { - enumerable: false, - writable: false, - configurable: false, - value: hashCounter - }); - } else if (o.propertyIsEnumerable) { - // Since we can't define a non-enumerable property on the object - // we'll hijack one of the less-used non-enumerable properties to - // save our hash on it. Addiotionally, since this is a function it - // will not show up in `JSON.stringify` which is what we want. - o.propertyIsEnumerable = function() { - return propIsEnumerable.apply(this, arguments); - }; - o.propertyIsEnumerable[hashProperty] = hashCounter; - } else if (isNode(o)) { - // At this point we couldn't get the IE `uniqueID` to use as a hash - // and we couldn't use a non-enumerable property to exploit the - // dontEnum bug so we simply add the `hashProperty` on the node - // itself. - o[hashProperty] = hashCounter; - } else { - throw new Error('Unable to set a non-enumerable property on object.'); - } - return hashCounter; - } else { - throw new Error('Non-extensible objects are not allowed as keys.'); - } - }; - })(); - - return Map; -})(/* jslint evil: true */ Function('return this')()); diff --git a/Libraries/vendor/core/isEmpty.js b/Libraries/vendor/core/isEmpty.js deleted file mode 100644 index 27f4c0069a06f7..00000000000000 --- a/Libraries/vendor/core/isEmpty.js +++ /dev/null @@ -1,34 +0,0 @@ -/** - * @generated SignedSource<<97ffcebc9ae390e734026a4f3964bff6>> - * - * !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! - * !! This file is a check-in of a static_upstream project! !! - * !! !! - * !! You should not modify this file directly. Instead: !! - * !! 1) Use `fjs use-upstream` to temporarily replace this with !! - * !! the latest version from upstream. !! - * !! 2) Make your changes, test them, etc. !! - * !! 3) Use `fjs push-upstream` to copy your changes back to !! - * !! static_upstream. !! - * !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! - * - * @providesModule isEmpty - */ - -/** - * Mimics empty from PHP. - */ -function isEmpty(obj) { - if (Array.isArray(obj)) { - return obj.length === 0; - } else if (typeof obj === 'object') { - for (var i in obj) { - return false; - } - return true; - } else { - return !obj; - } -} - -module.exports = isEmpty; diff --git a/Libraries/vendor/crypto/crc32.js b/Libraries/vendor/crypto/crc32.js deleted file mode 100644 index 540d60aa832b6e..00000000000000 --- a/Libraries/vendor/crypto/crc32.js +++ /dev/null @@ -1,92 +0,0 @@ -/** - * @generated SignedSource<<77bdeb858138636c96c405d64b6be55c>> - * - * !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! - * !! This file is a check-in of a static_upstream project! !! - * !! !! - * !! You should not modify this file directly. Instead: !! - * !! 1) Use `fjs use-upstream` to temporarily replace this with !! - * !! the latest version from upstream. !! - * !! 2) Make your changes, test them, etc. !! - * !! 3) Use `fjs push-upstream` to copy your changes back to !! - * !! static_upstream. !! - * !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! - * - * Copyright 2004-present Facebook. All Rights Reserved. - * - * @providesModule crc32 - */ - -/* jslint bitwise: true */ - -/** - * Modified from the original for performance improvements. - * - * @see http://create.stephan-brumme.com/crc32/ - * @see http://stackoverflow.com/questions/18638900/ - * @copyright 2006 Andrea Ercolino - * @license MIT - */ - -var table = [ - 0x00000000, 0x77073096, 0xEE0E612C, 0x990951BA, 0x076DC419, 0x706AF48F, - 0xE963A535, 0x9E6495A3, 0x0EDB8832, 0x79DCB8A4, 0xE0D5E91E, 0x97D2D988, - 0x09B64C2B, 0x7EB17CBD, 0xE7B82D07, 0x90BF1D91, 0x1DB71064, 0x6AB020F2, - 0xF3B97148, 0x84BE41DE, 0x1ADAD47D, 0x6DDDE4EB, 0xF4D4B551, 0x83D385C7, - 0x136C9856, 0x646BA8C0, 0xFD62F97A, 0x8A65C9EC, 0x14015C4F, 0x63066CD9, - 0xFA0F3D63, 0x8D080DF5, 0x3B6E20C8, 0x4C69105E, 0xD56041E4, 0xA2677172, - 0x3C03E4D1, 0x4B04D447, 0xD20D85FD, 0xA50AB56B, 0x35B5A8FA, 0x42B2986C, - 0xDBBBC9D6, 0xACBCF940, 0x32D86CE3, 0x45DF5C75, 0xDCD60DCF, 0xABD13D59, - 0x26D930AC, 0x51DE003A, 0xC8D75180, 0xBFD06116, 0x21B4F4B5, 0x56B3C423, - 0xCFBA9599, 0xB8BDA50F, 0x2802B89E, 0x5F058808, 0xC60CD9B2, 0xB10BE924, - 0x2F6F7C87, 0x58684C11, 0xC1611DAB, 0xB6662D3D, 0x76DC4190, 0x01DB7106, - 0x98D220BC, 0xEFD5102A, 0x71B18589, 0x06B6B51F, 0x9FBFE4A5, 0xE8B8D433, - 0x7807C9A2, 0x0F00F934, 0x9609A88E, 0xE10E9818, 0x7F6A0DBB, 0x086D3D2D, - 0x91646C97, 0xE6635C01, 0x6B6B51F4, 0x1C6C6162, 0x856530D8, 0xF262004E, - 0x6C0695ED, 0x1B01A57B, 0x8208F4C1, 0xF50FC457, 0x65B0D9C6, 0x12B7E950, - 0x8BBEB8EA, 0xFCB9887C, 0x62DD1DDF, 0x15DA2D49, 0x8CD37CF3, 0xFBD44C65, - 0x4DB26158, 0x3AB551CE, 0xA3BC0074, 0xD4BB30E2, 0x4ADFA541, 0x3DD895D7, - 0xA4D1C46D, 0xD3D6F4FB, 0x4369E96A, 0x346ED9FC, 0xAD678846, 0xDA60B8D0, - 0x44042D73, 0x33031DE5, 0xAA0A4C5F, 0xDD0D7CC9, 0x5005713C, 0x270241AA, - 0xBE0B1010, 0xC90C2086, 0x5768B525, 0x206F85B3, 0xB966D409, 0xCE61E49F, - 0x5EDEF90E, 0x29D9C998, 0xB0D09822, 0xC7D7A8B4, 0x59B33D17, 0x2EB40D81, - 0xB7BD5C3B, 0xC0BA6CAD, 0xEDB88320, 0x9ABFB3B6, 0x03B6E20C, 0x74B1D29A, - 0xEAD54739, 0x9DD277AF, 0x04DB2615, 0x73DC1683, 0xE3630B12, 0x94643B84, - 0x0D6D6A3E, 0x7A6A5AA8, 0xE40ECF0B, 0x9309FF9D, 0x0A00AE27, 0x7D079EB1, - 0xF00F9344, 0x8708A3D2, 0x1E01F268, 0x6906C2FE, 0xF762575D, 0x806567CB, - 0x196C3671, 0x6E6B06E7, 0xFED41B76, 0x89D32BE0, 0x10DA7A5A, 0x67DD4ACC, - 0xF9B9DF6F, 0x8EBEEFF9, 0x17B7BE43, 0x60B08ED5, 0xD6D6A3E8, 0xA1D1937E, - 0x38D8C2C4, 0x4FDFF252, 0xD1BB67F1, 0xA6BC5767, 0x3FB506DD, 0x48B2364B, - 0xD80D2BDA, 0xAF0A1B4C, 0x36034AF6, 0x41047A60, 0xDF60EFC3, 0xA867DF55, - 0x316E8EEF, 0x4669BE79, 0xCB61B38C, 0xBC66831A, 0x256FD2A0, 0x5268E236, - 0xCC0C7795, 0xBB0B4703, 0x220216B9, 0x5505262F, 0xC5BA3BBE, 0xB2BD0B28, - 0x2BB45A92, 0x5CB36A04, 0xC2D7FFA7, 0xB5D0CF31, 0x2CD99E8B, 0x5BDEAE1D, - 0x9B64C2B0, 0xEC63F226, 0x756AA39C, 0x026D930A, 0x9C0906A9, 0xEB0E363F, - 0x72076785, 0x05005713, 0x95BF4A82, 0xE2B87A14, 0x7BB12BAE, 0x0CB61B38, - 0x92D28E9B, 0xE5D5BE0D, 0x7CDCEFB7, 0x0BDBDF21, 0x86D3D2D4, 0xF1D4E242, - 0x68DDB3F8, 0x1FDA836E, 0x81BE16CD, 0xF6B9265B, 0x6FB077E1, 0x18B74777, - 0x88085AE6, 0xFF0F6A70, 0x66063BCA, 0x11010B5C, 0x8F659EFF, 0xF862AE69, - 0x616BFFD3, 0x166CCF45, 0xA00AE278, 0xD70DD2EE, 0x4E048354, 0x3903B3C2, - 0xA7672661, 0xD06016F7, 0x4969474D, 0x3E6E77DB, 0xAED16A4A, 0xD9D65ADC, - 0x40DF0B66, 0x37D83BF0, 0xA9BCAE53, 0xDEBB9EC5, 0x47B2CF7F, 0x30B5FFE9, - 0xBDBDF21C, 0xCABAC28A, 0x53B39330, 0x24B4A3A6, 0xBAD03605, 0xCDD70693, - 0x54DE5729, 0x23D967BF, 0xB3667A2E, 0xC4614AB8, 0x5D681B02, 0x2A6F2B94, - 0xB40BBE37, 0xC30C8EA1, 0x5A05DF1B, 0x2D02EF8D -]; - -if (global.Int32Array !== undefined) { - table = new Int32Array(table); -} - -/** - * @returns Number - */ -function crc32(str) { - var crc = -1; - for (var i = 0, len = str.length; i < len; i++) { - crc = (crc >>> 8) ^ table[(crc ^ str.charCodeAt(i)) & 0xFF]; - } - return ~crc; -} - -module.exports = crc32; diff --git a/Libraries/vendor/fbjs/CSSCore.js b/Libraries/vendor/fbjs/CSSCore.js new file mode 100644 index 00000000000000..70f72f7677a64a --- /dev/null +++ b/Libraries/vendor/fbjs/CSSCore.js @@ -0,0 +1,14 @@ +/** + * Copyright (c) 2016-present, Facebook, Inc. + * All rights reserved. + * + * This source code is licensed under the BSD-style license found in the + * LICENSE file in the root directory of this source tree. An additional grant + * of patent rights can be found in the PATENTS file in the same directory. + * + * @providesModule CSSCore + * @flow + */ +'use strict'; + +module.exports = require('fbjs/lib/CSSCore'); diff --git a/Libraries/vendor/fbjs/Deferred.js b/Libraries/vendor/fbjs/Deferred.js new file mode 100644 index 00000000000000..88704b83901aab --- /dev/null +++ b/Libraries/vendor/fbjs/Deferred.js @@ -0,0 +1,14 @@ +/** + * Copyright (c) 2016-present, Facebook, Inc. + * All rights reserved. + * + * This source code is licensed under the BSD-style license found in the + * LICENSE file in the root directory of this source tree. An additional grant + * of patent rights can be found in the PATENTS file in the same directory. + * + * @providesModule Deferred + * @flow + */ +'use strict'; + +module.exports = require('fbjs/lib/Deferred'); diff --git a/Libraries/vendor/fbjs/EventListener.js b/Libraries/vendor/fbjs/EventListener.js new file mode 100644 index 00000000000000..ec6041de37dfb3 --- /dev/null +++ b/Libraries/vendor/fbjs/EventListener.js @@ -0,0 +1,14 @@ +/** + * Copyright (c) 2016-present, Facebook, Inc. + * All rights reserved. + * + * This source code is licensed under the BSD-style license found in the + * LICENSE file in the root directory of this source tree. An additional grant + * of patent rights can be found in the PATENTS file in the same directory. + * + * @providesModule EventListener + * @flow + */ +'use strict'; + +module.exports = require('fbjs/lib/EventListener'); diff --git a/Libraries/vendor/fbjs/Map.js b/Libraries/vendor/fbjs/Map.js new file mode 100644 index 00000000000000..4fd97503ba8b58 --- /dev/null +++ b/Libraries/vendor/fbjs/Map.js @@ -0,0 +1,14 @@ +/** + * Copyright (c) 2016-present, Facebook, Inc. + * All rights reserved. + * + * This source code is licensed under the BSD-style license found in the + * LICENSE file in the root directory of this source tree. An additional grant + * of patent rights can be found in the PATENTS file in the same directory. + * + * @providesModule Map + * @flow + */ +'use strict'; + +module.exports = require('fbjs/lib/Map'); diff --git a/Libraries/vendor/fbjs/PromiseMap.js b/Libraries/vendor/fbjs/PromiseMap.js new file mode 100644 index 00000000000000..30891f521c75de --- /dev/null +++ b/Libraries/vendor/fbjs/PromiseMap.js @@ -0,0 +1,14 @@ +/** + * Copyright (c) 2016-present, Facebook, Inc. + * All rights reserved. + * + * This source code is licensed under the BSD-style license found in the + * LICENSE file in the root directory of this source tree. An additional grant + * of patent rights can be found in the PATENTS file in the same directory. + * + * @providesModule PromiseMap + * @flow + */ +'use strict'; + +module.exports = require('fbjs/lib/PromiseMap'); diff --git a/Libraries/vendor/fbjs/TouchEventUtils.js b/Libraries/vendor/fbjs/TouchEventUtils.js new file mode 100644 index 00000000000000..f75be694416499 --- /dev/null +++ b/Libraries/vendor/fbjs/TouchEventUtils.js @@ -0,0 +1,14 @@ +/** + * Copyright (c) 2016-present, Facebook, Inc. + * All rights reserved. + * + * This source code is licensed under the BSD-style license found in the + * LICENSE file in the root directory of this source tree. An additional grant + * of patent rights can be found in the PATENTS file in the same directory. + * + * @providesModule TouchEventUtils + * @flow + */ +'use strict'; + +module.exports = require('fbjs/lib/TouchEventUtils'); diff --git a/Libraries/vendor/fbjs/URI.js b/Libraries/vendor/fbjs/URI.js new file mode 100644 index 00000000000000..72c5650012cf86 --- /dev/null +++ b/Libraries/vendor/fbjs/URI.js @@ -0,0 +1,14 @@ +/** + * Copyright (c) 2016-present, Facebook, Inc. + * All rights reserved. + * + * This source code is licensed under the BSD-style license found in the + * LICENSE file in the root directory of this source tree. An additional grant + * of patent rights can be found in the PATENTS file in the same directory. + * + * @providesModule URI + * @flow + */ +'use strict'; + +module.exports = require('fbjs/lib/URI'); diff --git a/Libraries/vendor/fbjs/UserAgent.js b/Libraries/vendor/fbjs/UserAgent.js new file mode 100644 index 00000000000000..85c2669b8c1a45 --- /dev/null +++ b/Libraries/vendor/fbjs/UserAgent.js @@ -0,0 +1,14 @@ +/** + * Copyright (c) 2016-present, Facebook, Inc. + * All rights reserved. + * + * This source code is licensed under the BSD-style license found in the + * LICENSE file in the root directory of this source tree. An additional grant + * of patent rights can be found in the PATENTS file in the same directory. + * + * @providesModule UserAgent + * @flow + */ +'use strict'; + +module.exports = require('fbjs/lib/UserAgent'); diff --git a/Libraries/vendor/fbjs/UserAgentData.js b/Libraries/vendor/fbjs/UserAgentData.js new file mode 100644 index 00000000000000..13ff6a335caf44 --- /dev/null +++ b/Libraries/vendor/fbjs/UserAgentData.js @@ -0,0 +1,14 @@ +/** + * Copyright (c) 2016-present, Facebook, Inc. + * All rights reserved. + * + * This source code is licensed under the BSD-style license found in the + * LICENSE file in the root directory of this source tree. An additional grant + * of patent rights can be found in the PATENTS file in the same directory. + * + * @providesModule UserAgentData + * @flow + */ +'use strict'; + +module.exports = require('fbjs/lib/UserAgentData'); diff --git a/Libraries/vendor/fbjs/VersionRange.js b/Libraries/vendor/fbjs/VersionRange.js new file mode 100644 index 00000000000000..de55fe18928d28 --- /dev/null +++ b/Libraries/vendor/fbjs/VersionRange.js @@ -0,0 +1,14 @@ +/** + * Copyright (c) 2016-present, Facebook, Inc. + * All rights reserved. + * + * This source code is licensed under the BSD-style license found in the + * LICENSE file in the root directory of this source tree. An additional grant + * of patent rights can be found in the PATENTS file in the same directory. + * + * @providesModule VersionRange + * @flow + */ +'use strict'; + +module.exports = require('fbjs/lib/VersionRange'); diff --git a/Libraries/vendor/fbjs/areEqual.js b/Libraries/vendor/fbjs/areEqual.js new file mode 100644 index 00000000000000..8c020878a20a75 --- /dev/null +++ b/Libraries/vendor/fbjs/areEqual.js @@ -0,0 +1,14 @@ +/** + * Copyright (c) 2016-present, Facebook, Inc. + * All rights reserved. + * + * This source code is licensed under the BSD-style license found in the + * LICENSE file in the root directory of this source tree. An additional grant + * of patent rights can be found in the PATENTS file in the same directory. + * + * @providesModule areEqual + * @flow + */ +'use strict'; + +module.exports = require('fbjs/lib/areEqual'); diff --git a/Libraries/vendor/fbjs/base62.js b/Libraries/vendor/fbjs/base62.js new file mode 100644 index 00000000000000..596b871dcbf695 --- /dev/null +++ b/Libraries/vendor/fbjs/base62.js @@ -0,0 +1,14 @@ +/** + * Copyright (c) 2016-present, Facebook, Inc. + * All rights reserved. + * + * This source code is licensed under the BSD-style license found in the + * LICENSE file in the root directory of this source tree. An additional grant + * of patent rights can be found in the PATENTS file in the same directory. + * + * @providesModule base62 + * @flow + */ +'use strict'; + +module.exports = require('fbjs/lib/base62'); diff --git a/Libraries/vendor/fbjs/camelize.js b/Libraries/vendor/fbjs/camelize.js new file mode 100644 index 00000000000000..356cfefaad1c5b --- /dev/null +++ b/Libraries/vendor/fbjs/camelize.js @@ -0,0 +1,14 @@ +/** + * Copyright (c) 2016-present, Facebook, Inc. + * All rights reserved. + * + * This source code is licensed under the BSD-style license found in the + * LICENSE file in the root directory of this source tree. An additional grant + * of patent rights can be found in the PATENTS file in the same directory. + * + * @providesModule camelize + * @flow + */ +'use strict'; + +module.exports = require('fbjs/lib/camelize'); diff --git a/Libraries/vendor/fbjs/camelizeStyleName.js b/Libraries/vendor/fbjs/camelizeStyleName.js new file mode 100644 index 00000000000000..a92ed2c104d9f9 --- /dev/null +++ b/Libraries/vendor/fbjs/camelizeStyleName.js @@ -0,0 +1,14 @@ +/** + * Copyright (c) 2016-present, Facebook, Inc. + * All rights reserved. + * + * This source code is licensed under the BSD-style license found in the + * LICENSE file in the root directory of this source tree. An additional grant + * of patent rights can be found in the PATENTS file in the same directory. + * + * @providesModule camelizeStyleName + * @flow + */ +'use strict'; + +module.exports = require('fbjs/lib/camelizeStyleName'); diff --git a/Libraries/vendor/fbjs/containsNode.js b/Libraries/vendor/fbjs/containsNode.js new file mode 100644 index 00000000000000..67d65e4f4a748b --- /dev/null +++ b/Libraries/vendor/fbjs/containsNode.js @@ -0,0 +1,14 @@ +/** + * Copyright (c) 2016-present, Facebook, Inc. + * All rights reserved. + * + * This source code is licensed under the BSD-style license found in the + * LICENSE file in the root directory of this source tree. An additional grant + * of patent rights can be found in the PATENTS file in the same directory. + * + * @providesModule containsNode + * @flow + */ +'use strict'; + +module.exports = require('fbjs/lib/containsNode'); diff --git a/Libraries/vendor/fbjs/crc32.js b/Libraries/vendor/fbjs/crc32.js new file mode 100644 index 00000000000000..cb4fba1a20120a --- /dev/null +++ b/Libraries/vendor/fbjs/crc32.js @@ -0,0 +1,14 @@ +/** + * Copyright (c) 2016-present, Facebook, Inc. + * All rights reserved. + * + * This source code is licensed under the BSD-style license found in the + * LICENSE file in the root directory of this source tree. An additional grant + * of patent rights can be found in the PATENTS file in the same directory. + * + * @providesModule crc32 + * @flow + */ +'use strict'; + +module.exports = require('fbjs/lib/crc32'); diff --git a/Libraries/vendor/fbjs/createArrayFromMixed.js b/Libraries/vendor/fbjs/createArrayFromMixed.js new file mode 100644 index 00000000000000..6489c47746cd2b --- /dev/null +++ b/Libraries/vendor/fbjs/createArrayFromMixed.js @@ -0,0 +1,14 @@ +/** + * Copyright (c) 2016-present, Facebook, Inc. + * All rights reserved. + * + * This source code is licensed under the BSD-style license found in the + * LICENSE file in the root directory of this source tree. An additional grant + * of patent rights can be found in the PATENTS file in the same directory. + * + * @providesModule createArrayFromMixed + * @flow + */ +'use strict'; + +module.exports = require('fbjs/lib/createArrayFromMixed'); diff --git a/Libraries/vendor/fbjs/createNodesFromMarkup.js b/Libraries/vendor/fbjs/createNodesFromMarkup.js new file mode 100644 index 00000000000000..fb5899c0ff3d0a --- /dev/null +++ b/Libraries/vendor/fbjs/createNodesFromMarkup.js @@ -0,0 +1,14 @@ +/** + * Copyright (c) 2016-present, Facebook, Inc. + * All rights reserved. + * + * This source code is licensed under the BSD-style license found in the + * LICENSE file in the root directory of this source tree. An additional grant + * of patent rights can be found in the PATENTS file in the same directory. + * + * @providesModule createNodesFromMarkup + * @flow + */ +'use strict'; + +module.exports = require('fbjs/lib/createNodesFromMarkup'); diff --git a/Libraries/vendor/fbjs/emptyFunction.js b/Libraries/vendor/fbjs/emptyFunction.js new file mode 100644 index 00000000000000..ac55c276a163fa --- /dev/null +++ b/Libraries/vendor/fbjs/emptyFunction.js @@ -0,0 +1,14 @@ +/** + * Copyright (c) 2016-present, Facebook, Inc. + * All rights reserved. + * + * This source code is licensed under the BSD-style license found in the + * LICENSE file in the root directory of this source tree. An additional grant + * of patent rights can be found in the PATENTS file in the same directory. + * + * @providesModule emptyFunction + * @flow + */ +'use strict'; + +module.exports = require('fbjs/lib/emptyFunction'); diff --git a/Libraries/vendor/fbjs/emptyObject.js b/Libraries/vendor/fbjs/emptyObject.js new file mode 100644 index 00000000000000..f738081cc0d03b --- /dev/null +++ b/Libraries/vendor/fbjs/emptyObject.js @@ -0,0 +1,14 @@ +/** + * Copyright (c) 2016-present, Facebook, Inc. + * All rights reserved. + * + * This source code is licensed under the BSD-style license found in the + * LICENSE file in the root directory of this source tree. An additional grant + * of patent rights can be found in the PATENTS file in the same directory. + * + * @providesModule emptyObject + * @flow + */ +'use strict'; + +module.exports = require('fbjs/lib/emptyObject'); diff --git a/Libraries/vendor/fbjs/everyObject.js b/Libraries/vendor/fbjs/everyObject.js new file mode 100644 index 00000000000000..4fe49e035ad7b0 --- /dev/null +++ b/Libraries/vendor/fbjs/everyObject.js @@ -0,0 +1,14 @@ +/** + * Copyright (c) 2016-present, Facebook, Inc. + * All rights reserved. + * + * This source code is licensed under the BSD-style license found in the + * LICENSE file in the root directory of this source tree. An additional grant + * of patent rights can be found in the PATENTS file in the same directory. + * + * @providesModule everyObject + * @flow + */ +'use strict'; + +module.exports = require('fbjs/lib/everyObject'); diff --git a/Libraries/vendor/fbjs/fetchWithRetries.js b/Libraries/vendor/fbjs/fetchWithRetries.js new file mode 100644 index 00000000000000..16d1e1aa98ebf0 --- /dev/null +++ b/Libraries/vendor/fbjs/fetchWithRetries.js @@ -0,0 +1,14 @@ +/** + * Copyright (c) 2016-present, Facebook, Inc. + * All rights reserved. + * + * This source code is licensed under the BSD-style license found in the + * LICENSE file in the root directory of this source tree. An additional grant + * of patent rights can be found in the PATENTS file in the same directory. + * + * @providesModule fetchWithRetries + * @flow + */ +'use strict'; + +module.exports = require('fbjs/lib/fetchWithRetries'); diff --git a/Libraries/vendor/fbjs/filterObject.js b/Libraries/vendor/fbjs/filterObject.js new file mode 100644 index 00000000000000..819e188e4bf50d --- /dev/null +++ b/Libraries/vendor/fbjs/filterObject.js @@ -0,0 +1,14 @@ +/** + * Copyright (c) 2016-present, Facebook, Inc. + * All rights reserved. + * + * This source code is licensed under the BSD-style license found in the + * LICENSE file in the root directory of this source tree. An additional grant + * of patent rights can be found in the PATENTS file in the same directory. + * + * @providesModule filterObject + * @flow + */ +'use strict'; + +module.exports = require('fbjs/lib/filterObject'); diff --git a/Libraries/vendor/fbjs/flattenArray.js b/Libraries/vendor/fbjs/flattenArray.js new file mode 100644 index 00000000000000..14f12d6a41ffd8 --- /dev/null +++ b/Libraries/vendor/fbjs/flattenArray.js @@ -0,0 +1,14 @@ +/** + * Copyright (c) 2016-present, Facebook, Inc. + * All rights reserved. + * + * This source code is licensed under the BSD-style license found in the + * LICENSE file in the root directory of this source tree. An additional grant + * of patent rights can be found in the PATENTS file in the same directory. + * + * @providesModule flattenArray + * @flow + */ +'use strict'; + +module.exports = require('fbjs/lib/flattenArray'); diff --git a/Libraries/vendor/fbjs/focusNode.js b/Libraries/vendor/fbjs/focusNode.js new file mode 100644 index 00000000000000..91df968db9e018 --- /dev/null +++ b/Libraries/vendor/fbjs/focusNode.js @@ -0,0 +1,14 @@ +/** + * Copyright (c) 2016-present, Facebook, Inc. + * All rights reserved. + * + * This source code is licensed under the BSD-style license found in the + * LICENSE file in the root directory of this source tree. An additional grant + * of patent rights can be found in the PATENTS file in the same directory. + * + * @providesModule focusNode + * @flow + */ +'use strict'; + +module.exports = require('fbjs/lib/focusNode'); diff --git a/Libraries/vendor/fbjs/forEachObject.js b/Libraries/vendor/fbjs/forEachObject.js new file mode 100644 index 00000000000000..1e5b39f29f293a --- /dev/null +++ b/Libraries/vendor/fbjs/forEachObject.js @@ -0,0 +1,14 @@ +/** + * Copyright (c) 2016-present, Facebook, Inc. + * All rights reserved. + * + * This source code is licensed under the BSD-style license found in the + * LICENSE file in the root directory of this source tree. An additional grant + * of patent rights can be found in the PATENTS file in the same directory. + * + * @providesModule forEachObject + * @flow + */ +'use strict'; + +module.exports = require('fbjs/lib/forEachObject'); diff --git a/Libraries/vendor/fbjs/getActiveElement.js b/Libraries/vendor/fbjs/getActiveElement.js new file mode 100644 index 00000000000000..cb597c5a27830c --- /dev/null +++ b/Libraries/vendor/fbjs/getActiveElement.js @@ -0,0 +1,14 @@ +/** + * Copyright (c) 2016-present, Facebook, Inc. + * All rights reserved. + * + * This source code is licensed under the BSD-style license found in the + * LICENSE file in the root directory of this source tree. An additional grant + * of patent rights can be found in the PATENTS file in the same directory. + * + * @providesModule getActiveElement + * @flow + */ +'use strict'; + +module.exports = require('fbjs/lib/getActiveElement'); diff --git a/Libraries/vendor/fbjs/getMarkupWrap.js b/Libraries/vendor/fbjs/getMarkupWrap.js new file mode 100644 index 00000000000000..8673d463022599 --- /dev/null +++ b/Libraries/vendor/fbjs/getMarkupWrap.js @@ -0,0 +1,14 @@ +/** + * Copyright (c) 2016-present, Facebook, Inc. + * All rights reserved. + * + * This source code is licensed under the BSD-style license found in the + * LICENSE file in the root directory of this source tree. An additional grant + * of patent rights can be found in the PATENTS file in the same directory. + * + * @providesModule getMarkupWrap + * @flow + */ +'use strict'; + +module.exports = require('fbjs/lib/getMarkupWrap'); diff --git a/Libraries/vendor/fbjs/getUnboundedScrollPosition.js b/Libraries/vendor/fbjs/getUnboundedScrollPosition.js new file mode 100644 index 00000000000000..a72586ef406349 --- /dev/null +++ b/Libraries/vendor/fbjs/getUnboundedScrollPosition.js @@ -0,0 +1,14 @@ +/** + * Copyright (c) 2016-present, Facebook, Inc. + * All rights reserved. + * + * This source code is licensed under the BSD-style license found in the + * LICENSE file in the root directory of this source tree. An additional grant + * of patent rights can be found in the PATENTS file in the same directory. + * + * @providesModule getUnboundedScrollPosition + * @flow + */ +'use strict'; + +module.exports = require('fbjs/lib/getUnboundedScrollPosition'); diff --git a/Libraries/vendor/fbjs/hyphenate.js b/Libraries/vendor/fbjs/hyphenate.js new file mode 100644 index 00000000000000..00cec2c76b635d --- /dev/null +++ b/Libraries/vendor/fbjs/hyphenate.js @@ -0,0 +1,14 @@ +/** + * Copyright (c) 2016-present, Facebook, Inc. + * All rights reserved. + * + * This source code is licensed under the BSD-style license found in the + * LICENSE file in the root directory of this source tree. An additional grant + * of patent rights can be found in the PATENTS file in the same directory. + * + * @providesModule hyphenate + * @flow + */ +'use strict'; + +module.exports = require('fbjs/lib/hyphenate'); diff --git a/Libraries/vendor/fbjs/hyphenateStyleName.js b/Libraries/vendor/fbjs/hyphenateStyleName.js new file mode 100644 index 00000000000000..b1349ea097d183 --- /dev/null +++ b/Libraries/vendor/fbjs/hyphenateStyleName.js @@ -0,0 +1,14 @@ +/** + * Copyright (c) 2016-present, Facebook, Inc. + * All rights reserved. + * + * This source code is licensed under the BSD-style license found in the + * LICENSE file in the root directory of this source tree. An additional grant + * of patent rights can be found in the PATENTS file in the same directory. + * + * @providesModule hyphenateStyleName + * @flow + */ +'use strict'; + +module.exports = require('fbjs/lib/hyphenateStyleName'); diff --git a/Libraries/vendor/fbjs/invariant.js b/Libraries/vendor/fbjs/invariant.js new file mode 100644 index 00000000000000..1a19702441d806 --- /dev/null +++ b/Libraries/vendor/fbjs/invariant.js @@ -0,0 +1,14 @@ +/** + * Copyright (c) 2016-present, Facebook, Inc. + * All rights reserved. + * + * This source code is licensed under the BSD-style license found in the + * LICENSE file in the root directory of this source tree. An additional grant + * of patent rights can be found in the PATENTS file in the same directory. + * + * @providesModule invariant + * @flow + */ +'use strict'; + +module.exports = require('fbjs/lib/invariant'); diff --git a/Libraries/vendor/fbjs/isEmpty.js b/Libraries/vendor/fbjs/isEmpty.js new file mode 100644 index 00000000000000..3d9ae58e99ecd4 --- /dev/null +++ b/Libraries/vendor/fbjs/isEmpty.js @@ -0,0 +1,14 @@ +/** + * Copyright (c) 2016-present, Facebook, Inc. + * All rights reserved. + * + * This source code is licensed under the BSD-style license found in the + * LICENSE file in the root directory of this source tree. An additional grant + * of patent rights can be found in the PATENTS file in the same directory. + * + * @providesModule isEmpty + * @flow + */ +'use strict'; + +module.exports = require('fbjs/lib/isEmpty'); diff --git a/Libraries/vendor/fbjs/isNode.js b/Libraries/vendor/fbjs/isNode.js new file mode 100644 index 00000000000000..d99b32dad5076e --- /dev/null +++ b/Libraries/vendor/fbjs/isNode.js @@ -0,0 +1,14 @@ +/** + * Copyright (c) 2016-present, Facebook, Inc. + * All rights reserved. + * + * This source code is licensed under the BSD-style license found in the + * LICENSE file in the root directory of this source tree. An additional grant + * of patent rights can be found in the PATENTS file in the same directory. + * + * @providesModule isNode + * @flow + */ +'use strict'; + +module.exports = require('fbjs/lib/isNode'); diff --git a/Libraries/vendor/fbjs/isTextNode.js b/Libraries/vendor/fbjs/isTextNode.js new file mode 100644 index 00000000000000..7b39b169863c77 --- /dev/null +++ b/Libraries/vendor/fbjs/isTextNode.js @@ -0,0 +1,14 @@ +/** + * Copyright (c) 2016-present, Facebook, Inc. + * All rights reserved. + * + * This source code is licensed under the BSD-style license found in the + * LICENSE file in the root directory of this source tree. An additional grant + * of patent rights can be found in the PATENTS file in the same directory. + * + * @providesModule isTextNode + * @flow + */ +'use strict'; + +module.exports = require('fbjs/lib/isTextNode'); diff --git a/Libraries/vendor/fbjs/joinClasses.js b/Libraries/vendor/fbjs/joinClasses.js new file mode 100644 index 00000000000000..8e7908a9d0d148 --- /dev/null +++ b/Libraries/vendor/fbjs/joinClasses.js @@ -0,0 +1,14 @@ +/** + * Copyright (c) 2016-present, Facebook, Inc. + * All rights reserved. + * + * This source code is licensed under the BSD-style license found in the + * LICENSE file in the root directory of this source tree. An additional grant + * of patent rights can be found in the PATENTS file in the same directory. + * + * @providesModule joinClasses + * @flow + */ +'use strict'; + +module.exports = require('fbjs/lib/joinClasses'); diff --git a/Libraries/vendor/fbjs/keyMirror.js b/Libraries/vendor/fbjs/keyMirror.js new file mode 100644 index 00000000000000..021b3405206c49 --- /dev/null +++ b/Libraries/vendor/fbjs/keyMirror.js @@ -0,0 +1,14 @@ +/** + * Copyright (c) 2016-present, Facebook, Inc. + * All rights reserved. + * + * This source code is licensed under the BSD-style license found in the + * LICENSE file in the root directory of this source tree. An additional grant + * of patent rights can be found in the PATENTS file in the same directory. + * + * @providesModule keyMirror + * @flow + */ +'use strict'; + +module.exports = require('fbjs/lib/keyMirror'); diff --git a/Libraries/vendor/fbjs/keyOf.js b/Libraries/vendor/fbjs/keyOf.js new file mode 100644 index 00000000000000..646040a5718691 --- /dev/null +++ b/Libraries/vendor/fbjs/keyOf.js @@ -0,0 +1,14 @@ +/** + * Copyright (c) 2016-present, Facebook, Inc. + * All rights reserved. + * + * This source code is licensed under the BSD-style license found in the + * LICENSE file in the root directory of this source tree. An additional grant + * of patent rights can be found in the PATENTS file in the same directory. + * + * @providesModule keyOf + * @flow + */ +'use strict'; + +module.exports = require('fbjs/lib/keyOf'); diff --git a/Libraries/vendor/fbjs/mapObject.js b/Libraries/vendor/fbjs/mapObject.js new file mode 100644 index 00000000000000..a74e35737cc167 --- /dev/null +++ b/Libraries/vendor/fbjs/mapObject.js @@ -0,0 +1,14 @@ +/** + * Copyright (c) 2016-present, Facebook, Inc. + * All rights reserved. + * + * This source code is licensed under the BSD-style license found in the + * LICENSE file in the root directory of this source tree. An additional grant + * of patent rights can be found in the PATENTS file in the same directory. + * + * @providesModule mapObject + * @flow + */ +'use strict'; + +module.exports = require('fbjs/lib/mapObject'); diff --git a/Libraries/vendor/fbjs/memoizeStringOnly.js b/Libraries/vendor/fbjs/memoizeStringOnly.js new file mode 100644 index 00000000000000..36d4d31458f950 --- /dev/null +++ b/Libraries/vendor/fbjs/memoizeStringOnly.js @@ -0,0 +1,14 @@ +/** + * Copyright (c) 2016-present, Facebook, Inc. + * All rights reserved. + * + * This source code is licensed under the BSD-style license found in the + * LICENSE file in the root directory of this source tree. An additional grant + * of patent rights can be found in the PATENTS file in the same directory. + * + * @providesModule memoizeStringOnly + * @flow + */ +'use strict'; + +module.exports = require('fbjs/lib/memoizeStringOnly'); diff --git a/Libraries/vendor/fbjs/monitorCodeUse.js b/Libraries/vendor/fbjs/monitorCodeUse.js new file mode 100644 index 00000000000000..c06614c17d2b75 --- /dev/null +++ b/Libraries/vendor/fbjs/monitorCodeUse.js @@ -0,0 +1,14 @@ +/** + * Copyright (c) 2016-present, Facebook, Inc. + * All rights reserved. + * + * This source code is licensed under the BSD-style license found in the + * LICENSE file in the root directory of this source tree. An additional grant + * of patent rights can be found in the PATENTS file in the same directory. + * + * @providesModule monitorCodeUse + * @flow + */ +'use strict'; + +module.exports = require('fbjs/lib/monitorCodeUse'); diff --git a/Libraries/vendor/fbjs/nativeRequestAnimationFrame.js b/Libraries/vendor/fbjs/nativeRequestAnimationFrame.js new file mode 100644 index 00000000000000..5ff2ba2a85becd --- /dev/null +++ b/Libraries/vendor/fbjs/nativeRequestAnimationFrame.js @@ -0,0 +1,14 @@ +/** + * Copyright (c) 2016-present, Facebook, Inc. + * All rights reserved. + * + * This source code is licensed under the BSD-style license found in the + * LICENSE file in the root directory of this source tree. An additional grant + * of patent rights can be found in the PATENTS file in the same directory. + * + * @providesModule nativeRequestAnimationFrame + * @flow + */ +'use strict'; + +module.exports = require('fbjs/lib/nativeRequestAnimationFrame'); diff --git a/Libraries/vendor/fbjs/nullthrows.js b/Libraries/vendor/fbjs/nullthrows.js new file mode 100644 index 00000000000000..5de73280dbf0cc --- /dev/null +++ b/Libraries/vendor/fbjs/nullthrows.js @@ -0,0 +1,14 @@ +/** + * Copyright (c) 2016-present, Facebook, Inc. + * All rights reserved. + * + * This source code is licensed under the BSD-style license found in the + * LICENSE file in the root directory of this source tree. An additional grant + * of patent rights can be found in the PATENTS file in the same directory. + * + * @providesModule nullthrows + * @flow + */ +'use strict'; + +module.exports = require('fbjs/lib/nullthrows'); diff --git a/Libraries/vendor/fbjs/performance.js b/Libraries/vendor/fbjs/performance.js new file mode 100644 index 00000000000000..eab35d18d69e92 --- /dev/null +++ b/Libraries/vendor/fbjs/performance.js @@ -0,0 +1,14 @@ +/** + * Copyright (c) 2016-present, Facebook, Inc. + * All rights reserved. + * + * This source code is licensed under the BSD-style license found in the + * LICENSE file in the root directory of this source tree. An additional grant + * of patent rights can be found in the PATENTS file in the same directory. + * + * @providesModule performance + * @flow + */ +'use strict'; + +module.exports = require('fbjs/lib/performance'); diff --git a/Libraries/vendor/fbjs/performanceNow.js b/Libraries/vendor/fbjs/performanceNow.js new file mode 100644 index 00000000000000..fa0c50535c1168 --- /dev/null +++ b/Libraries/vendor/fbjs/performanceNow.js @@ -0,0 +1,14 @@ +/** + * Copyright (c) 2016-present, Facebook, Inc. + * All rights reserved. + * + * This source code is licensed under the BSD-style license found in the + * LICENSE file in the root directory of this source tree. An additional grant + * of patent rights can be found in the PATENTS file in the same directory. + * + * @providesModule performanceNow + * @flow + */ +'use strict'; + +module.exports = require('fbjs/lib/performanceNow'); diff --git a/Libraries/vendor/fbjs/removeFromArray.js b/Libraries/vendor/fbjs/removeFromArray.js new file mode 100644 index 00000000000000..0af09ec367922b --- /dev/null +++ b/Libraries/vendor/fbjs/removeFromArray.js @@ -0,0 +1,14 @@ +/** + * Copyright (c) 2016-present, Facebook, Inc. + * All rights reserved. + * + * This source code is licensed under the BSD-style license found in the + * LICENSE file in the root directory of this source tree. An additional grant + * of patent rights can be found in the PATENTS file in the same directory. + * + * @providesModule removeFromArray + * @flow + */ +'use strict'; + +module.exports = require('fbjs/lib/removeFromArray'); diff --git a/Libraries/vendor/fbjs/requestAnimationFrame.js b/Libraries/vendor/fbjs/requestAnimationFrame.js new file mode 100644 index 00000000000000..1671e27ef1f251 --- /dev/null +++ b/Libraries/vendor/fbjs/requestAnimationFrame.js @@ -0,0 +1,14 @@ +/** + * Copyright (c) 2016-present, Facebook, Inc. + * All rights reserved. + * + * This source code is licensed under the BSD-style license found in the + * LICENSE file in the root directory of this source tree. An additional grant + * of patent rights can be found in the PATENTS file in the same directory. + * + * @providesModule requestAnimationFrame + * @flow + */ +'use strict'; + +module.exports = require('fbjs/lib/requestAnimationFrame'); diff --git a/Libraries/vendor/fbjs/resolveImmediate.js b/Libraries/vendor/fbjs/resolveImmediate.js new file mode 100644 index 00000000000000..e587c24dada352 --- /dev/null +++ b/Libraries/vendor/fbjs/resolveImmediate.js @@ -0,0 +1,14 @@ +/** + * Copyright (c) 2016-present, Facebook, Inc. + * All rights reserved. + * + * This source code is licensed under the BSD-style license found in the + * LICENSE file in the root directory of this source tree. An additional grant + * of patent rights can be found in the PATENTS file in the same directory. + * + * @providesModule resolveImmediate + * @flow + */ +'use strict'; + +module.exports = require('fbjs/lib/resolveImmediate'); diff --git a/Libraries/vendor/fbjs/shallowEqual.js b/Libraries/vendor/fbjs/shallowEqual.js new file mode 100644 index 00000000000000..065a3e68200293 --- /dev/null +++ b/Libraries/vendor/fbjs/shallowEqual.js @@ -0,0 +1,14 @@ +/** + * Copyright (c) 2016-present, Facebook, Inc. + * All rights reserved. + * + * This source code is licensed under the BSD-style license found in the + * LICENSE file in the root directory of this source tree. An additional grant + * of patent rights can be found in the PATENTS file in the same directory. + * + * @providesModule shallowEqual + * @flow + */ +'use strict'; + +module.exports = require('fbjs/lib/shallowEqual'); diff --git a/Libraries/vendor/fbjs/someObject.js b/Libraries/vendor/fbjs/someObject.js new file mode 100644 index 00000000000000..edd2cdd7b1d7f4 --- /dev/null +++ b/Libraries/vendor/fbjs/someObject.js @@ -0,0 +1,14 @@ +/** + * Copyright (c) 2016-present, Facebook, Inc. + * All rights reserved. + * + * This source code is licensed under the BSD-style license found in the + * LICENSE file in the root directory of this source tree. An additional grant + * of patent rights can be found in the PATENTS file in the same directory. + * + * @providesModule someObject + * @flow + */ +'use strict'; + +module.exports = require('fbjs/lib/someObject'); diff --git a/Libraries/vendor/fbjs/sprintf.js b/Libraries/vendor/fbjs/sprintf.js new file mode 100644 index 00000000000000..f4140fc06400c1 --- /dev/null +++ b/Libraries/vendor/fbjs/sprintf.js @@ -0,0 +1,14 @@ +/** + * Copyright (c) 2016-present, Facebook, Inc. + * All rights reserved. + * + * This source code is licensed under the BSD-style license found in the + * LICENSE file in the root directory of this source tree. An additional grant + * of patent rights can be found in the PATENTS file in the same directory. + * + * @providesModule sprintf + * @flow + */ +'use strict'; + +module.exports = require('fbjs/lib/sprintf'); diff --git a/Libraries/vendor/fbjs/toArray.js b/Libraries/vendor/fbjs/toArray.js new file mode 100644 index 00000000000000..82b5252fced697 --- /dev/null +++ b/Libraries/vendor/fbjs/toArray.js @@ -0,0 +1,14 @@ +/** + * Copyright (c) 2016-present, Facebook, Inc. + * All rights reserved. + * + * This source code is licensed under the BSD-style license found in the + * LICENSE file in the root directory of this source tree. An additional grant + * of patent rights can be found in the PATENTS file in the same directory. + * + * @providesModule toArray + * @flow + */ +'use strict'; + +module.exports = require('fbjs/lib/toArray'); diff --git a/Libraries/vendor/fbjs/warning.js b/Libraries/vendor/fbjs/warning.js new file mode 100644 index 00000000000000..7ae0cdf81b8e88 --- /dev/null +++ b/Libraries/vendor/fbjs/warning.js @@ -0,0 +1,14 @@ +/** + * Copyright (c) 2016-present, Facebook, Inc. + * All rights reserved. + * + * This source code is licensed under the BSD-style license found in the + * LICENSE file in the root directory of this source tree. An additional grant + * of patent rights can be found in the PATENTS file in the same directory. + * + * @providesModule warning + * @flow + */ +'use strict'; + +module.exports = require('fbjs/lib/warning'); diff --git a/Libraries/vendor/fbjs/xhrSimpleDataSerializer.js b/Libraries/vendor/fbjs/xhrSimpleDataSerializer.js new file mode 100644 index 00000000000000..d0d9b2c60c5253 --- /dev/null +++ b/Libraries/vendor/fbjs/xhrSimpleDataSerializer.js @@ -0,0 +1,14 @@ +/** + * Copyright (c) 2016-present, Facebook, Inc. + * All rights reserved. + * + * This source code is licensed under the BSD-style license found in the + * LICENSE file in the root directory of this source tree. An additional grant + * of patent rights can be found in the PATENTS file in the same directory. + * + * @providesModule xhrSimpleDataSerializer + * @flow + */ +'use strict'; + +module.exports = require('fbjs/lib/xhrSimpleDataSerializer'); diff --git a/package.json b/package.json index aadb2436f15461..6122025ca1e48f 100644 --- a/package.json +++ b/package.json @@ -87,7 +87,8 @@ "unmockedModulePathPatterns": [ "promise", "source-map", - "fast-path" + "fast-path", + "fbjs" ] }, "main": "Libraries/react-native/react-native.js", @@ -136,7 +137,7 @@ "debug": "^2.2.0", "event-target-shim": "^1.0.5", "fast-path": "^1.1.0", - "fbjs": "^0.6.0", + "fbjs": "^0.7.2", "fbjs-scripts": "^0.4.0", "graceful-fs": "^4.1.2", "image-size": "^0.3.5", diff --git a/packager/blacklist.js b/packager/blacklist.js index ee369e1af7266d..318e09e88ee8f8 100644 --- a/packager/blacklist.js +++ b/packager/blacklist.js @@ -17,36 +17,6 @@ var sharedBlacklist = [ 'node_modules/react/lib/React.js', 'node_modules/react/lib/ReactDOM.js', - // For each of these fbjs files (especially the non-forks/stubs), we should - // consider deleting the conflicting copy and just using the fbjs version. - // - // fbjs forks: - 'node_modules/fbjs/lib/Map.js', - 'node_modules/fbjs/lib/Promise.js', - 'node_modules/fbjs/lib/fetch.js', - // fbjs stubs: - 'node_modules/fbjs/lib/ErrorUtils.js', - 'node_modules/fbjs/lib/URI.js', - // fbjs modules: - 'node_modules/fbjs/lib/Deferred.js', - 'node_modules/fbjs/lib/PromiseMap.js', - 'node_modules/fbjs/lib/UserAgent.js', - 'node_modules/fbjs/lib/areEqual.js', - 'node_modules/fbjs/lib/base62.js', - 'node_modules/fbjs/lib/crc32.js', - 'node_modules/fbjs/lib/everyObject.js', - 'node_modules/fbjs/lib/fetchWithRetries.js', - 'node_modules/fbjs/lib/filterObject.js', - 'node_modules/fbjs/lib/flattenArray.js', - 'node_modules/fbjs/lib/forEachObject.js', - 'node_modules/fbjs/lib/isEmpty.js', - 'node_modules/fbjs/lib/nullthrows.js', - 'node_modules/fbjs/lib/removeFromArray.js', - 'node_modules/fbjs/lib/resolveImmediate.js', - 'node_modules/fbjs/lib/someObject.js', - 'node_modules/fbjs/lib/sprintf.js', - 'node_modules/fbjs/lib/xhrSimpleDataSerializer.js', - // Those conflicts with the ones in fbjs/. We need to blacklist the // internal version otherwise they won't work in open source. 'downstream/core/CSSCore.js', diff --git a/packager/react-packager/src/Resolver/index.js b/packager/react-packager/src/Resolver/index.js index 76d8d5af219bb4..d60e0fb2b4d59e 100644 --- a/packager/react-packager/src/Resolver/index.js +++ b/packager/react-packager/src/Resolver/index.js @@ -84,7 +84,6 @@ class Resolver { (opts.blacklistRE && opts.blacklistRE.test(filepath)); }, providesModuleNodeModules: [ - 'fbjs', 'react', 'react-native', // Parse requires AsyncStorage. They will