Skip to content

Commit 142e9b2

Browse files
committed
Merge branch 'main' into set-log-box-max-font-size
2 parents bfd6f10 + 97fa2a4 commit 142e9b2

45 files changed

Lines changed: 759 additions & 169 deletions

File tree

Some content is hidden

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

.flowconfig

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -95,4 +95,4 @@ untyped-import
9595
untyped-type-import
9696

9797
[version]
98-
^0.312.0
98+
^0.312.1

CHANGELOG.md

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,20 @@
11
# Changelog
22

3+
## v0.85.3
4+
5+
### Changed
6+
7+
- **React Native DevTools**: Update debugger-frontend from 8edd9be...194d3f8 ([9966cbdf4d](https://github.com/facebook/react-native/commit/9966cbdf4da99ee036a75bec4da9bb2e1ee7a9c4) by [@motiz88](https://github.com/motiz88))
8+
9+
### Fixed
10+
11+
- **Build**: Use pinned Hermes version when version.properties is not 1000.0.0 ([5e3a3ba995](https://github.com/facebook/react-native/commit/5e3a3ba995026b42c2ea0ad7ee4758fcf73005e6) by [@cipolleschi](https://github.com/cipolleschi))
12+
13+
#### iOS specific
14+
15+
- **Build**: Fix silent tar extraction failure on EdenFS in replace-rncore-version.js by extracting to a temp directory first ([9bc7d38be0](https://github.com/facebook/react-native/commit/9bc7d38be0771ae4006206fcb174956f53adf508) by [@motiz88](https://github.com/motiz88))
16+
- **Build**: Skip prebuilds for DynamicFrameworks CI jobs ([753c19bea4](https://github.com/facebook/react-native/commit/753c19bea4ab854eb8000b2b5bab814261a46596) by [@motiz88](https://github.com/motiz88))
17+
318
## v0.85.2
419

520
### Added

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,7 @@
8686
"eslint-plugin-relay": "^1.8.3",
8787
"fb-dotslash": "0.5.8",
8888
"flow-api-translator": "0.36.0",
89-
"flow-bin": "^0.312.0",
89+
"flow-bin": "^0.312.1",
9090
"hermes-eslint": "0.36.0",
9191
"hermes-transform": "0.36.0",
9292
"ini": "^5.0.0",

packages/react-native/ReactAndroid/src/main/java/com/facebook/react/fabric/FabricUIManager.java

Lines changed: 12 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -1199,42 +1199,22 @@ public void receiveEvent(
11991199
return;
12001200
}
12011201

1202-
EventEmitterWrapper eventEmitter = mMountingManager.getEventEmitter(surfaceId, reactTag);
1203-
if (eventEmitter == null) {
1204-
if (mMountingManager.getViewExists(reactTag)) {
1205-
// The view is pre-allocated and created. However, it hasn't been mounted yet. We will have
1206-
// access to the event emitter later when the view is mounted. For now just save the event
1207-
// in the view state and trigger it later.
1208-
mMountingManager.enqueuePendingEvent(
1209-
surfaceId,
1210-
reactTag,
1211-
eventName,
1212-
canCoalesceEvent,
1213-
params,
1214-
eventCategory,
1215-
eventTimestamp);
1216-
} else {
1217-
// This can happen if the view has disappeared from the screen (because of async events)
1218-
FLog.i(TAG, "Unable to invoke event: " + eventName + " for reactTag: " + reactTag);
1219-
}
1220-
return;
1221-
}
1222-
12231202
if (experimentalIsSynchronous) {
12241203
UiThreadUtil.assertOnUiThread();
1225-
// add() returns true only if there are no equivalent events already in the set
1226-
boolean firstEventForFrame =
1227-
mSynchronousEvents.add(new SynchronousEvent(surfaceId, reactTag, eventName));
1228-
if (firstEventForFrame) {
1229-
eventEmitter.dispatchEventSynchronously(eventName, params, eventTimestamp);
1230-
}
1231-
} else {
1232-
if (canCoalesceEvent) {
1233-
eventEmitter.dispatchUnique(eventName, params, eventTimestamp);
1234-
} else {
1235-
eventEmitter.dispatch(eventName, params, eventCategory, eventTimestamp);
1204+
EventEmitterWrapper eventEmitter = mMountingManager.getEventEmitter(surfaceId, reactTag);
1205+
if (eventEmitter != null) {
1206+
// add() returns true only if there are no equivalent events already in the set
1207+
boolean firstEventForFrame =
1208+
mSynchronousEvents.add(new SynchronousEvent(surfaceId, reactTag, eventName));
1209+
if (firstEventForFrame) {
1210+
eventEmitter.dispatchEventSynchronously(eventName, params, eventTimestamp);
1211+
}
1212+
return;
12361213
}
12371214
}
1215+
1216+
mMountingManager.dispatchEvent(
1217+
surfaceId, reactTag, eventName, canCoalesceEvent, params, eventCategory, eventTimestamp);
12381218
}
12391219

12401220
@Override

packages/react-native/ReactAndroid/src/main/java/com/facebook/react/fabric/mounting/MountingManager.kt

Lines changed: 5 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -327,7 +327,7 @@ internal class MountingManager(
327327
attachmentsPositions,
328328
)
329329

330-
fun enqueuePendingEvent(
330+
fun dispatchEvent(
331331
surfaceId: Int,
332332
reactTag: Int,
333333
eventName: String,
@@ -338,22 +338,16 @@ internal class MountingManager(
338338
) {
339339
val smm = getSurfaceMountingManager(surfaceId, reactTag)
340340
if (smm == null) {
341-
FLog.d(
341+
FLog.i(
342342
TAG,
343-
"Cannot queue event without valid surface mounting manager for tag: %d, surfaceId: %d",
343+
"Unable to invoke event %s for tag [%d] in surfaceId [%d]",
344+
eventName,
344345
reactTag,
345346
surfaceId,
346347
)
347348
return
348349
}
349-
smm.enqueuePendingEvent(
350-
reactTag,
351-
eventName,
352-
canCoalesceEvent,
353-
params,
354-
eventCategory,
355-
eventTimestamp,
356-
)
350+
smm.dispatchEvent(reactTag, eventName, canCoalesceEvent, params, eventCategory, eventTimestamp)
357351
}
358352

359353
private fun getSurfaceMountingManager(surfaceId: Int, reactTag: Int): SurfaceMountingManager? =

packages/react-native/ReactAndroid/src/main/java/com/facebook/react/fabric/mounting/SurfaceMountingManager.kt

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1241,6 +1241,45 @@ internal constructor(
12411241
}
12421242
}
12431243

1244+
@AnyThread
1245+
internal fun dispatchEvent(
1246+
reactTag: Int,
1247+
eventName: String,
1248+
canCoalesceEvent: Boolean,
1249+
params: WritableMap?,
1250+
@EventCategoryDef eventCategory: Int,
1251+
eventTimestamp: Long,
1252+
) {
1253+
val viewState = registryGet(reactTag)
1254+
if (viewState == null) {
1255+
// This can happen if the view has disappeared from the screen (because of async events)
1256+
FLog.i(TAG, "Unable to invoke event: %s for reactTag: %d", eventName, reactTag)
1257+
return
1258+
}
1259+
1260+
val eventEmitter = viewState.eventEmitter
1261+
if (eventEmitter == null) {
1262+
// The view is pre-allocated and created. However, it hasn't been mounted yet. We will have
1263+
// access to the event emitter later when the view is mounted. For now just save the event
1264+
// in the view state and trigger it later.
1265+
enqueuePendingEvent(
1266+
reactTag,
1267+
eventName,
1268+
canCoalesceEvent,
1269+
params,
1270+
eventCategory,
1271+
eventTimestamp,
1272+
)
1273+
return
1274+
}
1275+
1276+
if (canCoalesceEvent) {
1277+
eventEmitter.dispatchUnique(eventName, params, eventTimestamp)
1278+
} else {
1279+
eventEmitter.dispatch(eventName, params, eventCategory, eventTimestamp)
1280+
}
1281+
}
1282+
12441283
public fun markActiveTouchForTag(reactTag: Int): Unit {
12451284
viewsWithActiveTouches.add(reactTag)
12461285
}

packages/react-native/ReactAndroid/src/main/java/com/facebook/react/internal/featureflags/ReactNativeFeatureFlags.kt

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
* This source code is licensed under the MIT license found in the
55
* LICENSE file in the root directory of this source tree.
66
*
7-
* @generated SignedSource<<c9be40b9d016463d1531057598a6aa88>>
7+
* @generated SignedSource<<1eca66b21554b00725f2a9be894a0db9>>
88
*/
99

1010
/**
@@ -294,6 +294,12 @@ public object ReactNativeFeatureFlags {
294294
@JvmStatic
295295
public fun enablePropsUpdateReconciliationAndroid(): Boolean = accessor.enablePropsUpdateReconciliationAndroid()
296296

297+
/**
298+
* Gates a defensive guard around Scheduler::uiManagerDidDispatchCommand and uiManagerDidFinishTransaction that prevents queued rendering-update lambdas from dereferencing the SchedulerDelegate after it has been destroyed (use-after-free).
299+
*/
300+
@JvmStatic
301+
public fun enableSchedulerDelegateInvalidation(): Boolean = accessor.enableSchedulerDelegateInvalidation()
302+
297303
/**
298304
* When enabled, it will use SwiftUI for filter effects like blur on iOS.
299305
*/

packages/react-native/ReactAndroid/src/main/java/com/facebook/react/internal/featureflags/ReactNativeFeatureFlagsCxxAccessor.kt

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
* This source code is licensed under the MIT license found in the
55
* LICENSE file in the root directory of this source tree.
66
*
7-
* @generated SignedSource<<d07f1b96cf6e0a1798f86fc9f61caf73>>
7+
* @generated SignedSource<<76d977ea53cb2a37fc2ea8549e31cebd>>
88
*/
99

1010
/**
@@ -64,6 +64,7 @@ internal class ReactNativeFeatureFlagsCxxAccessor : ReactNativeFeatureFlagsAcces
6464
private var enableNetworkEventReportingCache: Boolean? = null
6565
private var enablePreparedTextLayoutCache: Boolean? = null
6666
private var enablePropsUpdateReconciliationAndroidCache: Boolean? = null
67+
private var enableSchedulerDelegateInvalidationCache: Boolean? = null
6768
private var enableSwiftUIBasedFiltersCache: Boolean? = null
6869
private var enableViewCullingCache: Boolean? = null
6970
private var enableViewRecyclingCache: Boolean? = null
@@ -508,6 +509,15 @@ internal class ReactNativeFeatureFlagsCxxAccessor : ReactNativeFeatureFlagsAcces
508509
return cached
509510
}
510511

512+
override fun enableSchedulerDelegateInvalidation(): Boolean {
513+
var cached = enableSchedulerDelegateInvalidationCache
514+
if (cached == null) {
515+
cached = ReactNativeFeatureFlagsCxxInterop.enableSchedulerDelegateInvalidation()
516+
enableSchedulerDelegateInvalidationCache = cached
517+
}
518+
return cached
519+
}
520+
511521
override fun enableSwiftUIBasedFilters(): Boolean {
512522
var cached = enableSwiftUIBasedFiltersCache
513523
if (cached == null) {

packages/react-native/ReactAndroid/src/main/java/com/facebook/react/internal/featureflags/ReactNativeFeatureFlagsCxxInterop.kt

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
* This source code is licensed under the MIT license found in the
55
* LICENSE file in the root directory of this source tree.
66
*
7-
* @generated SignedSource<<d9aa2a16720aa9fd4378c0c14e4f8ffa>>
7+
* @generated SignedSource<<a737810bf0211590401c2afb464aaf37>>
88
*/
99

1010
/**
@@ -116,6 +116,8 @@ public object ReactNativeFeatureFlagsCxxInterop {
116116

117117
@DoNotStrip @JvmStatic public external fun enablePropsUpdateReconciliationAndroid(): Boolean
118118

119+
@DoNotStrip @JvmStatic public external fun enableSchedulerDelegateInvalidation(): Boolean
120+
119121
@DoNotStrip @JvmStatic public external fun enableSwiftUIBasedFilters(): Boolean
120122

121123
@DoNotStrip @JvmStatic public external fun enableViewCulling(): Boolean

packages/react-native/ReactAndroid/src/main/java/com/facebook/react/internal/featureflags/ReactNativeFeatureFlagsDefaults.kt

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
* This source code is licensed under the MIT license found in the
55
* LICENSE file in the root directory of this source tree.
66
*
7-
* @generated SignedSource<<54a4f6d01a052e5ab19b15652d5ab1a5>>
7+
* @generated SignedSource<<9e5b3192d1bec953c116d959ad63283d>>
88
*/
99

1010
/**
@@ -111,6 +111,8 @@ public open class ReactNativeFeatureFlagsDefaults : ReactNativeFeatureFlagsProvi
111111

112112
override fun enablePropsUpdateReconciliationAndroid(): Boolean = false
113113

114+
override fun enableSchedulerDelegateInvalidation(): Boolean = false
115+
114116
override fun enableSwiftUIBasedFilters(): Boolean = false
115117

116118
override fun enableViewCulling(): Boolean = false

0 commit comments

Comments
 (0)