Summary:
This brings RN up to date with https://github.com/facebook/react/pull/7472 (scheduled for React 15.3.1).
If you use React 15.3.1 with RN without this patch, Systrace output will lack the reconciler events.

(Since it’s a niche feature it didn’t seem to me that full backward compat is necessary so I just removed old hooks. This won’t cause crashes—it’s just you won’t get events in Systrace if you use new React but old RN.)
Closes https://github.com/facebook/react-native/pull/9383

Differential Revision: D3738463

Pulled By: spicyj

fbshipit-source-id: 791cdbc5558666a101fa403f4e7852f700038fc9
This commit is contained in:
Dan Abramov 2016-08-18 15:46:02 -07:00 коммит произвёл Facebook Github Bot 5
Родитель aacfc372c9
Коммит 1aef7e4629
1 изменённых файлов: 17 добавлений и 3 удалений

Просмотреть файл

@ -31,11 +31,25 @@ let _enabled = false;
let _asyncCookie = 0; let _asyncCookie = 0;
const ReactSystraceDevtool = __DEV__ ? { const ReactSystraceDevtool = __DEV__ ? {
onBeginReconcilerTimer(debugID, timerType) { onBeforeMountComponent(debugID) {
const displayName = require('react/lib/ReactComponentTreeDevtool').getDisplayName(debugID); const displayName = require('react/lib/ReactComponentTreeDevtool').getDisplayName(debugID);
Systrace.beginEvent(`ReactReconciler.${timerType}(${displayName})`); Systrace.beginEvent(`ReactReconciler.mountComponent(${displayName})`);
}, },
onEndReconcilerTimer(debugID, timerType) { onMountComponent(debugID) {
Systrace.endEvent();
},
onBeforeUpdateComponent(debugID) {
const displayName = require('react/lib/ReactComponentTreeDevtool').getDisplayName(debugID);
Systrace.beginEvent(`ReactReconciler.updateComponent(${displayName})`);
},
onUpdateComponent(debugID) {
Systrace.endEvent();
},
onBeforeUnmountComponent(debugID) {
const displayName = require('react/lib/ReactComponentTreeDevtool').getDisplayName(debugID);
Systrace.beginEvent(`ReactReconciler.unmountComponent(${displayName})`);
},
onUnmountComponent(debugID) {
Systrace.endEvent(); Systrace.endEvent();
}, },
onBeginLifeCycleTimer(debugID, timerType) { onBeginLifeCycleTimer(debugID, timerType) {