Skip to content

Commit

Permalink
BridgelessUIManager: Finish createView, updateView, setChildren, mana…
Browse files Browse the repository at this point in the history
…geChildren

Summary:
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
  • Loading branch information
RSNara authored and facebook-github-bot committed Dec 27, 2023
1 parent 359a012 commit 423ea8f
Showing 1 changed file with 33 additions and 24 deletions.
57 changes: 33 additions & 24 deletions packages/react-native/Libraries/ReactNative/BridgelessUIManager.js
Original file line number Diff line number Diff line change
Expand Up @@ -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 => {
Expand Down Expand Up @@ -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];
Expand All @@ -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>,
Expand Down Expand Up @@ -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) {
Expand Down

0 comments on commit 423ea8f

Please sign in to comment.