RN: Cleanup OSS JS & Flow Declarations

Reviewed By: vjeux

Differential Revision: D4210763

fbshipit-source-id: 5abaa547100b8badd13bcf311ceffc5b4098d252
This commit is contained in:
Tim Yung 2016-11-20 17:49:21 -08:00 committed by Facebook Github Bot
parent d643eed0f0
commit 23331df5a4
73 changed files with 471 additions and 382 deletions

View File

@ -6,8 +6,9 @@
* 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.
*/
'use strict';
var __fbBatchedBridge = {
const __fbBatchedBridge = { // eslint-disable-line no-unused-vars
flushedQueue: function() {
return null;
}

View File

@ -1,5 +1,15 @@
/**
* BezierEasing - use bezier curve for transition easing function
* https://github.com/gre/bezier-easing
*
* @copyright 2014-2015 Gaëtan Renaudeau. MIT License.
* @noflow
*/
/* eslint-disable */
'use strict';
jest.unmock('bezier');
var bezier = require('bezier');

View File

@ -1,10 +1,12 @@
/**
* https://github.com/gre/bezier-easing
* BezierEasing - use bezier curve for transition easing function
* by Gaëtan Renaudeau 2014 - 2015 MIT License
* https://github.com/gre/bezier-easing
*
* @copyright 2014-2015 Gaëtan Renaudeau. MIT License.
* @providesModule bezier
* @noflow
*/
'use strict';
// These values are established by empiricism with tests (tradeoff: performance VS precision)
var NEWTON_ITERATIONS = 4;

View File

@ -6,6 +6,7 @@
* 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.
*/
'use strict';
jest.disableAutomock();

View File

@ -7,7 +7,9 @@
* of patent rights can be found in the PATENTS file in the same directory.
*
* @providesModule ErrorUtils
* @flow
*/
/* eslint-disable strict */
/**

View File

@ -6,23 +6,28 @@
* 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.
*
* Sets up global variables typical in most JavaScript environments.
*
* 1. Global timers (via `setTimeout` etc).
* 2. Global console object.
* 3. Hooks for printing stack traces with source maps.
*
* Leaves enough room in the environment for implementing your own:
* 1. Require system.
* 2. Bridged modules.
*
* @providesModule InitializeCore
* @flow
*/
/* eslint strict: 0 */
/* eslint-disable strict */
/* globals window: true */
/**
* Sets up global variables typical in most JavaScript environments.
*
* 1. Global timers (via `setTimeout` etc).
* 2. Global console object.
* 3. Hooks for printing stack traces with source maps.
*
* Leaves enough room in the environment for implementing your own:
*
* 1. Require system.
* 2. Bridged modules.
*
*/
if (global.GLOBAL === undefined) {
global.GLOBAL = global;
}

View File

@ -10,9 +10,11 @@
* @noflow
* @typecheck
*/
'use strict';
const EmitterSubscription = require('EmitterSubscription');
const EventSubscriptionVendor = require('EventSubscriptionVendor');
const emptyFunction = require('fbjs/lib/emptyFunction');
const invariant = require('fbjs/lib/invariant');

View File

@ -9,6 +9,7 @@
* @providesModule mixInEventEmitter
* @flow
*/
'use strict';
const EventEmitter = require('EventEmitter');
const EventEmitterWithHolding = require('EventEmitterWithHolding');

View File

@ -9,6 +9,7 @@
* @providesModule AssetSourceResolver
* @flow
*/
'use strict';
export type ResolvedAssetSource = {
__packager_asset: boolean,

View File

@ -1,27 +1,22 @@
/**
* @generated SignedSource<<ec51291ea6059cf23faa74f8644d17b1>>
* Copyright (c) 2015-present, Facebook, Inc.
* All rights reserved.
*
* !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
* !! 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. !!
* !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
* 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 clamp
* @typechecks
*/
'use strict';
/**
* @param {number} value
* @param {number} min
* @param {number} max
* @return {number}
*/
/**
* @param {number} value
* @param {number} min
* @param {number} max
* @return {number}
*/
function clamp(min, value, max) {
if (value < min) {
return min;

View File

@ -9,6 +9,7 @@
* @providesModule promiseRejectionIsError
* @flow
*/
'use strict';
require('Promise'); // make sure the default rejection handler is installed
const rejectionTracking = require('promise/setimmediate/rejection-tracking');

View File

@ -8,6 +8,7 @@
*
* @flow
*/
'use strict';
// see also react-native.js

View File

@ -1,27 +1,24 @@
/**
* @generated SignedSource<<375749f44ce7c0f681fc1297943eaf74>>
* Copyright (c) 2015-present, Facebook, Inc.
* All rights reserved.
*
* !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
* !! 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. !!
* !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
* 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.
*
* Copyright 2013-2014 Facebook, Inc.
* @providesModule Map
* @preventMunge
* @typechecks
*/
/* eslint-disable no-extend-native, no-shadow-restricted-names */
'use strict';
var _shouldPolyfillES6Collection = require('_shouldPolyfillES6Collection');
var guid = require('guid');
var isNode = require('fbjs/lib/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
@ -298,7 +295,7 @@ module.exports = (function(global, undefined) {
* @param {string} kind
*/
constructor(map, kind) {
if (!(isObject(map) && map['_mapData'])) {
if (!(isObject(map) && map._mapData)) {
throw new TypeError('Object is not a map.');
}
@ -330,7 +327,7 @@ module.exports = (function(global, undefined) {
return createIterResultObject(undefined, true);
}
var entries = map['_mapData'];
var entries = map._mapData;
while (index < entries.length) {
var record = entries[index];
@ -360,7 +357,7 @@ module.exports = (function(global, undefined) {
// 23.1.5.2.2
MapIterator.prototype[toIterator.ITERATOR_SYMBOL] = function() {
return this;
}
};
/**
* Helper Functions.
@ -515,7 +512,7 @@ module.exports = (function(global, undefined) {
try {
Object.defineProperty({}, 'x', {});
return true;
} catch(e) {
} catch (e) {
return false;
}
})();
@ -573,7 +570,7 @@ module.exports = (function(global, undefined) {
* @param {object|array|function|regexp} o
* @return {number}
*/
return function getHash(o) {
return function getHash(o) { // eslint-disable-line no-shadow
if (o[hashProperty]) {
return o[hashProperty];
} else if (!isES5 &&
@ -623,4 +620,4 @@ module.exports = (function(global, undefined) {
})();
return Map;
})(/* jslint evil: true */ Function('return this')());
})(Function('return this')()); // eslint-disable-line no-new-func

View File

@ -1,28 +1,26 @@
/**
* @generated SignedSource<<1fe20877e83ba5d4d0ea68ab240df21c>>
* Copyright (c) 2015-present, Facebook, Inc.
* All rights reserved.
*
* !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
* !! 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. !!
* !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
* 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.
*
* Copyright 2013-2014 Facebook, Inc.
* @providesModule Set
* @preventMunge
* @typechecks
*/
var Map = require('Map');
var toIterator = require('toIterator');
var _shouldPolyfillES6Collection = require('_shouldPolyfillES6Collection');
/* eslint-disable no-extend-native */
module.exports = (function(global, undefined) {
'use strict';
var Map = require('Map');
var _shouldPolyfillES6Collection = require('_shouldPolyfillES6Collection');
var toIterator = require('toIterator');
module.exports = (function(global) {
// 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
@ -198,4 +196,4 @@ module.exports = (function(global, undefined) {
}
return Set;
})(/* jslint evil: true */ Function('return this')());
})(Function('return this')()); // eslint-disable-line no-new-func

View File

@ -1,23 +1,16 @@
/**
* @generated SignedSource<<bf0749e529897a7c9687fff37310d4d2>>
* Copyright (c) 2015-present, Facebook, Inc.
* All rights reserved.
*
* !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
* !! 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.
* 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 _shouldPolyfillES6Collection
* @preventMunge
* @flow
*/
'use strict';
/**
* Checks whether a collection name (e.g. "Map" or "Set") has a native polyfill

View File

@ -1,19 +1,14 @@
/**
* @generated SignedSource<<e8e5ba644b047d0654ca54a100d2f0f3>>
* Copyright (c) 2015-present, Facebook, Inc.
* All rights reserved.
*
* !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
* !! 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. !!
* !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
* 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 copyProperties
*/
'use strict';
/**
* Copy properties from one or more objects (up to 5) into the first object.
@ -42,7 +37,7 @@ function copyProperties(obj, a, b, c, d, e, f) {
// IE ignores toString in object iteration.. See:
// webreflection.blogspot.com/2007/07/quick-fix-internet-explorer-and.html
if (v.hasOwnProperty && v.hasOwnProperty('toString') &&
(typeof v.toString != 'undefined') && (obj.toString !== v.toString)) {
(typeof v.toString !== 'undefined') && (obj.toString !== v.toString)) {
obj.toString = v.toString;
}
}

View File

@ -1,20 +1,15 @@
/**
* @generated SignedSource<<d15b8e694c4a339791cddebd93264270>>
* Copyright (c) 2015-present, Facebook, Inc.
* All rights reserved.
*
* !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
* !! 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. !!
* !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
* 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 getObjectValues
* @typechecks
*/
'use strict';
/**
* Retrieve an object's values as an array.

View File

@ -1,29 +1,23 @@
/**
* @generated SignedSource<<4425c6f5a34b56ee4707e090f43fd075>>
* Copyright (c) 2015-present, Facebook, Inc.
* All rights reserved.
*
* !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
* !! 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.
* 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 guid
*/
/* eslint-disable no-bitwise */
'use strict';
/**
* Module that provides a function for creating a unique identifier.
* The returned value does not conform to the GUID standard, but should
* be globally unique in the context of the browser.
*
* @providesModule guid
*
*/
/*jshint bitwise: false*/
function guid() {
return 'f' + (Math.random() * (1 << 30)).toString(16).replace('.', '');
}

View File

@ -1,19 +1,14 @@
/**
* @generated SignedSource<<97ffcebc9ae390e734026a4f3964bff6>>
* Copyright (c) 2015-present, Facebook, Inc.
* All rights reserved.
*
* !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
* !! 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. !!
* !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
* 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
*/
'use strict';
/**
* Mimics empty from PHP.

View File

@ -1,23 +1,14 @@
/**
* @generated SignedSource<<32241616e13b8a54d1a7baadce8eae5d>>
* Copyright (c) 2015-present, Facebook, Inc.
* All rights reserved.
*
* !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
* !! 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.
* 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 toIterator
*
*/
'use strict';
/**
* Given an object `toIterator` will return the itrator for that object. If the

View File

@ -1,21 +1,17 @@
/**
* @generated SignedSource<<1f058815818e10d01d2ee1f2f70d0fb1>>
* Copyright (c) 2015-present, Facebook, Inc.
* All rights reserved.
*
* !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
* !! 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. !!
* !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
* 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 DocumentSelectionState
* @typechecks
*/
'use strict';
var mixInEventEmitter = require('mixInEventEmitter');
/**
@ -153,4 +149,3 @@ mixInEventEmitter(DocumentSelectionState, {
});
module.exports = DocumentSelectionState;

View File

@ -1,5 +1,16 @@
// Copyright 2004-present Facebook. All Rights Reserved.
// @nolint
/**
* Copyright (c) 2015-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.
*
* @flow
* @nolint
*/
/* eslint-disable */
// These annotations are copy/pasted from the built-in Flow definitions for
// Native Map.

View File

@ -1,14 +1,19 @@
/**
* Copyright (c) 2013-present, Facebook, Inc.
* Copyright (c) 2015-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.
*
* @flow
* @nolint
*/
/* eslint-disable */
declare class Position {
coords: Coordinates,
timestamp: number,
mocked: boolean,
coords: Coordinates,
timestamp: number,
mocked: boolean,
}

View File

@ -1,12 +1,17 @@
/**
* Copyright (c) 2013-present, Facebook, Inc.
* Copyright (c) 2015-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.
*
* @flow
* @nolint
*/
/* eslint-disable */
// These annotations are copy/pasted from the built-in Flow definitions for
// Native Promises with some non-standard APIs added in
declare class Promise<+R> {

View File

@ -1,5 +1,16 @@
// Copyright 2004-present Facebook. All Rights Reserved.
// @nolint
/**
* Copyright (c) 2015-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.
*
* @flow
* @nolint
*/
/* eslint-disable */
// These annotations are copy/pasted from the built-in Flow definitions for
// Native Set.

View File

@ -1,5 +1,5 @@
/**
* Copyright (c) 2013-present, Facebook, Inc.
* Copyright (c) 2015-present, Facebook, Inc.
* All rights reserved.
*
* This source code is licensed under the BSD-style license found in the
@ -7,8 +7,11 @@
* of patent rights can be found in the PATENTS file in the same directory.
*
* @flow
* @nolint
*/
/* eslint-disable */
declare module 'console' {
declare function assert(value: any, ...message: any): void;
declare function dir(

View File

@ -1,11 +1,15 @@
/**
* Copyright (c) 2013-present, Facebook, Inc.
* Copyright (c) 2015-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.
*
* @flow
* @nolint
*/
/* eslint-disable */
// Add missing flow definitions, can be removed when included in flow.

16
flow/react.js vendored
View File

@ -1,3 +1,17 @@
// temporary patches for React.Component and React.Element
/**
* Copyright (c) 2015-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.
*
* @flow
* @nolint
*/
/* eslint-disable */
// Temporary patches for React.Component and React.Element.
declare var ReactComponent: typeof React$Component;
declare var ReactElement: typeof React$Element;

View File

@ -6,6 +6,7 @@
* 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.
*/
'use strict';
module.exports = moduleName => {
const RealComponent = require.requireActual(moduleName);

View File

@ -6,6 +6,7 @@
* 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.
*/
'use strict';
throw new Error(
'React-Native and Jest should be tested together with the jest-react-native preset:' +

View File

@ -1,5 +1,4 @@
/* -*- Mode: js; js-indent-level: 2; -*- */
/*
/**
* Copyright 2011 Mozilla Foundation and contributors
* Licensed under the New BSD license. See LICENSE or:
* http://opensource.org/licenses/BSD-3-Clause
@ -33,9 +32,15 @@
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
* @copyright
* @noflow
*/
/*eslint no-bitwise:0,quotes:0,global-strict:0*/
/* -*- Mode: js; js-indent-level: 2; -*- */
/* eslint-disable no-bitwise, quotes, global-strict */
'use strict';
var charToIntMap = {};
var intToCharMap = {};

View File

@ -1,10 +1,16 @@
/**
* Copyright 2013-2014 Facebook, Inc.
* Copyright (c) 2013-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.
*
* @provides Array.es6
* @polyfill
*/
/*eslint-disable */
/* eslint-disable */
/**
* Creates an array from array like objects.

View File

@ -1,5 +1,10 @@
/**
* Copyright 2004-present Facebook. All Rights Reserved.
* Copyright (c) 2015-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.
*
* @provides Array.prototype.es6
* @polyfill

View File

@ -1,5 +1,5 @@
/**
* Copyright (c) 2013-present, Facebook, Inc.
* Copyright (c) 2015-present, Facebook, Inc.
* All rights reserved.
*
* This source code is licensed under the BSD-style license found in the
@ -10,6 +10,8 @@
* @polyfill
*/
/* eslint-disable strict */
if (Number.EPSILON === undefined) {
Object.defineProperty(Number, 'EPSILON', {
value: Math.pow(2, -52),

View File

@ -1,18 +1,23 @@
/**
* Copyright 2004-present Facebook. All Rights Reserved.
* Copyright (c) 2015-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.
*
* @provides Object.es7
* @polyfill
*/
(function() {
'use strict';
const hasOwnProperty = Object.prototype.hasOwnProperty;
/**
* Returns an array of the given object's own enumerable entries.
* https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/entries
*
*/
if (typeof Object.entries !== 'function') {
Object.entries = function(object) {
@ -21,8 +26,8 @@
throw new TypeError('Object.entries called on non-object');
}
let entries = [];
for (let key in object) {
const entries = [];
for (const key in object) {
if (hasOwnProperty.call(object, key)) {
entries.push([key, object[key]]);
}
@ -34,7 +39,6 @@
/**
* Returns an array of the given object's own enumerable entries.
* https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/values
*
*/
if (typeof Object.values !== 'function') {
Object.values = function(object) {
@ -43,8 +47,8 @@
throw new TypeError('Object.values called on non-object');
}
let values = [];
for (let key in object) {
const values = [];
for (const key in object) {
if (hasOwnProperty.call(object, key)) {
values.push(object[key]);
}
@ -53,4 +57,4 @@
};
}
})();
})();

View File

@ -1,10 +1,16 @@
/**
* Copyright (c) 2013-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.
*
* @provides String.prototype.es6
* @polyfill
*/
/*eslint global-strict:0, no-extend-native:0, no-bitwise:0 */
/*jshint bitwise:false*/
/* eslint-disable strict, no-extend-native, no-bitwise */
/*
* NOTE: We use (Number(x) || 0) to replace NaN values with zero.

View File

@ -1,79 +0,0 @@
/**
* Copyright (c) 2013-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.
*
* @emails oncall+jsinfra
*/
jest.disableAutomock();
describe('Number (ES6)', () => {
describe('EPSILON', () => {
beforeEach(() => {
delete Number.EPSILON;
jest.resetModuleRegistry();
require('../Number.es6');
});
it('is 2^(-52)', () => {
expect(Number.EPSILON).toBe(Math.pow(2, -52));
});
it('can be used to test equality', () => {
// https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number/EPSILON#Testing_equality
expect(Number.EPSILON).toBeGreaterThan(Math.abs(0.2 - 0.3 + 0.1));
});
});
describe('MAX_SAFE_INTEGER', () => {
beforeEach(() => {
delete Number.MAX_SAFE_INTEGER;
jest.resetModuleRegistry();
require('../Number.es6');
});
it('is 2^53 - 1', () => {
expect(Number.MAX_SAFE_INTEGER).toBe(Math.pow(2, 53) - 1);
});
});
describe('MIN_SAFE_INTEGER', () => {
beforeEach(() => {
delete Number.MIN_SAFE_INTEGER;
jest.resetModuleRegistry();
require('../Number.es6');
});
it('is -(2^53 - 1)', () => {
expect(Number.MIN_SAFE_INTEGER).toBe(-(Math.pow(2, 53) - 1));
});
});
describe('isNaN()', () => {
// https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number/isNaN#Examples
beforeEach(() => {
delete Number.isNaN;
jest.resetModuleRegistry();
require('../Number.es6');
});
it('returns true when fed something that is not-a-number', () => {
[
NaN,
Number.NaN,
0 / 0,
].forEach(value => expect(Number.isNaN(value)).toBe(true));
});
it('returns false when fed something other than not-a-number', () => {
[
'NaN',
undefined,
{},
'blabla',
true,
null,
37,
'37',
'37.37',
'',
' ',
].forEach(value => expect(Number.isNaN(value)).toBe(false));
});
});
});

View File

@ -1,10 +1,17 @@
/**
* Copyright 2004-present Facebook. All Rights Reserved.
* Copyright (c) 2013-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.
*
* @emails oncall+jsinfra
*/
/* eslint-disable fb-www/object-create-only-one-param */
/* eslint-disable fb-www/object-create-only-one-param */
'use strict';
jest.disableAutomock();
@ -35,19 +42,19 @@ describe('Object (ES7)', () => {
});
it('should return enumerable entries', () => {
let foo = Object.defineProperties({}, {
const foo = Object.defineProperties({}, {
x: {value: 10, enumerable: true},
y: {value: 20},
});
expect(Object.entries(foo)).toEqual([['x', 10]]);
let bar = {x: 10, y: 20};
const bar = {x: 10, y: 20};
expect(Object.entries(bar)).toEqual([['x', 10], ['y', 20]]);
});
it('should work with proto-less objects', () => {
let foo = Object.create(null, {
const foo = Object.create(null, {
x: {value: 10, enumerable: true},
y: {value: 20},
});
@ -56,7 +63,7 @@ describe('Object (ES7)', () => {
});
it('should return only own entries', () => {
let foo = Object.create({z: 30}, {
const foo = Object.create({z: 30}, {
x: {value: 10, enumerable: true},
y: {value: 20},
});
@ -84,19 +91,19 @@ describe('Object (ES7)', () => {
});
it('should return enumerable values', () => {
let foo = Object.defineProperties({}, {
const foo = Object.defineProperties({}, {
x: {value: 10, enumerable: true},
y: {value: 20},
});
expect(Object.values(foo)).toEqual([10]);
let bar = {x: 10, y: 20};
const bar = {x: 10, y: 20};
expect(Object.values(bar)).toEqual([10, 20]);
});
it('should work with proto-less objects', () => {
let foo = Object.create(null, {
const foo = Object.create(null, {
x: {value: 10, enumerable: true},
y: {value: 20},
});
@ -105,7 +112,7 @@ describe('Object (ES7)', () => {
});
it('should return only own values', () => {
let foo = Object.create({z: 30}, {
const foo = Object.create({z: 30}, {
x: {value: 10, enumerable: true},
y: {value: 20},
});
@ -117,4 +124,4 @@ describe('Object (ES7)', () => {
expect(Object.values('ab')).toEqual(['a', 'b']);
});
});
});
});

View File

@ -5,6 +5,8 @@
* 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.
*
* @polyfill
*/
/* eslint-disable */

View File

@ -6,9 +6,6 @@
* 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.
*
* This pipes all of our console logging functions to native logging so that
* JavaScript errors in required modules show up in Xcode via NSLog.
*
* @provides console
* @polyfill
* @nolint
@ -16,6 +13,10 @@
/* eslint-disable */
/**
* This pipes all of our console logging functions to native logging so that
* JavaScript errors in required modules show up in Xcode via NSLog.
*/
const inspect = (function() {
// Copyright Joyent, Inc. and other Node contributors.
//

View File

@ -6,15 +6,11 @@
* 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.
*
* The particular require runtime that we are using looks for a global
* `ErrorUtils` object and if it exists, then it requires modules with the
* error handler specified via ErrorUtils.setGlobalHandler by calling the
* require function with applyWithGuard. Since the require module is loaded
* before any of the modules, this ErrorUtils must be defined (and the handler
* set) globally before requiring anything.
* @polyfill
*/
/* eslint strict:0 */
/* eslint-disable strict */
let _inGuard = 0;
/**
@ -26,6 +22,14 @@ let _globalHandler = function onError(e) {
throw e;
};
/**
* The particular require runtime that we are using looks for a global
* `ErrorUtils` object and if it exists, then it requires modules with the
* error handler specified via ErrorUtils.setGlobalHandler by calling the
* require function with applyWithGuard. Since the require module is loaded
* before any of the modules, this ErrorUtils must be defined (and the handler
* set) globally before requiring anything.
*/
const ErrorUtils = {
setGlobalHandler: function(fun) {
_globalHandler = fun;

View File

@ -6,17 +6,16 @@
* 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.
*
* This pipes all of our console logging functions to native logging so that
* JavaScript errors in required modules show up in Xcode via NSLog.
*
* @provides Object.es6
* @polyfill
*/
/* eslint-disable strict */
// WARNING: This is an optimized version that fails on hasOwnProperty checks
// and non objects. It's not spec-compliant. It's a perf optimization.
// This is only needed for iOS 8 and current Android JSC.
/* eslint strict:0 */
// This is only needed for iOS 8 and current Android JSC.
Object.assign = function(target, sources) {
if (__DEV__) {
if (target == null) {

View File

@ -1,4 +1,16 @@
/* eslint strict:0 */
/**
* Copyright (c) 2013-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.
*
* @polyfill
*/
/* eslint-disable strict */
global.__DEV__ = false;
global.__BUNDLE_START_TIME__ = Date.now();

View File

@ -1,4 +1,16 @@
/* eslint strict:0 */
/**
* Copyright (c) 2013-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.
*
* @polyfill
*/
/* eslint-disable strict */
global.__DEV__ = true;
global.__BUNDLE_START_TIME__ = Date.now();

View File

@ -6,6 +6,7 @@
* 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.
*
* @polyfill
* @flow
*/

View File

@ -1,4 +1,4 @@
/**
/**
* Copyright (c) 2015-present, Facebook, Inc.
* All rights reserved.
*

View File

@ -1,10 +1,23 @@
/**
* Copyright (c) 2015-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.
*/
/* globals echo:false */
'use strict';
/**
* Try executing a function n times recursively.
* Return 0 the first time it succeeds
* Return code of the last failed commands if not more retries left
* @funcToRetry - function that gets retried
* @retriesLeft - number of retries to execute funcToRetry
* @onEveryError - func to execute if funcToRetry returns non 0
* @onEveryError - func to execute if funcToRetry returns non 0
*/
function tryExecNTimes(funcToRetry, retriesLeft, onEveryError) {
const exitCode = funcToRetry();

View File

@ -8,6 +8,9 @@
*
* @providesModule AlgoliaDocSearch
*/
'use strict';
var React = require('React');
var AlgoliaDocSearch = React.createClass({
render: function() {

View File

@ -8,9 +8,10 @@
*
* @providesModule DocsSidebar
*/
'use strict';
var React = require('React');
var Metadata = require('Metadata');
var React = require('React');
var DocsSidebar = React.createClass({
getCategories: function() {

View File

@ -8,6 +8,7 @@
*
* @providesModule Footer
*/
'use strict';
var React = require('React');

View File

@ -8,9 +8,10 @@
*
* @providesModule H2
*/
'use strict';
var React = require('React');
var Header = require('Header');
var React = require('React');
var H2 = React.createClass({
render: function() {

View File

@ -8,8 +8,10 @@
*
* @providesModule Header
*/
'use strict';
var React = require('React');
var slugify = require('slugify');
var Header = React.createClass({
@ -23,7 +25,7 @@ var Header = React.createClass({
var base = this.context.permalink || '';
return (
<H {...this.props}>
<a className="anchor" name={slug}></a>
<a className="anchor" name={slug} />
{this.props.children}
{' '}<a className="hash-link" href={base + '#' + slug}>#</a>
</H>

View File

@ -8,9 +8,10 @@
*
* @providesModule HeaderLinks
*/
'use strict';
var React = require('React');
var AlgoliaDocSearch = require('AlgoliaDocSearch');
var React = require('React');
var HeaderLinks = React.createClass({
linksInternal: [

View File

@ -8,6 +8,7 @@
*
* @providesModule HeaderWithGithub
*/
'use strict';
var H = require('Header');
var React = require('React');

View File

@ -8,6 +8,7 @@
*
* @providesModule Hero
*/
'use strict';
var React = require('React');

View File

@ -1,15 +1,20 @@
/**
* marked - a markdown parser
* Copyright (c) 2011-2013, Christopher Jeffrey. (MIT Licensed)
* https://github.com/chjj/marked
*
* @copyright 2011-2013 Christopher Jeffrey. MIT License.
* @providesModule Marked
* @noflow
*/
var React = require('React');
var Prism = require('Prism');
var WebPlayer = require('WebPlayer');
/* eslint-disable */
'use strict';
var Header = require('Header');
var Prism = require('Prism');
var React = require('React');
var WebPlayer = require('WebPlayer');
/**
* Block-Level Grammar

View File

@ -1,11 +1,15 @@
/**
* Prism: Lightweight, robust, elegant syntax highlighting
* MIT license http://www.opensource.org/licenses/mit-license.php/
* @author Lea Verou http://lea.verou.me
*
* @copyright Lea Verou <http://lea.verou.me>. MIT License.
* @providesModule Prism
* @noflow
*/
/* eslint-disable */
'use strict';
var React = require('React');
var _ = {

View File

@ -8,10 +8,11 @@
*
* @providesModule Site
*/
'use strict';
var React = require('React');
var HeaderLinks = require('HeaderLinks');
var Metadata = require('Metadata');
var React = require('React');
var Site = React.createClass({
render: function() {
@ -24,60 +25,60 @@ var Site = React.createClass({
var title = this.props.title ? this.props.title : 'React Native | A framework for building native apps using React';
var metaTags = [
{ charSet: "utf-8" },
{ charSet: 'utf-8' },
{
httpEquiv: "X-UA-Compatible",
content: "IE=edge,chrome=1",
httpEquiv: 'X-UA-Compatible',
content: 'IE=edge,chrome=1',
},
{
name: "viewport",
content: "width=device-width",
name: 'viewport',
content: 'width=device-width',
},
// Facebook
{ property: "fb:app_id", content: "1677033832619985", },
{ property: "fb:admins", content: "121800083", },
{ property: 'fb:app_id', content: '1677033832619985', },
{ property: 'fb:admins', content: '121800083', },
// Open Graph
{
property: "og:site_name",
content: "React Native",
property: 'og:site_name',
content: 'React Native',
},
{
property: "og:title",
property: 'og:title',
content: title,
},
{
property: "og:url",
content: "https://facebook.github.io/react-native/" + (this.props.path ? this.props.path : "index.html"),
property: 'og:url',
content: 'https://facebook.github.io/react-native/' + (this.props.path ? this.props.path : 'index.html'),
},
{
property: "og:image",
content: this.props.image ? this.props.image : "https://facebook.github.io/react-native/img/opengraph.png",
property: 'og:image',
content: this.props.image ? this.props.image : 'https://facebook.github.io/react-native/img/opengraph.png',
},
{
property: "og:description",
content: this.props.description ? this.props.description : "A framework for building native apps using React",
property: 'og:description',
content: this.props.description ? this.props.description : 'A framework for building native apps using React',
},
// Twitter Cards
{
name: "twitter:site",
content: "@reactnative",
name: 'twitter:site',
content: '@reactnative',
},
{
name: "twitter:card",
content: "summary_large_image",
name: 'twitter:card',
content: 'summary_large_image',
},
];
var typeTags = [{
property: "og:type",
content: "website",
property: 'og:type',
content: 'website',
}];
if (this.props.author) {
typeTags = [{
property: "og:type",
content: "article",
property: 'og:type',
content: 'article',
}, {
property: "article:author",
property: 'article:author',
content: this.props.author,
}];
}
@ -85,8 +86,8 @@ var Site = React.createClass({
if (this.props.authorTwitter) {
metaTags.push({
name: "twitter:creator",
content: "@" + this.props.authorTwitter,
name: 'twitter:creator',
content: '@' + this.props.authorTwitter,
});
}
@ -109,12 +110,12 @@ var Site = React.createClass({
<link rel="alternate" type="application/rss+xml" title="React Native Blog" href="https://facebook.github.io/react-native/blog/feed.xml" />
<link href="//cdn-images.mailchimp.com/embedcode/horizontal-slim-10_7.css" rel="stylesheet" type="text/css" />
<script type="text/javascript" src="//use.typekit.net/vqa1hcx.js"></script>
<script type="text/javascript" src="//use.typekit.net/vqa1hcx.js" />
<script type="text/javascript">{'try{Typekit.load();}catch(e){}'}</script>
</head>
<body>
<script dangerouslySetInnerHTML={{__html: `window.fbAsyncInit = function() {FB.init({appId:'1677033832619985',xfbml:true,version:'v2.7'});};(function(d, s, id){var js, fjs = d.getElementsByTagName(s)[0];if (d.getElementById(id)) {return;}js = d.createElement(s); js.id = id;js.src = '//connect.facebook.net/en_US/sdk.js';fjs.parentNode.insertBefore(js, fjs);}(document, 'script','facebook-jssdk'));`}} />
<script dangerouslySetInnerHTML={{__html: `window.twttr=(function(d,s, id){var js,fjs=d.getElementsByTagName(s)[0],t=window.twttr||{};if(d.getElementById(id))return t;js=d.createElement(s);js.id=id;js.src="https://platform.twitter.com/widgets.js";fjs.parentNode.insertBefore(js, fjs);t._e = [];t.ready = function(f) {t._e.push(f);};return t;}(document, "script", "twitter-wjs"));`}} />
<script dangerouslySetInnerHTML={{__html: "window.fbAsyncInit = function() {FB.init({appId:'1677033832619985',xfbml:true,version:'v2.7'});};(function(d, s, id){var js, fjs = d.getElementsByTagName(s)[0];if (d.getElementById(id)) {return;}js = d.createElement(s); js.id = id;js.src = '//connect.facebook.net/en_US/sdk.js';fjs.parentNode.insertBefore(js, fjs);}(document, 'script','facebook-jssdk'));"}} />
<script dangerouslySetInnerHTML={{__html: "window.twttr=(function(d,s, id){var js,fjs=d.getElementsByTagName(s)[0],t=window.twttr||{};if(d.getElementById(id))return t;js=d.createElement(s);js.id=id;js.src='https://platform.twitter.com/widgets.js';fjs.parentNode.insertBefore(js, fjs);t._e = [];t.ready = function(f) {t._e.push(f);};return t;}(document, 'script', 'twitter-wjs'));"}} />
<div className="container">
<div className="nav-main">
<div className="wrap">
@ -168,11 +169,11 @@ var Site = React.createClass({
<div id="mc_embed_signup">
<form action="//reactnative.us10.list-manage.com/subscribe/post?u=db0dd948e2b729ee62625b1a8&amp;id=47cd41008f" method="post" id="mc-embedded-subscribe-form" name="mc-embedded-subscribe-form" className="validate" target="_blank" noValidate>
<div id="mc_embed_signup_scroll">
<label for="mce-EMAIL">
<label for="mce-EMAIL">
<h5>Get the React Native Newsletter</h5>
</label>
<input type="email" value="" name="EMAIL" className="email" id="mce-EMAIL" placeholder="email address" required />
<div style={{ position: "absolute", left: "-5000px"}} aria-hidden="true">
<input type="email" value="" name="EMAIL" className="email" id="mce-EMAIL" placeholder="email address" required />
<div style={{position: 'absolute', left: '-5000px'}} aria-hidden="true">
<input type="text" name="b_db0dd948e2b729ee62625b1a8_47cd41008f" tabIndex="-1" value="" />
</div>
<div className="clear">
@ -193,7 +194,7 @@ var Site = React.createClass({
</div>
<div id="fb-root" />
<script type="text/javascript" src="https://cdn.jsdelivr.net/docsearch.js/1/docsearch.min.js"></script>
<script type="text/javascript" src="https://cdn.jsdelivr.net/docsearch.js/1/docsearch.min.js" />
<script dangerouslySetInnerHTML={{__html: `
(function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
(i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
@ -215,8 +216,8 @@ var Site = React.createClass({
`}} />
<script src="js/scripts.js" />
{/* Mailchimp Inline form-submission script for the React Native newsletter sign up form */}
<script type='text/javascript' src='//s3.amazonaws.com/downloads.mailchimp.com/js/mc-validate.js'></script>
<script type='text/javascript' dangerouslySetInnerHTML={{__html: `(function($) {window.fnames = new Array(); window.ftypes = new Array();fnames[0]='EMAIL';ftypes[0]='email';fnames[1]='FNAME';ftypes[1]='text';fnames[2]='LNAME';ftypes[2]='text';}(jQuery));var $mcj = jQuery.noConflict(true);`}} />
<script type="text/javascript" src="//s3.amazonaws.com/downloads.mailchimp.com/js/mc-validate.js" />
<script type="text/javascript" dangerouslySetInnerHTML={{__html: "(function($) {window.fnames = new Array(); window.ftypes = new Array();fnames[0]='EMAIL';ftypes[0]='email';fnames[1]='FNAME';ftypes[1]='text';fnames[2]='LNAME';ftypes[2]='text';}(jQuery));var $mcj = jQuery.noConflict(true);"}} />
</body>
</html>
);

View File

@ -8,9 +8,10 @@
*
* @providesModule WebPlayer
*/
'use strict';
var React = require('React');
var Prism = require('Prism');
var React = require('React');
var WEB_PLAYER_VERSION = '1.2.6';
@ -57,10 +58,10 @@ var WebPlayer = React.createClass({
<Prism>{this.props.children}</Prism>
<iframe
style={{marginTop: 4}}
width='880'
width="880"
height={this.parseParams(this.props.params).platform === 'android' ? '425' : '420'}
data-src={`//cdn.rawgit.com/dabbott/react-native-web-player/gh-v${WEB_PLAYER_VERSION}/index.html${hash}`}
frameBorder='0'
frameBorder="0"
/>
</div>
);

View File

@ -8,6 +8,7 @@
*
* @providesModule center
*/
'use strict';
var React = require('React');

View File

@ -8,6 +8,7 @@
*
* @providesModule slugify
*/
'use strict';
var slugify = function(string) {
// var accents = 'àáäâèéëêìíïîòóöôùúüûñç';

View File

@ -8,6 +8,7 @@
*
* @providesModule unindent
*/
'use strict';
// Remove the indentation introduced by JSX
function unindent(code) {

View File

@ -1,11 +1,23 @@
/**
* 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.
*/
'use strict';
exports.defineTags = function(dictionary) {
dictionary.defineTag('value', {
mustHaveValue: true,
canHaveType: true,
canHaveName: true,
onTagged: function(doclet, tag) {
if (!doclet.values) { doclet.values = []; }
doclet.values.push(tag.value);
}
});
dictionary.defineTag('value', {
mustHaveValue: true,
canHaveType: true,
canHaveName: true,
onTagged: function(doclet, tag) {
if (!doclet.values) {
doclet.values = [];
}
doclet.values.push(tag.value);
}
});
};

View File

@ -6,6 +6,7 @@
* 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.
*/
'use strict';
// This Syntax object defines a number of constants that flow-parser uses.
@ -118,4 +119,4 @@ module.exports = {
JSXText: 'JSXText',
YieldExpression: 'YieldExpression',
AwaitExpression: 'AwaitExpression'
}
};

View File

@ -8,14 +8,15 @@
*
* @providesModule DocsLayout
*/
'use strict';
var DocsSidebar = require('DocsSidebar');
var Header = require('Header');
var Footer = require('Footer');
var Header = require('Header');
var Marked = require('Marked');
var Metadata = require('Metadata');
var React = require('React');
var Site = require('Site');
var Metadata = require('Metadata');
var DocsLayout = React.createClass({
childContextTypes: {

View File

@ -8,10 +8,11 @@
*
* @providesModule PageLayout
*/
'use strict';
var Marked = require('Marked');
var React = require('React');
var Site = require('Site');
var Marked = require('Marked');
var support = React.createClass({
childContextTypes: {

View File

@ -8,6 +8,7 @@
*
* @providesModule RedirectLayout
*/
'use strict';
var React = require('React');
@ -20,13 +21,13 @@ var RedirectLayout = React.createClass({
<head>
<meta charSet="utf-8" />
<link rel="canonical" href={ destinationUrl } />
<meta httpEquiv="refresh" content={ "0; url=" + destinationUrl } />
<meta httpEquiv="refresh" content={'0; url=' + destinationUrl} />
<title>Redirecting...</title>
</head>
<body>
<h1>Redirecting...</h1>
<a href={ destinationUrl }>Click here if you are not redirected.</a>
<script dangerouslySetInnerHTML={{__html: `location=` + destinationUrl }} />
<script dangerouslySetInnerHTML={{__html: 'location=' + destinationUrl}} />
</body>
</html>
);

View File

@ -6,6 +6,7 @@
* 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.
*/
'use strict';
var React = require('React');
@ -16,7 +17,7 @@ var fourOhFour = React.createClass({
<head>
<meta httpEquiv="refresh" content="0; /react-native/docs/getting-started.html" />
</head>
<body></body>
<body />
</html>
);
}

View File

@ -6,11 +6,12 @@
* 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.
*/
'use strict';
var Hero = require('Hero');
var Prism = require('Prism');
var React = require('React');
var Site = require('Site');
var Hero = require('Hero');
var apps = [
{
@ -185,7 +186,7 @@ class AwkwardScrollingImageWithText extends Component {
React Native lets you build your app faster. Instead of recompiling, you can reload your app instantly. With hot reloading, you can even run new code while retaining your application state. Give it a try - it's a magical experience.
</p>
<br />
<img src='https://media.giphy.com/media/13WZniThXy0hSE/giphy.gif' />
<img src="https://media.giphy.com/media/13WZniThXy0hSE/giphy.gif" />
<h2>Use Native Code When You Need To</h2>
<p>

View File

@ -1,4 +1,17 @@
(function(){
/**
* Copyright (c) 2013-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.
*/
/* eslint-disable module-strict */
(function() {
'use strict';
// Not on browser
if (typeof document === 'undefined') {
return;
@ -31,7 +44,9 @@
}
var backdrop = document.querySelector('.modal-backdrop');
if (!backdrop) return;
if (!backdrop) {
return;
}
var modalButtonOpenList = document.querySelectorAll('.modal-button-open');
var modalButtonClose = document.querySelector('.modal-button-close');
@ -47,7 +62,9 @@
function showModal(e) {
var backdrop = document.querySelector('.modal-backdrop');
if (!backdrop) return;
if (!backdrop) {
return;
}
var modal = document.querySelector('.modal');
@ -57,7 +74,9 @@
function hideModal(e) {
var backdrop = document.querySelector('.modal-backdrop');
if (!backdrop) return;
if (!backdrop) {
return;
}
var modal = document.querySelector('.modal');

View File

@ -6,11 +6,11 @@
* 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.
*/
'use strict';
var React = require('React');
var Site = require('Site');
/*
Thousands of applications use React Native, so we can't list all of them
in our showcase. To be useful to someone looking through the showcase,
@ -310,7 +310,7 @@ var featured = [
linkAppStore: 'http://apple.co/2dfkYH9',
infoLink: 'https://blog.getchop.io/how-we-built-chop-bae3d8acd131#.7y8buamrq',
infoTitle: 'How we built Chop',
}
}
];
/*
@ -359,7 +359,6 @@ var pinned = [
linkAppStore: 'https://itunes.apple.com/us/app/airbnb/id401626263?mt=8&bev=1472279725_4ITWKWGX6KrmU6pT&utm_medium=web&utm_source=airbnb&_branch_match_id=307510898795870823',
linkPlayStore: 'https://play.google.com/store/apps/details?id=com.airbnb.android&hl=en&referrer=bev%3D1472279725_4ITWKWGX6KrmU6pT%26utm_medium%3Dweb%26utm_source%3Dairbnb',
infoLink: 'https://www.youtube.com/watch?v=tUfgQtmG3R0',
infoTitle: 'Hybrid React Native Apps at Airbnb',
infoTitle: 'Tech Talk: Hybrid React Native Apps at Airbnb',
defaultLink: 'https://www.airbnb.com/mobile',
},
@ -513,7 +512,7 @@ var showcase = React.createClass({
<section className="content wrap documentationContent nosidebar showcaseSection">
<div className="inner-content showcaseHeader">
<h1 style={{textAlign: 'center'}}>Who's using React Native?</h1>
<div className="subHeader"></div>
<div className="subHeader" />
<p>Thousands of apps are using React Native, from established Fortune 500 companies to hot new startups. If you're curious to see what can be accomplished with React Native, check out these apps!</p>
<div className="inner-content">

View File

@ -6,11 +6,10 @@
* 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.
*/
'use strict';
var React = require('React');
var Site = require('Site');
var center = require('center');
var H2 = require('H2');
var support = React.createClass({
childContextTypes: {

View File

@ -6,12 +6,13 @@
* 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.
*/
'use strict';
var Metadata = require('Metadata');
var React = require('React');
var Site = require('Site');
var Metadata = require('Metadata');
var versions = React.createClass({
module.exports = React.createClass({
render: function() {
var availableDocs = (Metadata.config.RN_AVAILABLE_DOCS_VERSIONS || '').split(',');
var latestVersion = Metadata.config.RN_LATEST_VERSION;
@ -37,7 +38,7 @@ var versions = React.createClass({
path: isLatest ? '/react-native' : '/react-native/releases/' + version,
release: 'https://github.com/facebook/react-native/releases/tag/v' + version + '.0' + (isRC ? '-rc.0' : ''),
type: isLatest ? 'latest' : (isRC ? 'release-candidate' : 'release'),
}
};
}));
if (!latestVersion) {
@ -65,7 +66,7 @@ var versions = React.createClass({
});
// Note: Our Algolia DocSearch box supports version-specific queries. If you will be drastically changing the way versions are listed in this page, make sure https://github.com/algolia/docsearch-configs/blob/master/configs/react-native-versions.json is updated accordingly.
return (
<Site section="versions" title="React Native Versions">
<section className="content wrap documentationContent nosidebar">
@ -130,5 +131,3 @@ var versions = React.createClass({
);
}
});
module.exports = versions;