Skip to content

Delete ShadowTreeRevision on background thread #50997

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*
* @generated SignedSource<<b86b8bb1d53ca03240c25adb8b423040>>
* @generated SignedSource<<31638ef8ac6992a354785b74af8fbe0d>>
*/

/**
Expand Down Expand Up @@ -90,6 +90,12 @@ public object ReactNativeFeatureFlags {
@JvmStatic
public fun enableCustomFocusSearchOnClippedElementsAndroid(): Boolean = accessor.enableCustomFocusSearchOnClippedElementsAndroid()

/**
* Enables destructor calls for ShadowTreeRevision in the background to reduce UI thread work.
*/
@JvmStatic
public fun enableDestroyShadowTreeRevisionAsync(): Boolean = accessor.enableDestroyShadowTreeRevisionAsync()

/**
* When enabled a subset of components will avoid double measurement on Android.
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*
* @generated SignedSource<<9c1e0e7e87aead96e2554ef5ecf9e7af>>
* @generated SignedSource<<6b382661025db56592b44255f5a8694c>>
*/

/**
Expand All @@ -30,6 +30,7 @@ internal class ReactNativeFeatureFlagsCxxAccessor : ReactNativeFeatureFlagsAcces
private var enableBridgelessArchitectureCache: Boolean? = null
private var enableCppPropsIteratorSetterCache: Boolean? = null
private var enableCustomFocusSearchOnClippedElementsAndroidCache: Boolean? = null
private var enableDestroyShadowTreeRevisionAsyncCache: Boolean? = null
private var enableDoubleMeasurementFixAndroidCache: Boolean? = null
private var enableEagerRootViewAttachmentCache: Boolean? = null
private var enableFabricLogsCache: Boolean? = null
Expand Down Expand Up @@ -156,6 +157,15 @@ internal class ReactNativeFeatureFlagsCxxAccessor : ReactNativeFeatureFlagsAcces
return cached
}

override fun enableDestroyShadowTreeRevisionAsync(): Boolean {
var cached = enableDestroyShadowTreeRevisionAsyncCache
if (cached == null) {
cached = ReactNativeFeatureFlagsCxxInterop.enableDestroyShadowTreeRevisionAsync()
enableDestroyShadowTreeRevisionAsyncCache = cached
}
return cached
}

override fun enableDoubleMeasurementFixAndroid(): Boolean {
var cached = enableDoubleMeasurementFixAndroidCache
if (cached == null) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*
* @generated SignedSource<<b95c0d1f576b67fcf9d9df498ea30994>>
* @generated SignedSource<<8276fd1166cdd235f11a0b490bb7d924>>
*/

/**
Expand Down Expand Up @@ -48,6 +48,8 @@ public object ReactNativeFeatureFlagsCxxInterop {

@DoNotStrip @JvmStatic public external fun enableCustomFocusSearchOnClippedElementsAndroid(): Boolean

@DoNotStrip @JvmStatic public external fun enableDestroyShadowTreeRevisionAsync(): Boolean

@DoNotStrip @JvmStatic public external fun enableDoubleMeasurementFixAndroid(): Boolean

@DoNotStrip @JvmStatic public external fun enableEagerRootViewAttachment(): Boolean
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*
* @generated SignedSource<<c7425e6212e4e9d70e64452e550bf638>>
* @generated SignedSource<<ffadd7912aed2d95b0c6199aa8902690>>
*/

/**
Expand Down Expand Up @@ -43,6 +43,8 @@ public open class ReactNativeFeatureFlagsDefaults : ReactNativeFeatureFlagsProvi

override fun enableCustomFocusSearchOnClippedElementsAndroid(): Boolean = true

override fun enableDestroyShadowTreeRevisionAsync(): Boolean = false

override fun enableDoubleMeasurementFixAndroid(): Boolean = false

override fun enableEagerRootViewAttachment(): Boolean = false
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*
* @generated SignedSource<<5b145ee103cf6b40e13d33c88cd52777>>
* @generated SignedSource<<5dc41059d71d3a345be45a6a233b05a0>>
*/

/**
Expand Down Expand Up @@ -34,6 +34,7 @@ internal class ReactNativeFeatureFlagsLocalAccessor : ReactNativeFeatureFlagsAcc
private var enableBridgelessArchitectureCache: Boolean? = null
private var enableCppPropsIteratorSetterCache: Boolean? = null
private var enableCustomFocusSearchOnClippedElementsAndroidCache: Boolean? = null
private var enableDestroyShadowTreeRevisionAsyncCache: Boolean? = null
private var enableDoubleMeasurementFixAndroidCache: Boolean? = null
private var enableEagerRootViewAttachmentCache: Boolean? = null
private var enableFabricLogsCache: Boolean? = null
Expand Down Expand Up @@ -170,6 +171,16 @@ internal class ReactNativeFeatureFlagsLocalAccessor : ReactNativeFeatureFlagsAcc
return cached
}

override fun enableDestroyShadowTreeRevisionAsync(): Boolean {
var cached = enableDestroyShadowTreeRevisionAsyncCache
if (cached == null) {
cached = currentProvider.enableDestroyShadowTreeRevisionAsync()
accessedFeatureFlags.add("enableDestroyShadowTreeRevisionAsync")
enableDestroyShadowTreeRevisionAsyncCache = cached
}
return cached
}

override fun enableDoubleMeasurementFixAndroid(): Boolean {
var cached = enableDoubleMeasurementFixAndroidCache
if (cached == null) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*
* @generated SignedSource<<9cdb965a420d53cf36b6531684cb07ae>>
* @generated SignedSource<<35f6d9ae3c445c81fc4bab7509fd3179>>
*/

/**
Expand Down Expand Up @@ -43,6 +43,8 @@ public interface ReactNativeFeatureFlagsProvider {

@DoNotStrip public fun enableCustomFocusSearchOnClippedElementsAndroid(): Boolean

@DoNotStrip public fun enableDestroyShadowTreeRevisionAsync(): Boolean

@DoNotStrip public fun enableDoubleMeasurementFixAndroid(): Boolean

@DoNotStrip public fun enableEagerRootViewAttachment(): Boolean
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*
* @generated SignedSource<<c89831646046b10c7b2a40e14deb3d1a>>
* @generated SignedSource<<d566c157b7db07e235bada071067f11d>>
*/

/**
Expand Down Expand Up @@ -99,6 +99,12 @@ class ReactNativeFeatureFlagsJavaProvider
return method(javaProvider_);
}

bool enableDestroyShadowTreeRevisionAsync() override {
static const auto method =
getReactNativeFeatureFlagsProviderJavaClass()->getMethod<jboolean()>("enableDestroyShadowTreeRevisionAsync");
return method(javaProvider_);
}

bool enableDoubleMeasurementFixAndroid() override {
static const auto method =
getReactNativeFeatureFlagsProviderJavaClass()->getMethod<jboolean()>("enableDoubleMeasurementFixAndroid");
Expand Down Expand Up @@ -363,6 +369,11 @@ bool JReactNativeFeatureFlagsCxxInterop::enableCustomFocusSearchOnClippedElement
return ReactNativeFeatureFlags::enableCustomFocusSearchOnClippedElementsAndroid();
}

bool JReactNativeFeatureFlagsCxxInterop::enableDestroyShadowTreeRevisionAsync(
facebook::jni::alias_ref<JReactNativeFeatureFlagsCxxInterop> /*unused*/) {
return ReactNativeFeatureFlags::enableDestroyShadowTreeRevisionAsync();
}

bool JReactNativeFeatureFlagsCxxInterop::enableDoubleMeasurementFixAndroid(
facebook::jni::alias_ref<JReactNativeFeatureFlagsCxxInterop> /*unused*/) {
return ReactNativeFeatureFlags::enableDoubleMeasurementFixAndroid();
Expand Down Expand Up @@ -599,6 +610,9 @@ void JReactNativeFeatureFlagsCxxInterop::registerNatives() {
makeNativeMethod(
"enableCustomFocusSearchOnClippedElementsAndroid",
JReactNativeFeatureFlagsCxxInterop::enableCustomFocusSearchOnClippedElementsAndroid),
makeNativeMethod(
"enableDestroyShadowTreeRevisionAsync",
JReactNativeFeatureFlagsCxxInterop::enableDestroyShadowTreeRevisionAsync),
makeNativeMethod(
"enableDoubleMeasurementFixAndroid",
JReactNativeFeatureFlagsCxxInterop::enableDoubleMeasurementFixAndroid),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*
* @generated SignedSource<<2a5ad62d2cb4f1111391f1b566e10c1d>>
* @generated SignedSource<<270b461fa199f8e6365948cded0785ad>>
*/

/**
Expand Down Expand Up @@ -60,6 +60,9 @@ class JReactNativeFeatureFlagsCxxInterop
static bool enableCustomFocusSearchOnClippedElementsAndroid(
facebook::jni::alias_ref<JReactNativeFeatureFlagsCxxInterop>);

static bool enableDestroyShadowTreeRevisionAsync(
facebook::jni::alias_ref<JReactNativeFeatureFlagsCxxInterop>);

static bool enableDoubleMeasurementFixAndroid(
facebook::jni::alias_ref<JReactNativeFeatureFlagsCxxInterop>);

Expand Down
2 changes: 1 addition & 1 deletion packages/react-native/ReactCommon/React-Fabric.podspec
Original file line number Diff line number Diff line change
Expand Up @@ -46,12 +46,12 @@ Pod::Spec.new do |s|
s.dependency "React-Core"
s.dependency "React-debug"
s.dependency "React-featureflags"
s.dependency "React-utils"
s.dependency "React-runtimescheduler"
s.dependency "React-cxxreact"

add_dependency(s, "React-rendererdebug")
add_dependency(s, "React-graphics", :additional_framework_paths => ["react/renderer/graphics/platform/ios"])
add_dependency(s, "React-utils", :additional_framework_paths => ["react/utils/platform/ios"])

depend_on_js_engine(s)
add_rn_third_party_dependencies(s)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*
* @generated SignedSource<<0eb63ead191be88440cbb73fd760dec7>>
* @generated SignedSource<<74f22c6a0302a9923e99d2455d84e231>>
*/

/**
Expand Down Expand Up @@ -66,6 +66,10 @@ bool ReactNativeFeatureFlags::enableCustomFocusSearchOnClippedElementsAndroid()
return getAccessor().enableCustomFocusSearchOnClippedElementsAndroid();
}

bool ReactNativeFeatureFlags::enableDestroyShadowTreeRevisionAsync() {
return getAccessor().enableDestroyShadowTreeRevisionAsync();
}

bool ReactNativeFeatureFlags::enableDoubleMeasurementFixAndroid() {
return getAccessor().enableDoubleMeasurementFixAndroid();
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*
* @generated SignedSource<<80dcd75591a392144c2fd2817cc4408a>>
* @generated SignedSource<<b941543bc6f12dbb0e12ac2ae0042186>>
*/

/**
Expand Down Expand Up @@ -89,6 +89,11 @@ class ReactNativeFeatureFlags {
*/
RN_EXPORT static bool enableCustomFocusSearchOnClippedElementsAndroid();

/**
* Enables destructor calls for ShadowTreeRevision in the background to reduce UI thread work.
*/
RN_EXPORT static bool enableDestroyShadowTreeRevisionAsync();

/**
* When enabled a subset of components will avoid double measurement on Android.
*/
Expand Down
Loading
Loading