mirror of
https://github.com/facebook/react.git
synced 2025-11-01 09:12:30 +00:00
Read renderer ID from operations
This commit is contained in:
@@ -29,11 +29,6 @@ const debug = (methodName, ...args) => {
|
||||
}
|
||||
};
|
||||
|
||||
type OperationsParams = {|
|
||||
operations: Uint32Array,
|
||||
rendererID: number,
|
||||
|};
|
||||
|
||||
type InspectSelectParams = {|
|
||||
id: number,
|
||||
rendererID: number,
|
||||
@@ -505,7 +500,7 @@ export default class Agent extends EventEmitter {
|
||||
}
|
||||
};
|
||||
|
||||
onHookOperations = ({ operations, rendererID }: OperationsParams) => {
|
||||
onHookOperations = (operations: Uint32Array) => {
|
||||
if (__DEBUG__) {
|
||||
debug('onHookOperations', operations);
|
||||
}
|
||||
@@ -533,6 +528,7 @@ export default class Agent extends EventEmitter {
|
||||
this._bridge.send('operations', operations);
|
||||
|
||||
if (this._persistedSelection !== null) {
|
||||
const rendererID = operations[0];
|
||||
if (this._persistedSelection.rendererID === rendererID) {
|
||||
// Check if we can select a deeper match for the persisted selection.
|
||||
const renderer = this._rendererInterfaces[rendererID];
|
||||
|
||||
@@ -686,10 +686,7 @@ export function attach(
|
||||
pendingOperationsQueue.push(ops);
|
||||
} else {
|
||||
// If we've already connected to the frontend, just pass the operations through.
|
||||
hook.emit('operations', {
|
||||
operations: ops,
|
||||
rendererID,
|
||||
});
|
||||
hook.emit('operations', ops);
|
||||
}
|
||||
|
||||
pendingOperations.length = 0;
|
||||
@@ -1155,10 +1152,7 @@ export function attach(
|
||||
// We may have already queued up some operations before the frontend connected
|
||||
// If so, let the frontend know about them.
|
||||
localPendingOperationsQueue.forEach(ops => {
|
||||
hook.emit('operations', {
|
||||
operations: ops,
|
||||
rendererID,
|
||||
});
|
||||
hook.emit('operations', ops);
|
||||
});
|
||||
} else {
|
||||
// Before the traversals, remember to start tracking
|
||||
|
||||
Reference in New Issue
Block a user