mirror of
https://github.com/facebook/react.git
synced 2025-11-01 09:12:30 +00:00
Add a working RN build
This commit is contained in:
@@ -146,10 +146,17 @@ function getCommonJsConfig(bundleType) {
|
||||
switch (bundleType) {
|
||||
case bundleTypes.PROD:
|
||||
case bundleTypes.DEV:
|
||||
case bundleTypes.NODE:
|
||||
return {};
|
||||
case bundleTypes.NODE: // TODO: why does it share settings with FB?
|
||||
case bundleTypes.RN:
|
||||
return {
|
||||
ignore: [
|
||||
// This imports NativeMethodsMixin, causing
|
||||
// a circular dependency.
|
||||
'View',
|
||||
]
|
||||
};
|
||||
case bundleTypes.FB:
|
||||
case bundleTypes.RN: // TODO: I haven't checked if this is right
|
||||
// Modules we don't want to inline in the bundle.
|
||||
// Force them to stay as require()s in the output.
|
||||
return {
|
||||
|
||||
@@ -0,0 +1,19 @@
|
||||
/**
|
||||
* Copyright 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 ReactNativeComponentTree
|
||||
* @flow
|
||||
*/
|
||||
|
||||
'use strict';
|
||||
|
||||
const {
|
||||
__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED,
|
||||
} = require('ReactNative');
|
||||
|
||||
module.exports = __SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactNativeComponentTree;
|
||||
@@ -0,0 +1,19 @@
|
||||
/**
|
||||
* Copyright 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 ReactPerf
|
||||
* @flow
|
||||
*/
|
||||
|
||||
'use strict';
|
||||
|
||||
const {
|
||||
__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED,
|
||||
} = require('ReactNative');
|
||||
|
||||
module.exports = __SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactPerf;
|
||||
@@ -12,9 +12,20 @@
|
||||
|
||||
'use strict';
|
||||
|
||||
const {
|
||||
__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED,
|
||||
} = require('ReactNative');
|
||||
// While ReactNative renderer bundle is initializing, some
|
||||
// code (e.g. UIManager) imports from ReactNative.
|
||||
|
||||
module.exports = __SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.findNodeHandle;
|
||||
// We use an indirection to avoid a circular dependency.
|
||||
|
||||
let realFindNodeHandle = null;
|
||||
|
||||
function findNodeHandle(componentOrHandle: any): ?number {
|
||||
if (realFindNodeHandle === null) {
|
||||
realFindNodeHandle = require('ReactNative').
|
||||
__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.findNodeHandle;
|
||||
}
|
||||
return realFindNodeHandle(componentOrHandle);
|
||||
}
|
||||
|
||||
module.exports = findNodeHandle;
|
||||
|
||||
@@ -59,7 +59,6 @@ function getInternalModules(bundleType) {
|
||||
};
|
||||
case bundleTypes.NODE:
|
||||
case bundleTypes.FB:
|
||||
case bundleTypes.RN: // TODO: I haven't checked if this is right
|
||||
return {
|
||||
// we tell Rollup where these files are located internally, otherwise
|
||||
// it doesn't pick them up and assumes they're external
|
||||
@@ -69,6 +68,8 @@ function getInternalModules(bundleType) {
|
||||
'react/lib/ReactDebugCurrentFrame': resolve('./src/isomorphic/classic/element/ReactDebugCurrentFrame.js'),
|
||||
'react/lib/ReactComponentTreeHook': resolve('./src/isomorphic/hooks/ReactComponentTreeHook.js'),
|
||||
};
|
||||
case bundleTypes.RN:
|
||||
return {};
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user