react-native icon indicating copy to clipboard operation
react-native copied to clipboard

fix(iOS) [0.74]: properly warn about createRootViewWithBridge

Open okwasniewski opened this issue 1 year ago • 6 comments

Summary:

This PR fixes an issue that _logWarnIfCreateRootViewWithBridgeIsOverridden was called in wrong place.

Assuming user overrides this method and call to [super]:

- (UIView *)createRootViewWithBridge:(RCTBridge *)bridge moduleName:(NSString *)moduleName initProps:(NSDictionary *)initProps {
  UIView *view = [super createRootViewWithBridge:bridge moduleName:moduleName initProps:initProps];
  view.backgroundColor = [UIColor redColor];
  return view;
}

This method still wasn't called in bridgeless (and not showing the error).

Checking if user overrides this method in appDidFinishWithLaunching works every time

simulator_screenshot_0E22557C-CE37-4617-A25A-F39A6ED4D3D0

Changelog:

[IOS] [FIXED] - Properly warn about createRootViewWithBridge being deprecated

Test Plan:

Check if warning is shown when message is overridden

okwasniewski avatar Feb 22 '24 10:02 okwasniewski

cc: @cipolleschi

okwasniewski avatar Feb 22 '24 10:02 okwasniewski

Platform Engine Arch Size (bytes) Diff
android hermes arm64-v8a 17,935,061 -65,622
android hermes armeabi-v7a n/a --
android hermes x86 n/a --
android hermes x86_64 n/a --
android jsc arm64-v8a 21,293,286 -65,778
android jsc armeabi-v7a n/a --
android jsc x86 n/a --
android jsc x86_64 n/a --

Base commit: 073ca1aa03f74454d51dd6fa63f5c094e283e633 Branch: main

analysis-bot avatar Feb 22 '24 11:02 analysis-bot

can you please add a cherry pick request in the proper discussion?

cipolleschi avatar Feb 22 '24 14:02 cipolleschi

Added: https://github.com/reactwg/react-native-releases/discussions/104#discussioncomment-8557655

So I should re-target this to main?

okwasniewski avatar Feb 22 '24 14:02 okwasniewski

probably yes.

cipolleschi avatar Feb 22 '24 16:02 cipolleschi

@cipolleschi I've changed the target

okwasniewski avatar Feb 23 '24 09:02 okwasniewski

@cipolleschi has imported this pull request. If you are a Meta employee, you can view this diff on Phabricator.

facebook-github-bot avatar Feb 28 '24 11:02 facebook-github-bot

@cipolleschi merged this pull request in facebook/react-native@a1197695fc7dd7750001dc60853fd19f162dc69e.

facebook-github-bot avatar Feb 28 '24 16:02 facebook-github-bot