Skip to content
Open
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 @@ -27,7 +27,6 @@
#import <ReactCommon/RCTHost.h>
#import <ReactCommon/RCTTurboModuleManager.h>
#import <react/renderer/runtimescheduler/RuntimeScheduler.h>
#import <react/renderer/runtimescheduler/RuntimeSchedulerCallInvoker.h>
#import <react/runtime/JSRuntimeFactory.h>
#import <react/runtime/JSRuntimeFactoryCAPI.h>

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<<ffaf7abad8f9b217cc16e28ee9270b40>>
* @generated SignedSource<<b7ef80c2c39c734ae511fe6457b89ce7>>
*/

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

/**
* Route async CallInvoker work through the ReactInstance buffered runtime executor, so it is ordered against callable module calls and cannot run before the JS bundle has finished evaluating. invokeSync is unaffected.
*/
@JvmStatic
public fun enableBufferedCallInvoker(): Boolean = accessor.enableBufferedCallInvoker()

/**
* Enable prop iterator setter-style construction of Props in C++ (this flag is not used in Java).
*/
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<<0bfeba3d07af6fade47b24974a80a592>>
* @generated SignedSource<<68aefd0293540d56f57e8badc0de04c8>>
*/

/**
Expand Down Expand Up @@ -34,6 +34,7 @@ internal class ReactNativeFeatureFlagsCxxAccessor : ReactNativeFeatureFlagsAcces
private var enableAccumulatedUpdatesInRawPropsAndroidCache: Boolean? = null
private var enableAndroidTextMeasurementOptimizationsCache: Boolean? = null
private var enableBridgelessArchitectureCache: Boolean? = null
private var enableBufferedCallInvokerCache: Boolean? = null
private var enableCppPropsIteratorSetterCache: Boolean? = null
private var enableCustomFocusSearchOnClippedElementsAndroidCache: Boolean? = null
private var enableDestroyShadowTreeRevisionAsyncCache: Boolean? = null
Expand Down Expand Up @@ -232,6 +233,15 @@ internal class ReactNativeFeatureFlagsCxxAccessor : ReactNativeFeatureFlagsAcces
return cached
}

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

override fun enableCppPropsIteratorSetter(): Boolean {
var cached = enableCppPropsIteratorSetterCache
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<<b79fbf8335bf2b480743c3cd93d4e6bd>>
* @generated SignedSource<<247f721796621af8615014477518bcd9>>
*/

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

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

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

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

@DoNotStrip @JvmStatic public external fun enableCustomFocusSearchOnClippedElementsAndroid(): 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<<bc2a060e5718ae7afd6d22199c8e9d38>>
* @generated SignedSource<<33071257f9c96a8664c9af429e387061>>
*/

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

override fun enableBridgelessArchitecture(): Boolean = true

override fun enableBufferedCallInvoker(): Boolean = true

override fun enableCppPropsIteratorSetter(): Boolean = false

override fun enableCustomFocusSearchOnClippedElementsAndroid(): Boolean = true
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<<3605df96fad767e3ec3957d7305ef926>>
* @generated SignedSource<<f218220c66b8367211cae49adba46afc>>
*/

/**
Expand Down Expand Up @@ -38,6 +38,7 @@ internal class ReactNativeFeatureFlagsLocalAccessor : ReactNativeFeatureFlagsAcc
private var enableAccumulatedUpdatesInRawPropsAndroidCache: Boolean? = null
private var enableAndroidTextMeasurementOptimizationsCache: Boolean? = null
private var enableBridgelessArchitectureCache: Boolean? = null
private var enableBufferedCallInvokerCache: Boolean? = null
private var enableCppPropsIteratorSetterCache: Boolean? = null
private var enableCustomFocusSearchOnClippedElementsAndroidCache: Boolean? = null
private var enableDestroyShadowTreeRevisionAsyncCache: Boolean? = null
Expand Down Expand Up @@ -250,6 +251,16 @@ internal class ReactNativeFeatureFlagsLocalAccessor : ReactNativeFeatureFlagsAcc
return cached
}

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

override fun enableCppPropsIteratorSetter(): Boolean {
var cached = enableCppPropsIteratorSetterCache
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<<100e31bd98a30aba4abef10f168638fc>>
* @generated SignedSource<<915bf918212b9898319de61d4cadaa13>>
*/

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

@DoNotStrip public fun enableBridgelessArchitecture(): Boolean

@DoNotStrip public fun enableBufferedCallInvoker(): Boolean

@DoNotStrip public fun enableCppPropsIteratorSetter(): Boolean

@DoNotStrip public fun enableCustomFocusSearchOnClippedElementsAndroid(): 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<<ce8ba846a2e567547c4ba7370b9f4e89>>
* @generated SignedSource<<177c5cc7f6e970a2d4454c32d7f777ef>>
*/

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

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

bool enableCppPropsIteratorSetter() override {
static const auto method =
getReactNativeFeatureFlagsProviderJavaClass()->getMethod<jboolean()>("enableCppPropsIteratorSetter");
Expand Down Expand Up @@ -623,6 +629,11 @@ bool JReactNativeFeatureFlagsCxxInterop::enableBridgelessArchitecture(
return ReactNativeFeatureFlags::enableBridgelessArchitecture();
}

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

bool JReactNativeFeatureFlagsCxxInterop::enableCppPropsIteratorSetter(
facebook::jni::alias_ref<JReactNativeFeatureFlagsCxxInterop> /*unused*/) {
return ReactNativeFeatureFlags::enableCppPropsIteratorSetter();
Expand Down Expand Up @@ -1051,6 +1062,9 @@ void JReactNativeFeatureFlagsCxxInterop::registerNatives() {
makeNativeMethod(
"enableBridgelessArchitecture",
JReactNativeFeatureFlagsCxxInterop::enableBridgelessArchitecture),
makeNativeMethod(
"enableBufferedCallInvoker",
JReactNativeFeatureFlagsCxxInterop::enableBufferedCallInvoker),
makeNativeMethod(
"enableCppPropsIteratorSetter",
JReactNativeFeatureFlagsCxxInterop::enableCppPropsIteratorSetter),
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<<145b12c4a208db86c7bfdfed56cf433f>>
* @generated SignedSource<<eab10e240a16c8ef3f659bd8ded290f0>>
*/

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

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

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

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@
#include <jsi/jsi.h>
#include <react/jni/JRuntimeExecutor.h>
#include <react/jni/JSLogging.h>
#include <react/renderer/runtimescheduler/RuntimeSchedulerCallInvoker.h>
#include <react/runtime/BridgelessNativeMethodCallInvoker.h>
#include <react/runtime/JSRuntimeBindings.h>

Expand Down Expand Up @@ -89,10 +88,11 @@ JReactInstance::JReactInstance(

auto unbufferedRuntimeExecutor = instance_->getUnbufferedRuntimeExecutor();
// Set up the JS and native modules call invokers (for TurboModules)
auto jsInvoker = std::make_unique<RuntimeSchedulerCallInvoker>(
instance_->getRuntimeScheduler());
// Shares the instance's BufferedRuntimeExecutor so async calls from native
// are ordered against callFunctionOnModule and cannot run before the bundle
// has evaluated. invokeSync still goes straight to the scheduler.
jsCallInvokerHolder_ = jni::make_global(
CallInvokerHolder::newObjectCxxArgs(std::move(jsInvoker)));
CallInvokerHolder::newObjectCxxArgs(instance_->createJSCallInvoker()));
auto nativeMethodCallInvoker =
std::make_unique<BridgelessNativeMethodCallInvoker>(
sharedNativeMessageQueueThread);
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<<9c1052fdfafd3f0ef6bcdaa740cf25ec>>
* @generated SignedSource<<7b726d7483bb35062b79e582323f0d7e>>
*/

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

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

bool ReactNativeFeatureFlags::enableCppPropsIteratorSetter() {
return getAccessor().enableCppPropsIteratorSetter();
}
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<<2d59cf5ea42847d6174fc433ba5a6fe4>>
* @generated SignedSource<<511e884fc32f9d0b44b4234dac4fed0b>>
*/

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

/**
* Route async CallInvoker work through the ReactInstance buffered runtime executor, so it is ordered against callable module calls and cannot run before the JS bundle has finished evaluating. invokeSync is unaffected.
*/
RN_EXPORT static bool enableBufferedCallInvoker();

/**
* Enable prop iterator setter-style construction of Props in C++ (this flag is not used in Java).
*/
Expand Down
Loading
Loading