mirror of
https://github.com/zhigang1992/react-native.git
synced 2026-04-24 04:16:00 +08:00
Reorganize core JS files
Reviewed By: lexs Differential Revision: D3987463 fbshipit-source-id: fa8f1d1bea7ed699120b9705ddc1c83767fcf8e4
This commit is contained in:
committed by
Facebook Github Bot
parent
d1f8add4d0
commit
292cc82d0e
@@ -24,7 +24,7 @@ type Buttons = Array<{
|
||||
}>;
|
||||
|
||||
type Options = {
|
||||
cancelable?: ?boolean;
|
||||
cancelable?: ?boolean,
|
||||
};
|
||||
|
||||
/**
|
||||
25
Libraries/Alert/RCTAlertManager.android.js
Normal file
25
Libraries/Alert/RCTAlertManager.android.js
Normal file
@@ -0,0 +1,25 @@
|
||||
/**
|
||||
* 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.
|
||||
*
|
||||
* @providesModule RCTAlertManager
|
||||
*/
|
||||
'use strict';
|
||||
|
||||
var DialogManager = require('NativeModules').DialogManagerAndroid;
|
||||
|
||||
function emptyCallback() {}
|
||||
|
||||
module.exports = {
|
||||
alertWithArgs: function(args, callback) {
|
||||
// TODO(5998984): Polyfill it correctly with DialogManagerAndroid
|
||||
DialogManager.showAlert(
|
||||
args,
|
||||
emptyCallback,
|
||||
callback || emptyCallback);
|
||||
},
|
||||
};
|
||||
@@ -11,8 +11,8 @@
|
||||
*/
|
||||
'use strict';
|
||||
|
||||
var Platform = require('Platform');
|
||||
var NativeModules = require('NativeModules');
|
||||
var Platform = require('Platform');
|
||||
|
||||
function setupDevtools() {
|
||||
var messageListeners = [];
|
||||
@@ -11,9 +11,10 @@
|
||||
*/
|
||||
'use strict';
|
||||
|
||||
const {fetch} = require('fetch');
|
||||
const getDevServer = require('getDevServer');
|
||||
|
||||
const {SourceCode} = require('NativeModules');
|
||||
const {fetch} = require('fetch');
|
||||
|
||||
import type {StackFrame} from 'parseErrorStack';
|
||||
|
||||
@@ -16,7 +16,7 @@
|
||||
* 1. Require system.
|
||||
* 2. Bridged modules.
|
||||
*
|
||||
* @providesModule InitializeJavaScriptAppEngine
|
||||
* @providesModule InitializeCore
|
||||
* @flow
|
||||
*/
|
||||
|
||||
@@ -1,3 +1,12 @@
|
||||
/**
|
||||
* 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.
|
||||
*/
|
||||
|
||||
// This mock only provides short-circuited methods of applyWithGuard and guard.
|
||||
// A lot of modules rely on these two functions. This mock relieves their tests
|
||||
// from depending on the real ErrorUtils module. If you need real error handling
|
||||
@@ -1,79 +0,0 @@
|
||||
/**
|
||||
* 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.
|
||||
*
|
||||
* This is a third-party micro-library grabbed from:
|
||||
* https://github.com/lydell/source-map-url
|
||||
*
|
||||
* @nolint
|
||||
*/
|
||||
/* eslint-disable */
|
||||
|
||||
(function() {
|
||||
var define = null; // Hack to make it work with our packager
|
||||
|
||||
// Copyright 2014 Simon Lydell
|
||||
// X11 ("MIT") Licensed. (See LICENSE.)
|
||||
|
||||
void (function(root, factory) {
|
||||
if (typeof define === "function" && define.amd) {
|
||||
define(factory)
|
||||
} else if (typeof exports === "object") {
|
||||
module.exports = factory()
|
||||
} else {
|
||||
root.sourceMappingURL = factory()
|
||||
}
|
||||
}(this, function() {
|
||||
|
||||
var innerRegex = /[#@] source(?:Mapping)?URL=([^\s'"]*)/
|
||||
|
||||
var regex = RegExp(
|
||||
"(?:" +
|
||||
"/\\*" +
|
||||
"(?:\\s*\r?\n(?://)?)?" +
|
||||
"(?:" + innerRegex.source + ")" +
|
||||
"\\s*" +
|
||||
"\\*/" +
|
||||
"|" +
|
||||
"//(?:" + innerRegex.source + ")" +
|
||||
")" +
|
||||
"\\s*$"
|
||||
)
|
||||
|
||||
return {
|
||||
|
||||
regex: regex,
|
||||
_innerRegex: innerRegex,
|
||||
|
||||
getFrom: function(code) {
|
||||
var match = code.match(regex)
|
||||
return (match ? match[1] || match[2] || "" : null)
|
||||
},
|
||||
|
||||
existsIn: function(code) {
|
||||
return regex.test(code)
|
||||
},
|
||||
|
||||
removeFrom: function(code) {
|
||||
return code.replace(regex, "")
|
||||
},
|
||||
|
||||
insertBefore: function(code, string) {
|
||||
var match = code.match(regex)
|
||||
if (match) {
|
||||
return code.slice(0, match.index) + string + code.slice(match.index)
|
||||
} else {
|
||||
return code + string
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}));
|
||||
|
||||
/** End of the third-party code */
|
||||
|
||||
})();
|
||||
@@ -11,8 +11,8 @@
|
||||
*/
|
||||
'use strict';
|
||||
|
||||
var ReactPerf = require('react/lib/ReactPerf');
|
||||
var ReactDebugTool = require('react/lib/ReactDebugTool');
|
||||
var ReactPerf = require('react/lib/ReactPerf');
|
||||
|
||||
var invariant = require('fbjs/lib/invariant');
|
||||
var performanceNow = require('fbjs/lib/performanceNow');
|
||||
@@ -15,8 +15,8 @@
|
||||
var RCTDeviceEventEmitter = require('RCTDeviceEventEmitter');
|
||||
var React = require('React');
|
||||
var ReactNative = require('react/lib/ReactNative');
|
||||
var Subscribable = require('Subscribable');
|
||||
var StyleSheet = require('StyleSheet');
|
||||
var Subscribable = require('Subscribable');
|
||||
var View = require('View');
|
||||
|
||||
var Inspector = __DEV__ ? require('Inspector') : null;
|
||||
@@ -16,10 +16,9 @@ var UIManager = require('UIManager');
|
||||
var UnimplementedView = require('UnimplementedView');
|
||||
|
||||
var createReactNativeComponentClass = require('react/lib/createReactNativeComponentClass');
|
||||
|
||||
var insetsDiffer = require('insetsDiffer');
|
||||
var pointsDiffer = require('pointsDiffer');
|
||||
var matricesDiffer = require('matricesDiffer');
|
||||
var pointsDiffer = require('pointsDiffer');
|
||||
var processColor = require('processColor');
|
||||
var resolveAssetSource = require('resolveAssetSource');
|
||||
var sizesDiffer = require('sizesDiffer');
|
||||
@@ -12,6 +12,7 @@
|
||||
|
||||
const RCTWebSocketModule = require('NativeModules').WebSocketModule;
|
||||
const NativeEventEmitter = require('NativeEventEmitter');
|
||||
|
||||
const base64 = require('base64-js');
|
||||
|
||||
const originalRCTWebSocketConnect = RCTWebSocketModule.connect;
|
||||
Reference in New Issue
Block a user