mirror of
https://github.com/facebook/react.git
synced 2025-11-01 09:12:30 +00:00
Clean interface for public instances between React and React Native (#26416)
## Summary We are going to move the definition of public instances from React to React Native to have them together with the native methods in Fabric that they invoke. This will allow us to have a better type safety between them and iterate faster on the implementation of this proposal: https://github.com/react-native-community/discussions-and-proposals/pull/607 The interface between React and React Native would look like this after this change and a following PR (#26418): React → React Native: ```javascript ReactNativePrivateInterface.createPublicInstance // to provide via refs ReactNativePrivateInterface.getNodeFromPublicInstance // for DevTools, commands, etc. ReactNativePrivateInterface.getNativeTagFromPublicInstance // to implement `findNodeHandle` ``` React Native → React (ReactFabric): ```javascript ReactFabric.getNodeFromInternalInstanceHandle // to get most recent node to call into native ReactFabric.getPublicInstanceFromInternalInstanceHandle // to get public instances from results from native ``` ## How did you test this change? Flow Existing unit tests DiffTrain build for commit https://github.com/facebook/react/commit/3554c8852fe209ad02380ebd24d32f56d6399906.
This commit is contained in:
+1
-1
@@ -23499,7 +23499,7 @@ function createFiberRoot(
|
||||
return root;
|
||||
}
|
||||
|
||||
var ReactVersion = "18.3.0-next-c57b90f50-20230320";
|
||||
var ReactVersion = "18.3.0-next-3554c8852-20230320";
|
||||
|
||||
// Might add PROFILE later.
|
||||
|
||||
|
||||
+2
-2
@@ -8526,7 +8526,7 @@ var devToolsConfig$jscomp$inline_1010 = {
|
||||
throw Error("TestRenderer does not support findFiberByHostInstance()");
|
||||
},
|
||||
bundleType: 0,
|
||||
version: "18.3.0-next-c57b90f50-20230320",
|
||||
version: "18.3.0-next-3554c8852-20230320",
|
||||
rendererPackageName: "react-test-renderer"
|
||||
};
|
||||
var internals$jscomp$inline_1202 = {
|
||||
@@ -8557,7 +8557,7 @@ var internals$jscomp$inline_1202 = {
|
||||
scheduleRoot: null,
|
||||
setRefreshHandler: null,
|
||||
getCurrentFiber: null,
|
||||
reconcilerVersion: "18.3.0-next-c57b90f50-20230320"
|
||||
reconcilerVersion: "18.3.0-next-3554c8852-20230320"
|
||||
};
|
||||
if ("undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__) {
|
||||
var hook$jscomp$inline_1203 = __REACT_DEVTOOLS_GLOBAL_HOOK__;
|
||||
|
||||
+2
-2
@@ -8953,7 +8953,7 @@ var devToolsConfig$jscomp$inline_1051 = {
|
||||
throw Error("TestRenderer does not support findFiberByHostInstance()");
|
||||
},
|
||||
bundleType: 0,
|
||||
version: "18.3.0-next-c57b90f50-20230320",
|
||||
version: "18.3.0-next-3554c8852-20230320",
|
||||
rendererPackageName: "react-test-renderer"
|
||||
};
|
||||
var internals$jscomp$inline_1241 = {
|
||||
@@ -8984,7 +8984,7 @@ var internals$jscomp$inline_1241 = {
|
||||
scheduleRoot: null,
|
||||
setRefreshHandler: null,
|
||||
getCurrentFiber: null,
|
||||
reconcilerVersion: "18.3.0-next-c57b90f50-20230320"
|
||||
reconcilerVersion: "18.3.0-next-3554c8852-20230320"
|
||||
};
|
||||
if ("undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__) {
|
||||
var hook$jscomp$inline_1242 = __REACT_DEVTOOLS_GLOBAL_HOOK__;
|
||||
|
||||
+1
-1
@@ -27,7 +27,7 @@ if (
|
||||
}
|
||||
"use strict";
|
||||
|
||||
var ReactVersion = "18.3.0-next-c57b90f50-20230320";
|
||||
var ReactVersion = "18.3.0-next-3554c8852-20230320";
|
||||
|
||||
// ATTENTION
|
||||
// When adding new symbols to this file,
|
||||
|
||||
+1
-1
@@ -639,4 +639,4 @@ exports.useSyncExternalStore = function (
|
||||
);
|
||||
};
|
||||
exports.useTransition = useTransition;
|
||||
exports.version = "18.3.0-next-c57b90f50-20230320";
|
||||
exports.version = "18.3.0-next-3554c8852-20230320";
|
||||
|
||||
+1
-1
@@ -642,7 +642,7 @@ exports.useSyncExternalStore = function (
|
||||
);
|
||||
};
|
||||
exports.useTransition = useTransition;
|
||||
exports.version = "18.3.0-next-c57b90f50-20230320";
|
||||
exports.version = "18.3.0-next-3554c8852-20230320";
|
||||
|
||||
/* global __REACT_DEVTOOLS_GLOBAL_HOOK__ */
|
||||
if (
|
||||
|
||||
+23
-25
@@ -26257,7 +26257,7 @@ function createFiberRoot(
|
||||
return root;
|
||||
}
|
||||
|
||||
var ReactVersion = "18.3.0-next-c57b90f50-20230320";
|
||||
var ReactVersion = "18.3.0-next-3554c8852-20230320";
|
||||
|
||||
function createPortal$1(
|
||||
children,
|
||||
@@ -26792,11 +26792,18 @@ function injectIntoDevTools(devToolsConfig) {
|
||||
* `nativeFabricUIManager` to be defined in the global scope (which does not
|
||||
* happen in Paper).
|
||||
*/
|
||||
|
||||
function getNativeTagFromPublicInstance(publicInstance) {
|
||||
return publicInstance.__nativeTag;
|
||||
}
|
||||
function getInternalInstanceHandleFromPublicInstance(publicInstance) {
|
||||
return publicInstance.__internalInstanceHandle;
|
||||
function getNodeFromPublicInstance(publicInstance) {
|
||||
if (publicInstance.__internalInstanceHandle == null) {
|
||||
return null;
|
||||
}
|
||||
|
||||
return getNodeFromInternalInstanceHandle(
|
||||
publicInstance.__internalInstanceHandle
|
||||
);
|
||||
}
|
||||
|
||||
var ReactCurrentOwner = ReactSharedInternals.ReactCurrentOwner;
|
||||
@@ -26933,15 +26940,10 @@ function dispatchCommand(handle, command, args) {
|
||||
return;
|
||||
}
|
||||
|
||||
var internalInstanceHandle =
|
||||
getInternalInstanceHandleFromPublicInstance(handle);
|
||||
var node = getNodeFromPublicInstance(handle);
|
||||
|
||||
if (internalInstanceHandle != null) {
|
||||
var node = getNodeFromInternalInstanceHandle(internalInstanceHandle);
|
||||
|
||||
if (node != null) {
|
||||
nativeFabricUIManager.dispatchCommand(node, command, args);
|
||||
}
|
||||
if (node != null) {
|
||||
nativeFabricUIManager.dispatchCommand(node, command, args);
|
||||
} else {
|
||||
ReactNativePrivateInterface.UIManager.dispatchViewManagerCommand(
|
||||
nativeTag,
|
||||
@@ -26967,15 +26969,10 @@ function sendAccessibilityEvent(handle, eventType) {
|
||||
return;
|
||||
}
|
||||
|
||||
var internalInstanceHandle =
|
||||
getInternalInstanceHandleFromPublicInstance(handle);
|
||||
var node = getNodeFromPublicInstance(handle);
|
||||
|
||||
if (internalInstanceHandle != null) {
|
||||
var node = getNodeFromInternalInstanceHandle(internalInstanceHandle);
|
||||
|
||||
if (node != null) {
|
||||
nativeFabricUIManager.sendAccessibilityEvent(node, eventType);
|
||||
}
|
||||
if (node != null) {
|
||||
nativeFabricUIManager.sendAccessibilityEvent(node, eventType);
|
||||
} else {
|
||||
ReactNativePrivateInterface.legacySendAccessibilityEvent(
|
||||
nativeTag,
|
||||
@@ -27466,6 +27463,10 @@ function getPublicInstance(instance) {
|
||||
|
||||
return null;
|
||||
}
|
||||
function getPublicInstanceFromInternalInstanceHandle(internalInstanceHandle) {
|
||||
var instance = internalInstanceHandle.stateNode;
|
||||
return getPublicInstance(instance);
|
||||
}
|
||||
function prepareUpdate(instance, type, oldProps, newProps, hostContext) {
|
||||
var viewConfig = instance.canonical.viewConfig;
|
||||
var updatePayload = diff(oldProps, newProps, viewConfig.validAttributes); // TODO: If the event handlers have changed, we need to update the current props
|
||||
@@ -27803,12 +27804,7 @@ function getInspectorDataForViewAtPoint(
|
||||
) {
|
||||
{
|
||||
var closestInstance = null;
|
||||
var fabricInstanceHandle =
|
||||
getInternalInstanceHandleFromPublicInstance(inspectedView);
|
||||
var fabricNode =
|
||||
fabricInstanceHandle != null
|
||||
? getNodeFromInternalInstanceHandle(fabricInstanceHandle)
|
||||
: null;
|
||||
var fabricNode = getNodeFromPublicInstance(inspectedView);
|
||||
|
||||
if (fabricNode) {
|
||||
// For Fabric we can look up the instance handle directly and measure it.
|
||||
@@ -27971,6 +27967,8 @@ exports.findHostInstance_DEPRECATED = findHostInstance_DEPRECATED;
|
||||
exports.findNodeHandle = findNodeHandle;
|
||||
exports.getInspectorDataForInstance = getInspectorDataForInstance;
|
||||
exports.getNodeFromInternalInstanceHandle = getNodeFromInternalInstanceHandle;
|
||||
exports.getPublicInstanceFromInternalInstanceHandle =
|
||||
getPublicInstanceFromInternalInstanceHandle;
|
||||
exports.render = render;
|
||||
exports.sendAccessibilityEvent = sendAccessibilityEvent;
|
||||
exports.stopSurface = stopSurface;
|
||||
|
||||
+17
-10
@@ -9461,7 +9461,7 @@ var roots = new Map(),
|
||||
devToolsConfig$jscomp$inline_1030 = {
|
||||
findFiberByHostInstance: getInstanceFromNode,
|
||||
bundleType: 0,
|
||||
version: "18.3.0-next-c57b90f50-20230320",
|
||||
version: "18.3.0-next-3554c8852-20230320",
|
||||
rendererPackageName: "react-native-renderer",
|
||||
rendererConfig: {
|
||||
getInspectorDataForViewTag: function () {
|
||||
@@ -9503,7 +9503,7 @@ var internals$jscomp$inline_1277 = {
|
||||
scheduleRoot: null,
|
||||
setRefreshHandler: null,
|
||||
getCurrentFiber: null,
|
||||
reconcilerVersion: "18.3.0-next-c57b90f50-20230320"
|
||||
reconcilerVersion: "18.3.0-next-3554c8852-20230320"
|
||||
};
|
||||
if ("undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__) {
|
||||
var hook$jscomp$inline_1278 = __REACT_DEVTOOLS_GLOBAL_HOOK__;
|
||||
@@ -9530,11 +9530,12 @@ exports.dispatchCommand = function (handle, command, args) {
|
||||
var nativeTag =
|
||||
null != handle._nativeTag ? handle._nativeTag : handle.__nativeTag;
|
||||
null != nativeTag &&
|
||||
((handle = handle.__internalInstanceHandle),
|
||||
((handle =
|
||||
null == handle.__internalInstanceHandle
|
||||
? null
|
||||
: getNodeFromInternalInstanceHandle(handle.__internalInstanceHandle)),
|
||||
null != handle
|
||||
? ((nativeTag = getNodeFromInternalInstanceHandle(handle)),
|
||||
null != nativeTag &&
|
||||
nativeFabricUIManager.dispatchCommand(nativeTag, command, args))
|
||||
? nativeFabricUIManager.dispatchCommand(handle, command, args)
|
||||
: ReactNativePrivateInterface.UIManager.dispatchViewManagerCommand(
|
||||
nativeTag,
|
||||
command,
|
||||
@@ -9585,6 +9586,11 @@ exports.getInspectorDataForInstance = function (closestInstance) {
|
||||
};
|
||||
};
|
||||
exports.getNodeFromInternalInstanceHandle = getNodeFromInternalInstanceHandle;
|
||||
exports.getPublicInstanceFromInternalInstanceHandle = function (
|
||||
internalInstanceHandle
|
||||
) {
|
||||
return getPublicInstance(internalInstanceHandle.stateNode);
|
||||
};
|
||||
exports.render = function (element, containerTag, callback, concurrentRoot) {
|
||||
var root = roots.get(containerTag);
|
||||
root ||
|
||||
@@ -9620,11 +9626,12 @@ exports.sendAccessibilityEvent = function (handle, eventType) {
|
||||
var nativeTag =
|
||||
null != handle._nativeTag ? handle._nativeTag : handle.__nativeTag;
|
||||
null != nativeTag &&
|
||||
((handle = handle.__internalInstanceHandle),
|
||||
((handle =
|
||||
null == handle.__internalInstanceHandle
|
||||
? null
|
||||
: getNodeFromInternalInstanceHandle(handle.__internalInstanceHandle)),
|
||||
null != handle
|
||||
? ((nativeTag = getNodeFromInternalInstanceHandle(handle)),
|
||||
null != nativeTag &&
|
||||
nativeFabricUIManager.sendAccessibilityEvent(nativeTag, eventType))
|
||||
? nativeFabricUIManager.sendAccessibilityEvent(handle, eventType)
|
||||
: ReactNativePrivateInterface.legacySendAccessibilityEvent(
|
||||
nativeTag,
|
||||
eventType
|
||||
|
||||
+17
-10
@@ -10171,7 +10171,7 @@ var roots = new Map(),
|
||||
devToolsConfig$jscomp$inline_1107 = {
|
||||
findFiberByHostInstance: getInstanceFromNode,
|
||||
bundleType: 0,
|
||||
version: "18.3.0-next-c57b90f50-20230320",
|
||||
version: "18.3.0-next-3554c8852-20230320",
|
||||
rendererPackageName: "react-native-renderer",
|
||||
rendererConfig: {
|
||||
getInspectorDataForViewTag: function () {
|
||||
@@ -10226,7 +10226,7 @@ var roots = new Map(),
|
||||
scheduleRoot: null,
|
||||
setRefreshHandler: null,
|
||||
getCurrentFiber: null,
|
||||
reconcilerVersion: "18.3.0-next-c57b90f50-20230320"
|
||||
reconcilerVersion: "18.3.0-next-3554c8852-20230320"
|
||||
});
|
||||
exports.createPortal = function (children, containerTag) {
|
||||
return createPortal$1(
|
||||
@@ -10240,11 +10240,12 @@ exports.dispatchCommand = function (handle, command, args) {
|
||||
var nativeTag =
|
||||
null != handle._nativeTag ? handle._nativeTag : handle.__nativeTag;
|
||||
null != nativeTag &&
|
||||
((handle = handle.__internalInstanceHandle),
|
||||
((handle =
|
||||
null == handle.__internalInstanceHandle
|
||||
? null
|
||||
: getNodeFromInternalInstanceHandle(handle.__internalInstanceHandle)),
|
||||
null != handle
|
||||
? ((nativeTag = getNodeFromInternalInstanceHandle(handle)),
|
||||
null != nativeTag &&
|
||||
nativeFabricUIManager.dispatchCommand(nativeTag, command, args))
|
||||
? nativeFabricUIManager.dispatchCommand(handle, command, args)
|
||||
: ReactNativePrivateInterface.UIManager.dispatchViewManagerCommand(
|
||||
nativeTag,
|
||||
command,
|
||||
@@ -10295,6 +10296,11 @@ exports.getInspectorDataForInstance = function (closestInstance) {
|
||||
};
|
||||
};
|
||||
exports.getNodeFromInternalInstanceHandle = getNodeFromInternalInstanceHandle;
|
||||
exports.getPublicInstanceFromInternalInstanceHandle = function (
|
||||
internalInstanceHandle
|
||||
) {
|
||||
return getPublicInstance(internalInstanceHandle.stateNode);
|
||||
};
|
||||
exports.render = function (element, containerTag, callback, concurrentRoot) {
|
||||
var root = roots.get(containerTag);
|
||||
root ||
|
||||
@@ -10332,11 +10338,12 @@ exports.sendAccessibilityEvent = function (handle, eventType) {
|
||||
var nativeTag =
|
||||
null != handle._nativeTag ? handle._nativeTag : handle.__nativeTag;
|
||||
null != nativeTag &&
|
||||
((handle = handle.__internalInstanceHandle),
|
||||
((handle =
|
||||
null == handle.__internalInstanceHandle
|
||||
? null
|
||||
: getNodeFromInternalInstanceHandle(handle.__internalInstanceHandle)),
|
||||
null != handle
|
||||
? ((nativeTag = getNodeFromInternalInstanceHandle(handle)),
|
||||
null != nativeTag &&
|
||||
nativeFabricUIManager.sendAccessibilityEvent(nativeTag, eventType))
|
||||
? nativeFabricUIManager.sendAccessibilityEvent(handle, eventType)
|
||||
: ReactNativePrivateInterface.legacySendAccessibilityEvent(
|
||||
nativeTag,
|
||||
eventType
|
||||
|
||||
+28
-36
@@ -27304,7 +27304,7 @@ function createFiberRoot(
|
||||
return root;
|
||||
}
|
||||
|
||||
var ReactVersion = "18.3.0-next-c57b90f50-20230320";
|
||||
var ReactVersion = "18.3.0-next-3554c8852-20230320";
|
||||
|
||||
function createPortal$1(
|
||||
children,
|
||||
@@ -27833,19 +27833,6 @@ function injectIntoDevTools(devToolsConfig) {
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* IMPORTANT: This module is used in Paper and Fabric. It needs to be defined
|
||||
* outside of `ReactFabricPublicInstance` because that module requires
|
||||
* `nativeFabricUIManager` to be defined in the global scope (which does not
|
||||
* happen in Paper).
|
||||
*/
|
||||
function getNativeTagFromPublicInstance(publicInstance) {
|
||||
return publicInstance.__nativeTag;
|
||||
}
|
||||
function getInternalInstanceHandleFromPublicInstance(publicInstance) {
|
||||
return publicInstance.__internalInstanceHandle;
|
||||
}
|
||||
|
||||
var ReactCurrentOwner = ReactSharedInternals.ReactCurrentOwner;
|
||||
function findHostInstance_DEPRECATED(componentOrHandle) {
|
||||
{
|
||||
@@ -27980,15 +27967,10 @@ function dispatchCommand(handle, command, args) {
|
||||
return;
|
||||
}
|
||||
|
||||
var internalInstanceHandle =
|
||||
getInternalInstanceHandleFromPublicInstance(handle);
|
||||
var node = getNodeFromPublicInstance(handle);
|
||||
|
||||
if (internalInstanceHandle != null) {
|
||||
var node = getNodeFromInternalInstanceHandle(internalInstanceHandle);
|
||||
|
||||
if (node != null) {
|
||||
nativeFabricUIManager.dispatchCommand(node, command, args);
|
||||
}
|
||||
if (node != null) {
|
||||
nativeFabricUIManager.dispatchCommand(node, command, args);
|
||||
} else {
|
||||
ReactNativePrivateInterface.UIManager.dispatchViewManagerCommand(
|
||||
nativeTag,
|
||||
@@ -28014,15 +27996,10 @@ function sendAccessibilityEvent(handle, eventType) {
|
||||
return;
|
||||
}
|
||||
|
||||
var internalInstanceHandle =
|
||||
getInternalInstanceHandleFromPublicInstance(handle);
|
||||
var node = getNodeFromPublicInstance(handle);
|
||||
|
||||
if (internalInstanceHandle != null) {
|
||||
var node = getNodeFromInternalInstanceHandle(internalInstanceHandle);
|
||||
|
||||
if (node != null) {
|
||||
nativeFabricUIManager.sendAccessibilityEvent(node, eventType);
|
||||
}
|
||||
if (node != null) {
|
||||
nativeFabricUIManager.sendAccessibilityEvent(node, eventType);
|
||||
} else {
|
||||
ReactNativePrivateInterface.legacySendAccessibilityEvent(
|
||||
nativeTag,
|
||||
@@ -28039,6 +28016,26 @@ function getNodeFromInternalInstanceHandle(internalInstanceHandle) {
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* IMPORTANT: This module is used in Paper and Fabric. It needs to be defined
|
||||
* outside of `ReactFabricPublicInstance` because that module requires
|
||||
* `nativeFabricUIManager` to be defined in the global scope (which does not
|
||||
* happen in Paper).
|
||||
*/
|
||||
|
||||
function getNativeTagFromPublicInstance(publicInstance) {
|
||||
return publicInstance.__nativeTag;
|
||||
}
|
||||
function getNodeFromPublicInstance(publicInstance) {
|
||||
if (publicInstance.__internalInstanceHandle == null) {
|
||||
return null;
|
||||
}
|
||||
|
||||
return getNodeFromInternalInstanceHandle(
|
||||
publicInstance.__internalInstanceHandle
|
||||
);
|
||||
}
|
||||
|
||||
var emptyObject = {};
|
||||
|
||||
{
|
||||
@@ -28201,12 +28198,7 @@ function getInspectorDataForViewAtPoint(
|
||||
) {
|
||||
{
|
||||
var closestInstance = null;
|
||||
var fabricInstanceHandle =
|
||||
getInternalInstanceHandleFromPublicInstance(inspectedView);
|
||||
var fabricNode =
|
||||
fabricInstanceHandle != null
|
||||
? getNodeFromInternalInstanceHandle(fabricInstanceHandle)
|
||||
: null;
|
||||
var fabricNode = getNodeFromPublicInstance(inspectedView);
|
||||
|
||||
if (fabricNode) {
|
||||
// For Fabric we can look up the instance handle directly and measure it.
|
||||
|
||||
+43
-40
@@ -940,7 +940,7 @@ eventPluginOrder = Array.prototype.slice.call([
|
||||
"ReactNativeBridgeEventPlugin"
|
||||
]);
|
||||
recomputePluginOrdering();
|
||||
var injectedNamesToPlugins$jscomp$inline_248 = {
|
||||
var injectedNamesToPlugins$jscomp$inline_249 = {
|
||||
ResponderEventPlugin: ResponderEventPlugin,
|
||||
ReactNativeBridgeEventPlugin: {
|
||||
eventTypes: {},
|
||||
@@ -986,32 +986,32 @@ var injectedNamesToPlugins$jscomp$inline_248 = {
|
||||
}
|
||||
}
|
||||
},
|
||||
isOrderingDirty$jscomp$inline_249 = !1,
|
||||
pluginName$jscomp$inline_250;
|
||||
for (pluginName$jscomp$inline_250 in injectedNamesToPlugins$jscomp$inline_248)
|
||||
isOrderingDirty$jscomp$inline_250 = !1,
|
||||
pluginName$jscomp$inline_251;
|
||||
for (pluginName$jscomp$inline_251 in injectedNamesToPlugins$jscomp$inline_249)
|
||||
if (
|
||||
injectedNamesToPlugins$jscomp$inline_248.hasOwnProperty(
|
||||
pluginName$jscomp$inline_250
|
||||
injectedNamesToPlugins$jscomp$inline_249.hasOwnProperty(
|
||||
pluginName$jscomp$inline_251
|
||||
)
|
||||
) {
|
||||
var pluginModule$jscomp$inline_251 =
|
||||
injectedNamesToPlugins$jscomp$inline_248[pluginName$jscomp$inline_250];
|
||||
var pluginModule$jscomp$inline_252 =
|
||||
injectedNamesToPlugins$jscomp$inline_249[pluginName$jscomp$inline_251];
|
||||
if (
|
||||
!namesToPlugins.hasOwnProperty(pluginName$jscomp$inline_250) ||
|
||||
namesToPlugins[pluginName$jscomp$inline_250] !==
|
||||
pluginModule$jscomp$inline_251
|
||||
!namesToPlugins.hasOwnProperty(pluginName$jscomp$inline_251) ||
|
||||
namesToPlugins[pluginName$jscomp$inline_251] !==
|
||||
pluginModule$jscomp$inline_252
|
||||
) {
|
||||
if (namesToPlugins[pluginName$jscomp$inline_250])
|
||||
if (namesToPlugins[pluginName$jscomp$inline_251])
|
||||
throw Error(
|
||||
"EventPluginRegistry: Cannot inject two different event plugins using the same name, `" +
|
||||
(pluginName$jscomp$inline_250 + "`.")
|
||||
(pluginName$jscomp$inline_251 + "`.")
|
||||
);
|
||||
namesToPlugins[pluginName$jscomp$inline_250] =
|
||||
pluginModule$jscomp$inline_251;
|
||||
isOrderingDirty$jscomp$inline_249 = !0;
|
||||
namesToPlugins[pluginName$jscomp$inline_251] =
|
||||
pluginModule$jscomp$inline_252;
|
||||
isOrderingDirty$jscomp$inline_250 = !0;
|
||||
}
|
||||
}
|
||||
isOrderingDirty$jscomp$inline_249 && recomputePluginOrdering();
|
||||
isOrderingDirty$jscomp$inline_250 && recomputePluginOrdering();
|
||||
var instanceCache = new Map(),
|
||||
instanceProps = new Map();
|
||||
function getInstanceFromTag(tag) {
|
||||
@@ -9561,6 +9561,13 @@ function findNodeHandle(componentOrHandle) {
|
||||
? componentOrHandle._nativeTag
|
||||
: componentOrHandle.__nativeTag;
|
||||
}
|
||||
function getNodeFromPublicInstance(publicInstance) {
|
||||
return null == publicInstance.__internalInstanceHandle
|
||||
? null
|
||||
: (publicInstance = publicInstance.__internalInstanceHandle) &&
|
||||
publicInstance.stateNode &&
|
||||
publicInstance.stateNode.node;
|
||||
}
|
||||
var emptyObject = {};
|
||||
function createHierarchy(fiberHierarchy) {
|
||||
return fiberHierarchy.map(function (fiber$jscomp$0) {
|
||||
@@ -9640,10 +9647,10 @@ batchedUpdatesImpl = function (fn, a) {
|
||||
}
|
||||
};
|
||||
var roots = new Map(),
|
||||
devToolsConfig$jscomp$inline_1089 = {
|
||||
devToolsConfig$jscomp$inline_1092 = {
|
||||
findFiberByHostInstance: getInstanceFromTag,
|
||||
bundleType: 0,
|
||||
version: "18.3.0-next-c57b90f50-20230320",
|
||||
version: "18.3.0-next-3554c8852-20230320",
|
||||
rendererPackageName: "react-native-renderer",
|
||||
rendererConfig: {
|
||||
getInspectorDataForViewTag: function () {
|
||||
@@ -9658,11 +9665,11 @@ var roots = new Map(),
|
||||
}.bind(null, findNodeHandle)
|
||||
}
|
||||
};
|
||||
var internals$jscomp$inline_1343 = {
|
||||
bundleType: devToolsConfig$jscomp$inline_1089.bundleType,
|
||||
version: devToolsConfig$jscomp$inline_1089.version,
|
||||
rendererPackageName: devToolsConfig$jscomp$inline_1089.rendererPackageName,
|
||||
rendererConfig: devToolsConfig$jscomp$inline_1089.rendererConfig,
|
||||
var internals$jscomp$inline_1346 = {
|
||||
bundleType: devToolsConfig$jscomp$inline_1092.bundleType,
|
||||
version: devToolsConfig$jscomp$inline_1092.version,
|
||||
rendererPackageName: devToolsConfig$jscomp$inline_1092.rendererPackageName,
|
||||
rendererConfig: devToolsConfig$jscomp$inline_1092.rendererConfig,
|
||||
overrideHookState: null,
|
||||
overrideHookStateDeletePath: null,
|
||||
overrideHookStateRenamePath: null,
|
||||
@@ -9678,26 +9685,26 @@ var internals$jscomp$inline_1343 = {
|
||||
return null === fiber ? null : fiber.stateNode;
|
||||
},
|
||||
findFiberByHostInstance:
|
||||
devToolsConfig$jscomp$inline_1089.findFiberByHostInstance ||
|
||||
devToolsConfig$jscomp$inline_1092.findFiberByHostInstance ||
|
||||
emptyFindFiberByHostInstance,
|
||||
findHostInstancesForRefresh: null,
|
||||
scheduleRefresh: null,
|
||||
scheduleRoot: null,
|
||||
setRefreshHandler: null,
|
||||
getCurrentFiber: null,
|
||||
reconcilerVersion: "18.3.0-next-c57b90f50-20230320"
|
||||
reconcilerVersion: "18.3.0-next-3554c8852-20230320"
|
||||
};
|
||||
if ("undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__) {
|
||||
var hook$jscomp$inline_1344 = __REACT_DEVTOOLS_GLOBAL_HOOK__;
|
||||
var hook$jscomp$inline_1347 = __REACT_DEVTOOLS_GLOBAL_HOOK__;
|
||||
if (
|
||||
!hook$jscomp$inline_1344.isDisabled &&
|
||||
hook$jscomp$inline_1344.supportsFiber
|
||||
!hook$jscomp$inline_1347.isDisabled &&
|
||||
hook$jscomp$inline_1347.supportsFiber
|
||||
)
|
||||
try {
|
||||
(rendererID = hook$jscomp$inline_1344.inject(
|
||||
internals$jscomp$inline_1343
|
||||
(rendererID = hook$jscomp$inline_1347.inject(
|
||||
internals$jscomp$inline_1346
|
||||
)),
|
||||
(injectedHook = hook$jscomp$inline_1344);
|
||||
(injectedHook = hook$jscomp$inline_1347);
|
||||
} catch (err) {}
|
||||
}
|
||||
exports.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED = {
|
||||
@@ -9719,11 +9726,9 @@ exports.dispatchCommand = function (handle, command, args) {
|
||||
var nativeTag =
|
||||
null != handle._nativeTag ? handle._nativeTag : handle.__nativeTag;
|
||||
null != nativeTag &&
|
||||
((handle = handle.__internalInstanceHandle),
|
||||
((handle = getNodeFromPublicInstance(handle)),
|
||||
null != handle
|
||||
? ((nativeTag = handle && handle.stateNode && handle.stateNode.node),
|
||||
null != nativeTag &&
|
||||
nativeFabricUIManager.dispatchCommand(nativeTag, command, args))
|
||||
? nativeFabricUIManager.dispatchCommand(handle, command, args)
|
||||
: ReactNativePrivateInterface.UIManager.dispatchViewManagerCommand(
|
||||
nativeTag,
|
||||
command,
|
||||
@@ -9805,11 +9810,9 @@ exports.sendAccessibilityEvent = function (handle, eventType) {
|
||||
var nativeTag =
|
||||
null != handle._nativeTag ? handle._nativeTag : handle.__nativeTag;
|
||||
null != nativeTag &&
|
||||
((handle = handle.__internalInstanceHandle),
|
||||
((handle = getNodeFromPublicInstance(handle)),
|
||||
null != handle
|
||||
? ((nativeTag = handle && handle.stateNode && handle.stateNode.node),
|
||||
null != nativeTag &&
|
||||
nativeFabricUIManager.sendAccessibilityEvent(nativeTag, eventType))
|
||||
? nativeFabricUIManager.sendAccessibilityEvent(handle, eventType)
|
||||
: ReactNativePrivateInterface.legacySendAccessibilityEvent(
|
||||
nativeTag,
|
||||
eventType
|
||||
|
||||
+36
-33
@@ -951,7 +951,7 @@ eventPluginOrder = Array.prototype.slice.call([
|
||||
"ReactNativeBridgeEventPlugin"
|
||||
]);
|
||||
recomputePluginOrdering();
|
||||
var injectedNamesToPlugins$jscomp$inline_264 = {
|
||||
var injectedNamesToPlugins$jscomp$inline_265 = {
|
||||
ResponderEventPlugin: ResponderEventPlugin,
|
||||
ReactNativeBridgeEventPlugin: {
|
||||
eventTypes: {},
|
||||
@@ -997,32 +997,32 @@ var injectedNamesToPlugins$jscomp$inline_264 = {
|
||||
}
|
||||
}
|
||||
},
|
||||
isOrderingDirty$jscomp$inline_265 = !1,
|
||||
pluginName$jscomp$inline_266;
|
||||
for (pluginName$jscomp$inline_266 in injectedNamesToPlugins$jscomp$inline_264)
|
||||
isOrderingDirty$jscomp$inline_266 = !1,
|
||||
pluginName$jscomp$inline_267;
|
||||
for (pluginName$jscomp$inline_267 in injectedNamesToPlugins$jscomp$inline_265)
|
||||
if (
|
||||
injectedNamesToPlugins$jscomp$inline_264.hasOwnProperty(
|
||||
pluginName$jscomp$inline_266
|
||||
injectedNamesToPlugins$jscomp$inline_265.hasOwnProperty(
|
||||
pluginName$jscomp$inline_267
|
||||
)
|
||||
) {
|
||||
var pluginModule$jscomp$inline_267 =
|
||||
injectedNamesToPlugins$jscomp$inline_264[pluginName$jscomp$inline_266];
|
||||
var pluginModule$jscomp$inline_268 =
|
||||
injectedNamesToPlugins$jscomp$inline_265[pluginName$jscomp$inline_267];
|
||||
if (
|
||||
!namesToPlugins.hasOwnProperty(pluginName$jscomp$inline_266) ||
|
||||
namesToPlugins[pluginName$jscomp$inline_266] !==
|
||||
pluginModule$jscomp$inline_267
|
||||
!namesToPlugins.hasOwnProperty(pluginName$jscomp$inline_267) ||
|
||||
namesToPlugins[pluginName$jscomp$inline_267] !==
|
||||
pluginModule$jscomp$inline_268
|
||||
) {
|
||||
if (namesToPlugins[pluginName$jscomp$inline_266])
|
||||
if (namesToPlugins[pluginName$jscomp$inline_267])
|
||||
throw Error(
|
||||
"EventPluginRegistry: Cannot inject two different event plugins using the same name, `" +
|
||||
(pluginName$jscomp$inline_266 + "`.")
|
||||
(pluginName$jscomp$inline_267 + "`.")
|
||||
);
|
||||
namesToPlugins[pluginName$jscomp$inline_266] =
|
||||
pluginModule$jscomp$inline_267;
|
||||
isOrderingDirty$jscomp$inline_265 = !0;
|
||||
namesToPlugins[pluginName$jscomp$inline_267] =
|
||||
pluginModule$jscomp$inline_268;
|
||||
isOrderingDirty$jscomp$inline_266 = !0;
|
||||
}
|
||||
}
|
||||
isOrderingDirty$jscomp$inline_265 && recomputePluginOrdering();
|
||||
isOrderingDirty$jscomp$inline_266 && recomputePluginOrdering();
|
||||
var instanceCache = new Map(),
|
||||
instanceProps = new Map();
|
||||
function getInstanceFromTag(tag) {
|
||||
@@ -10271,6 +10271,13 @@ function findNodeHandle(componentOrHandle) {
|
||||
? componentOrHandle._nativeTag
|
||||
: componentOrHandle.__nativeTag;
|
||||
}
|
||||
function getNodeFromPublicInstance(publicInstance) {
|
||||
return null == publicInstance.__internalInstanceHandle
|
||||
? null
|
||||
: (publicInstance = publicInstance.__internalInstanceHandle) &&
|
||||
publicInstance.stateNode &&
|
||||
publicInstance.stateNode.node;
|
||||
}
|
||||
var emptyObject = {};
|
||||
function createHierarchy(fiberHierarchy) {
|
||||
return fiberHierarchy.map(function (fiber$jscomp$0) {
|
||||
@@ -10350,10 +10357,10 @@ batchedUpdatesImpl = function (fn, a) {
|
||||
}
|
||||
};
|
||||
var roots = new Map(),
|
||||
devToolsConfig$jscomp$inline_1166 = {
|
||||
devToolsConfig$jscomp$inline_1169 = {
|
||||
findFiberByHostInstance: getInstanceFromTag,
|
||||
bundleType: 0,
|
||||
version: "18.3.0-next-c57b90f50-20230320",
|
||||
version: "18.3.0-next-3554c8852-20230320",
|
||||
rendererPackageName: "react-native-renderer",
|
||||
rendererConfig: {
|
||||
getInspectorDataForViewTag: function () {
|
||||
@@ -10382,10 +10389,10 @@ var roots = new Map(),
|
||||
} catch (err) {}
|
||||
return hook.checkDCE ? !0 : !1;
|
||||
})({
|
||||
bundleType: devToolsConfig$jscomp$inline_1166.bundleType,
|
||||
version: devToolsConfig$jscomp$inline_1166.version,
|
||||
rendererPackageName: devToolsConfig$jscomp$inline_1166.rendererPackageName,
|
||||
rendererConfig: devToolsConfig$jscomp$inline_1166.rendererConfig,
|
||||
bundleType: devToolsConfig$jscomp$inline_1169.bundleType,
|
||||
version: devToolsConfig$jscomp$inline_1169.version,
|
||||
rendererPackageName: devToolsConfig$jscomp$inline_1169.rendererPackageName,
|
||||
rendererConfig: devToolsConfig$jscomp$inline_1169.rendererConfig,
|
||||
overrideHookState: null,
|
||||
overrideHookStateDeletePath: null,
|
||||
overrideHookStateRenamePath: null,
|
||||
@@ -10401,14 +10408,14 @@ var roots = new Map(),
|
||||
return null === fiber ? null : fiber.stateNode;
|
||||
},
|
||||
findFiberByHostInstance:
|
||||
devToolsConfig$jscomp$inline_1166.findFiberByHostInstance ||
|
||||
devToolsConfig$jscomp$inline_1169.findFiberByHostInstance ||
|
||||
emptyFindFiberByHostInstance,
|
||||
findHostInstancesForRefresh: null,
|
||||
scheduleRefresh: null,
|
||||
scheduleRoot: null,
|
||||
setRefreshHandler: null,
|
||||
getCurrentFiber: null,
|
||||
reconcilerVersion: "18.3.0-next-c57b90f50-20230320"
|
||||
reconcilerVersion: "18.3.0-next-3554c8852-20230320"
|
||||
});
|
||||
exports.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED = {
|
||||
computeComponentStackForErrorReporting: function (reactTag) {
|
||||
@@ -10429,11 +10436,9 @@ exports.dispatchCommand = function (handle, command, args) {
|
||||
var nativeTag =
|
||||
null != handle._nativeTag ? handle._nativeTag : handle.__nativeTag;
|
||||
null != nativeTag &&
|
||||
((handle = handle.__internalInstanceHandle),
|
||||
((handle = getNodeFromPublicInstance(handle)),
|
||||
null != handle
|
||||
? ((nativeTag = handle && handle.stateNode && handle.stateNode.node),
|
||||
null != nativeTag &&
|
||||
nativeFabricUIManager.dispatchCommand(nativeTag, command, args))
|
||||
? nativeFabricUIManager.dispatchCommand(handle, command, args)
|
||||
: ReactNativePrivateInterface.UIManager.dispatchViewManagerCommand(
|
||||
nativeTag,
|
||||
command,
|
||||
@@ -10522,11 +10527,9 @@ exports.sendAccessibilityEvent = function (handle, eventType) {
|
||||
var nativeTag =
|
||||
null != handle._nativeTag ? handle._nativeTag : handle.__nativeTag;
|
||||
null != nativeTag &&
|
||||
((handle = handle.__internalInstanceHandle),
|
||||
((handle = getNodeFromPublicInstance(handle)),
|
||||
null != handle
|
||||
? ((nativeTag = handle && handle.stateNode && handle.stateNode.node),
|
||||
null != nativeTag &&
|
||||
nativeFabricUIManager.sendAccessibilityEvent(nativeTag, eventType))
|
||||
? nativeFabricUIManager.sendAccessibilityEvent(handle, eventType)
|
||||
: ReactNativePrivateInterface.legacySendAccessibilityEvent(
|
||||
nativeTag,
|
||||
eventType
|
||||
|
||||
+8
-1
@@ -213,6 +213,8 @@ export type ReactNativeType = {
|
||||
};
|
||||
|
||||
export opaque type Node = mixed;
|
||||
type InternalInstanceHandle = mixed;
|
||||
type PublicInstance = mixed;
|
||||
|
||||
export type ReactFabricType = {
|
||||
findHostInstance_DEPRECATED<TElementType: ElementType>(
|
||||
@@ -237,7 +239,12 @@ export type ReactFabricType = {
|
||||
concurrentRoot: ?boolean,
|
||||
): ?ElementRef<ElementType>,
|
||||
unmountComponentAtNode(containerTag: number): void,
|
||||
getNodeFromInternalInstanceHandle(internalInstanceHandle: mixed): ?Node,
|
||||
getNodeFromInternalInstanceHandle(
|
||||
internalInstanceHandle: InternalInstanceHandle,
|
||||
): ?Node,
|
||||
getPublicInstanceFromInternalInstanceHandle(
|
||||
internalInstanceHandle: InternalInstanceHandle,
|
||||
): PublicInstance,
|
||||
...
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user