BridgelessUIManager: Finish createView, updateView, setChildren, manageChildren (#42067)

Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/42067

These methods should not be implemented in the new architecture.

The **only** code that called these UIManagerModule methods was the paper renderer. And the New Architecture should instead use the Fabric renderer.

Changelog: [Internal]

Reviewed By: sammy-SC

Differential Revision: D52345416

fbshipit-source-id: 76511aa97e5dfa938aca658af03fb43122547df1
This commit is contained in:
Ramanpreet Nara
2024-01-10 07:01:22 -08:00
committed by Facebook GitHub Bot
parent 4ed4ea15f6
commit d825e7a5d4
@@ -97,6 +97,38 @@ const UIManagerJSOverridenAPIs = {
},
};
/**
* Leave Unimplemented: The only thing that called these methods was the paper renderer.
* In OSS, the New Architecture will just use the Fabric renderer, which uses
* different APIs.
*/
const UIManagerJSUnusedAPIs = {
createView: (
reactTag: ?number,
viewName: string,
rootTag: RootTag,
props: Object,
): void => {
raiseSoftError('createView');
},
updateView: (reactTag: number, viewName: string, props: Object): void => {
raiseSoftError('updateView');
},
setChildren: (containerTag: ?number, reactTags: Array<number>): void => {
raiseSoftError('setChildren');
},
manageChildren: (
containerTag: ?number,
moveFromIndices: Array<number>,
moveToIndices: Array<number>,
addChildReactTags: Array<number>,
addAtIndices: Array<number>,
removeAtIndices: Array<number>,
): void => {
raiseSoftError('manageChildren');
},
};
const UIManagerJSPlatformAPIs = Platform.select({
android: {
getConstantsForViewManager: (viewManagerName: string): Object => {
@@ -144,6 +176,7 @@ const UIManagerJSPlatformAPIs = Platform.select({
const UIManagerJS: UIManagerJSInterface & {[string]: any} = {
...UIManagerJSOverridenAPIs,
...UIManagerJSPlatformAPIs,
...UIManagerJSUnusedAPIs,
getViewManagerConfig: (viewManagerName: string): mixed => {
if (getUIManagerConstants) {
return getUIManagerConstantsCache()[viewManagerName];
@@ -166,17 +199,6 @@ const UIManagerJS: UIManagerJSInterface & {[string]: any} = {
return null;
}
},
createView: (
reactTag: ?number,
viewName: string,
rootTag: RootTag,
props: Object,
): void => {
raiseSoftError('createView');
},
updateView: (reactTag: number, viewName: string, props: Object): void => {
raiseSoftError('updateView');
},
findSubviewIn: (
reactTag: ?number,
point: Array<number>,
@@ -219,19 +241,6 @@ const UIManagerJS: UIManagerJSInterface & {[string]: any} = {
): void => {
raiseSoftError('replaceExistingNonRootView');
},
setChildren: (containerTag: ?number, reactTags: Array<number>): void => {
raiseSoftError('setChildren');
},
manageChildren: (
containerTag: ?number,
moveFromIndices: Array<number>,
moveToIndices: Array<number>,
addChildReactTags: Array<number>,
addAtIndices: Array<number>,
removeAtIndices: Array<number>,
): void => {
raiseSoftError('manageChildren');
},
};
if (getUIManagerConstants) {