Skip to content

Commit 3e927d4

Browse files
committed
Merge branch 'main' into dev-menu
2 parents 63a18ff + 863184f commit 3e927d4

File tree

101 files changed

+1294
-2312
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

101 files changed

+1294
-2312
lines changed

CHANGELOG.md

Lines changed: 181 additions & 0 deletions
Large diffs are not rendered by default.

packages/community-cli-plugin/src/utils/version.js

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,6 @@ Diff: ${styleText(['dim', 'underline'], newVersion?.diffUrl ?? 'none')}
8888
}
8989
}
9090

91-
// $FlowFixMe
9291
function isDiffPurgeEntry(data: Partial<DiffPurge>): data is DiffPurge {
9392
return (
9493
// $FlowFixMe[incompatible-type-guard]

packages/gradle-plugin/react-native-gradle-plugin/src/main/kotlin/com/facebook/react/TaskConfiguration.kt

Lines changed: 20 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -65,25 +65,26 @@ internal fun Project.configureReactTasks(variant: Variant, config: ReactExtensio
6565
if (!isDebuggableVariant) {
6666
val entryFileEnvVariable = System.getenv("ENTRY_FILE")
6767
val bundleTask =
68-
tasks.register("createBundle${targetName}JsAndAssets", BundleHermesCTask::class.java) {
69-
it.root.set(config.root)
70-
it.nodeExecutableAndArgs.set(config.nodeExecutableAndArgs)
71-
it.cliFile.set(cliFile)
72-
it.bundleCommand.set(config.bundleCommand)
73-
it.entryFile.set(detectedEntryFile(config, entryFileEnvVariable))
74-
it.extraPackagerArgs.set(config.extraPackagerArgs)
75-
it.bundleConfig.set(config.bundleConfig)
76-
it.bundleAssetName.set(config.bundleAssetName)
77-
it.jsBundleDir.set(jsBundleDir)
78-
it.resourcesDir.set(resourcesDir)
79-
it.hermesEnabled.set(isHermesEnabledInThisVariant)
80-
it.minifyEnabled.set(!isHermesEnabledInThisVariant)
81-
it.devEnabled.set(false)
82-
it.jsIntermediateSourceMapsDir.set(jsIntermediateSourceMapsDir)
83-
it.jsSourceMapsDir.set(jsSourceMapsDir)
84-
it.hermesCommand.set(config.hermesCommand)
85-
it.hermesFlags.set(config.hermesFlags)
86-
it.reactNativeDir.set(config.reactNativeDir)
68+
tasks.register("createBundle${targetName}JsAndAssets", BundleHermesCTask::class.java) { task
69+
->
70+
task.root.set(config.root)
71+
task.nodeExecutableAndArgs.set(config.nodeExecutableAndArgs)
72+
task.cliFile.set(cliFile)
73+
task.bundleCommand.set(config.bundleCommand)
74+
task.entryFile.set(detectedEntryFile(config, entryFileEnvVariable))
75+
task.extraPackagerArgs.set(config.extraPackagerArgs)
76+
task.bundleConfig.set(config.bundleConfig)
77+
task.bundleAssetName.set(config.bundleAssetName)
78+
task.jsBundleDir.set(jsBundleDir)
79+
task.resourcesDir.set(resourcesDir)
80+
task.hermesEnabled.set(isHermesEnabledInThisVariant)
81+
task.minifyEnabled.set(!isHermesEnabledInThisVariant)
82+
task.devEnabled.set(false)
83+
task.jsIntermediateSourceMapsDir.set(jsIntermediateSourceMapsDir)
84+
task.jsSourceMapsDir.set(jsSourceMapsDir)
85+
task.hermesCommand.set(config.hermesCommand)
86+
task.hermesFlags.set(config.hermesFlags)
87+
task.reactNativeDir.set(config.reactNativeDir)
8788
}
8889
variant.sources.res?.addGeneratedSourceDirectory(bundleTask, BundleHermesCTask::resourcesDir)
8990
variant.sources.assets?.addGeneratedSourceDirectory(bundleTask, BundleHermesCTask::jsBundleDir)

packages/react-native/Libraries/Lists/__flowtests__/SectionList-flowtest.js

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,6 @@ export function testBadSectionsShape(): React.MixedElement {
102102
],
103103
},
104104
];
105-
// $FlowExpectedError - section missing `data` field
106105
return <SectionList renderItem={renderMyListItem} sections={sections} />;
107106
}
108107

packages/react-native/Libraries/Network/XMLHttpRequest.js

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -649,8 +649,6 @@ class XMLHttpRequest extends EventTarget {
649649
this._url,
650650
this._headers,
651651
data,
652-
/* $FlowFixMe(>=0.78.0 site=react_native_android_fb) This issue was found
653-
* when making Flow check .android.js files. */
654652
nativeResponseType,
655653
incrementalEvents,
656654
this.timeout,

packages/react-native/Libraries/StyleSheet/__flowtests__/StyleSheet-flowtest.js

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -41,11 +41,7 @@ export function testBadCompose() {
4141
(StyleSheet.compose(textStyle, textStyle): ImageStyleProp);
4242

4343
// $FlowExpectedError[incompatible-type] - Incompatible type.
44-
(StyleSheet.compose(
45-
// $FlowExpectedError - Incompatible type.
46-
[textStyle],
47-
null,
48-
): ImageStyleProp);
44+
(StyleSheet.compose([textStyle], null): ImageStyleProp);
4945

5046
// $FlowExpectedError[incompatible-type] - Incompatible type.
5147
(StyleSheet.compose(

packages/react-native/Libraries/Text/TextInput/RCTBaseTextInputViewManager.mm

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -141,7 +141,7 @@ - (void)setBridge:(RCTBridge *)bridge
141141
RCTExecuteOnUIManagerQueue(^{
142142
RCTBaseTextInputShadowView *shadowView =
143143
(RCTBaseTextInputShadowView *)[self.bridge.uiManager shadowViewForReactTag:viewTag];
144-
if (value) {
144+
if (value != nullptr) {
145145
[shadowView setText:value];
146146
}
147147
[self.bridge.uiManager setNeedsLayout];

packages/react-native/Libraries/TypeSafety/RCTTypedModuleConstants.mm

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ @implementation _RCTTypedModuleConstants {
1616
+ (instancetype)newWithUnsafeDictionary:(NSDictionary<NSString *, id> *)dictionary
1717
{
1818
_RCTTypedModuleConstants *constants = [self new];
19-
if (constants) {
19+
if (constants != nullptr) {
2020
constants->_dictionary = dictionary;
2121
}
2222
return constants;

packages/react-native/React/Base/RCTBridgeProxy.mm

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ - (instancetype)initWithViewRegistry:(RCTViewRegistry *)viewRegistry
5353
launchOptions:(nullable NSDictionary *)launchOptions
5454
{
5555
self = [super self];
56-
if (self) {
56+
if (self != nullptr) {
5757
_uiManagerProxy = [[RCTUIManagerProxy alloc] initWithViewRegistry:viewRegistry];
5858
_moduleRegistry = moduleRegistry;
5959
_bundleManager = bundleManager;
@@ -75,7 +75,7 @@ - (void)dispatchBlock:(dispatch_block_t)block queue:(dispatch_queue_t)queue
7575

7676
if (queue == RCTJSThread) {
7777
_dispatchToJSThread(block);
78-
} else if (queue) {
78+
} else if (queue != nullptr) {
7979
dispatch_async(queue, block);
8080
}
8181
}
@@ -427,7 +427,7 @@ @implementation RCTUIManagerProxy {
427427
- (instancetype)initWithViewRegistry:(RCTViewRegistry *)viewRegistry
428428
{
429429
self = [super self];
430-
if (self) {
430+
if (self != nullptr) {
431431
_viewRegistry = viewRegistry;
432432
_legacyViewRegistry = [NSMutableDictionary new];
433433
}
@@ -443,8 +443,8 @@ - (UIView *)viewForReactTag:(NSNumber *)reactTag
443443
{
444444
[self logWarning:@"Please migrate to RCTViewRegistry: @synthesize viewRegistry_DEPRECATED = _viewRegistry_DEPRECATED."
445445
cmd:_cmd];
446-
UIView *view = [_viewRegistry viewForReactTag:reactTag] ? [_viewRegistry viewForReactTag:reactTag]
447-
: [_legacyViewRegistry objectForKey:reactTag];
446+
UIView *view = ([_viewRegistry viewForReactTag:reactTag] != nullptr) ? [_viewRegistry viewForReactTag:reactTag]
447+
: [_legacyViewRegistry objectForKey:reactTag];
448448
return RCTPaperViewOrCurrentView(view);
449449
}
450450

@@ -457,7 +457,7 @@ - (void)addUIBlock:(RCTViewManagerUIBlock)block
457457
__weak __typeof(self) weakSelf = self;
458458
RCTExecuteOnMainQueue(^{
459459
__typeof(self) strongSelf = weakSelf;
460-
if (strongSelf) {
460+
if (strongSelf != nullptr) {
461461
RCTUIManager *proxiedManager = (RCTUIManager *)strongSelf;
462462
RCTComposedViewRegistry *composedViewRegistry =
463463
[[RCTComposedViewRegistry alloc] initWithUIManager:proxiedManager

packages/react-native/React/Base/Surface/SurfaceHostingView/RCTSurfaceSizeMeasureMode.mm

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -18,17 +18,17 @@ void RCTSurfaceMinimumSizeAndMaximumSizeFromSizeAndSizeMeasureMode(
1818
*minimumSize = CGSizeZero;
1919
*maximumSize = CGSizeMake(CGFLOAT_MAX, CGFLOAT_MAX);
2020

21-
if (sizeMeasureMode & RCTSurfaceSizeMeasureModeWidthExact) {
21+
if ((sizeMeasureMode & RCTSurfaceSizeMeasureModeWidthExact) != 0) {
2222
minimumSize->width = size.width;
2323
maximumSize->width = size.width;
24-
} else if (sizeMeasureMode & RCTSurfaceSizeMeasureModeWidthAtMost) {
24+
} else if ((sizeMeasureMode & RCTSurfaceSizeMeasureModeWidthAtMost) != 0) {
2525
maximumSize->width = size.width;
2626
}
2727

28-
if (sizeMeasureMode & RCTSurfaceSizeMeasureModeHeightExact) {
28+
if ((sizeMeasureMode & RCTSurfaceSizeMeasureModeHeightExact) != 0) {
2929
minimumSize->height = size.height;
3030
maximumSize->height = size.height;
31-
} else if (sizeMeasureMode & RCTSurfaceSizeMeasureModeHeightAtMost) {
31+
} else if ((sizeMeasureMode & RCTSurfaceSizeMeasureModeHeightAtMost) != 0) {
3232
maximumSize->height = size.height;
3333
}
3434
}

0 commit comments

Comments
 (0)