Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion Libraries/Components/Touchable/BoundingDimensions.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@

'use strict';

var PooledClass = require('react/lib/PooledClass');
var PooledClass = require('PooledClass');

var twoArgumentPooler = PooledClass.twoArgumentPooler;

Expand Down
2 changes: 1 addition & 1 deletion Libraries/Components/Touchable/Position.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@

'use strict';

var PooledClass = require('react/lib/PooledClass');
var PooledClass = require('PooledClass');

var twoArgumentPooler = PooledClass.twoArgumentPooler;

Expand Down
1 change: 0 additions & 1 deletion Libraries/Image/Image.android.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@ var ImageResizeMode = require('ImageResizeMode');
var ImageStylePropTypes = require('ImageStylePropTypes');
var NativeMethodsMixin = require('NativeMethodsMixin');
var NativeModules = require('NativeModules');
var PropTypes = require('react/lib/ReactPropTypes');
var React = require('React');
var ReactNativeViewAttributes = require('ReactNativeViewAttributes');
var Set = require('Set');
Expand Down
12 changes: 8 additions & 4 deletions Libraries/Performance/Systrace.js
Original file line number Diff line number Diff line change
Expand Up @@ -32,28 +32,32 @@ let _asyncCookie = 0;

const ReactSystraceDevtool = __DEV__ ? {
onBeforeMountComponent(debugID) {
const displayName = require('react/lib/ReactComponentTreeHook').getDisplayName(debugID);
const ReactComponentTreeHook = require('ReactGlobalSharedState').ReactComponentTreeHook;
const displayName = ReactComponentTreeHook.getDisplayName(debugID);
Systrace.beginEvent(`ReactReconciler.mountComponent(${displayName})`);
},
onMountComponent(debugID) {
Systrace.endEvent();
},
onBeforeUpdateComponent(debugID) {
const displayName = require('react/lib/ReactComponentTreeHook').getDisplayName(debugID);
const ReactComponentTreeHook = require('ReactGlobalSharedState').ReactComponentTreeHook;
const displayName = ReactComponentTreeHook.getDisplayName(debugID);
Systrace.beginEvent(`ReactReconciler.updateComponent(${displayName})`);
},
onUpdateComponent(debugID) {
Systrace.endEvent();
},
onBeforeUnmountComponent(debugID) {
const displayName = require('react/lib/ReactComponentTreeHook').getDisplayName(debugID);
const ReactComponentTreeHook = require('ReactGlobalSharedState').ReactComponentTreeHook;
const displayName = ReactComponentTreeHook.getDisplayName(debugID);
Systrace.beginEvent(`ReactReconciler.unmountComponent(${displayName})`);
},
onUnmountComponent(debugID) {
Systrace.endEvent();
},
onBeginLifeCycleTimer(debugID, timerType) {
const displayName = require('react/lib/ReactComponentTreeHook').getDisplayName(debugID);
const ReactComponentTreeHook = require('ReactGlobalSharedState').ReactComponentTreeHook;
const displayName = ReactComponentTreeHook.getDisplayName(debugID);
Systrace.beginEvent(`${displayName}.${timerType}()`);
},
onEndLifeCycleTimer(debugID, timerType) {
Expand Down
2 changes: 1 addition & 1 deletion Libraries/Renderer/src/ReactVersion.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,4 +11,4 @@

'use strict';

module.exports = '16.0.0-alpha.6';
module.exports = '16.0.0-alpha.8';
13 changes: 2 additions & 11 deletions Libraries/Renderer/src/renderers/native/ReactNativeFiber.js
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,6 @@ const deepFreezeAndThrowOnMutationInDev = require('deepFreezeAndThrowOnMutationI
const emptyObject = require('fbjs/lib/emptyObject');
const findNodeHandle = require('findNodeHandle');
const invariant = require('fbjs/lib/invariant');
const takeSnapshot = require('takeSnapshot');

const {injectInternals} = require('ReactFiberDevToolsHook');

Expand Down Expand Up @@ -72,10 +71,7 @@ const NativeRenderer = ReactFiberReconciler({
parentInstance: Instance | Container,
child: Instance | TextInstance,
): void {

const childTag = typeof child === 'number'
? child
: child._nativeTag;
const childTag = typeof child === 'number' ? child : child._nativeTag;

if (typeof parentInstance === 'number') {
// Root container
Expand Down Expand Up @@ -287,9 +283,7 @@ const NativeRenderer = ReactFiberReconciler({
} else {
children.splice(beforeChildIndex, 0, child);

const childTag = typeof child === 'number'
? child
: child._nativeTag;
const childTag = typeof child === 'number' ? child : child._nativeTag;

UIManager.manageChildren(
(parentInstance: any)._nativeTag, // containerID
Expand Down Expand Up @@ -388,7 +382,6 @@ findNodeHandle.injection.injectFindNode((fiber: Fiber) =>
NativeRenderer.findHostInstance(fiber));
findNodeHandle.injection.injectFindRootNodeID(instance => instance);


// Intercept lifecycle errors and ensure they are shown with the correct stack
// trace within the native redbox component.
ReactFiberErrorLogger.injection.injectDialog(
Expand Down Expand Up @@ -421,8 +414,6 @@ const ReactNative = {
return NativeRenderer.getPublicRootInstance(root);
},

takeSnapshot,

unmountComponentAtNode(containerTag: number) {
const root = roots.get(containerTag);
if (root) {
Expand Down
3 changes: 0 additions & 3 deletions Libraries/Renderer/src/renderers/native/ReactNativeStack.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@ var ReactNativeStackInjection = require('ReactNativeStackInjection');
var ReactUpdates = require('ReactUpdates');

var findNodeHandle = require('findNodeHandle');
var takeSnapshot = require('takeSnapshot');

ReactNativeInjection.inject();
ReactNativeStackInjection.inject();
Expand Down Expand Up @@ -47,8 +46,6 @@ var ReactNative = {

render: render,

takeSnapshot,

unmountComponentAtNode: ReactNativeMount.unmountComponentAtNode,

/* eslint-disable camelcase */
Expand Down
2 changes: 1 addition & 1 deletion Libraries/Renderer/src/renderers/native/findNodeHandle.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@

'use strict';

var ReactCurrentOwner = require('react/lib/ReactCurrentOwner');
var ReactInstanceMap = require('ReactInstanceMap');
var {ReactCurrentOwner} = require('ReactGlobalSharedState');

var invariant = require('fbjs/lib/invariant');
var warning = require('fbjs/lib/warning');
Expand Down
25 changes: 12 additions & 13 deletions Libraries/Renderer/src/renderers/native/takeSnapshot.js
Original file line number Diff line number Diff line change
Expand Up @@ -33,23 +33,22 @@ import type {Element} from 'React';
* Returns a Promise.
* @platform ios
*/
module.exports = async function takeSnapshot(
view ?: 'window' | Element<any> | number,
options ?: {
width ?: number,
height ?: number,
format ?: 'png' | 'jpeg',
quality ?: number,
function takeSnapshot(
view?: 'window' | Element<any> | number,
options?: {
width?: number,
height?: number,
format?: 'png' | 'jpeg',
quality?: number,
},
) {
if (
typeof view !== 'number' &&
view !== 'window'
) {
): Promise<any> {
if (typeof view !== 'number' && view !== 'window') {
view = ReactNative.findNodeHandle(view) || 'window';
}

// Call the hidden '__takeSnapshot' method; the main one throws an error to
// prevent accidental backwards-incompatible usage.
return UIManager.__takeSnapshot(view, options);
};
}

module.exports = takeSnapshot;
Loading