Files
react-native/packages/react-native/ReactCommon/react/featureflags/ReactNativeFeatureFlagsOverridesOSSCanary.h
T
Ramanpreet Nara 061174c150 Bridgeless: Implement main queue setup api in turbo modules (#50040)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/50040

This diff implements main queue module setup.

Sometimes, people need to capture uikit things, and use them from javascript. In those cases, people can write main queue modules. These modules will be eagerly initialized on the main queue, during react native init.

## On Necessity
**Sync** dispatches to the main thread from the js thread can deadlock react native. And **async** dispatches to the main thread from the js thread sometimes might not be enough: it could lead to flickery rendering. So, we need to allow people to capture ui thread things, before any js executes.

## Caveat
This api is dangerous and discouraged. All react native surfaces will pay the cost of one surface introducing a main queue module. It could also slow down common/critical interactions in your app, if you're not careful.

We will introduce performance logging for this infrastructure. So that we can monitor and file tasks, when main queue module init starts taking "too long."

Changelog: [General][Breaking]: Introduce beforeload callback arg into ReactInstance::loadScript

Reviewed By: mdvacca

Differential Revision: D71084243

fbshipit-source-id: 8fdb84761ac69468afc428f4f79eff6322449e3c
2025-03-19 21:16:05 -07:00

130 lines
1.3 KiB
C++

/*
* Copyright (c) Meta Platforms, Inc. and affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*
* @generated SignedSource<<53c858fa9ec8c4e3b9849f7513fdb441>>
*/
/**
* IMPORTANT: Do NOT modify this file directly.
*
* To change the definition of the flags, edit
* packages/react-native/scripts/featureflags/ReactNativeFeatureFlags.config.js.
*
* To regenerate this code, run the following script from the repo root:
* yarn featureflags --update
*/
#pragma once
#include <react/featureflags/ReactNativeFeatureFlagsOverridesOSSStable.h>
namespace facebook::react {
class ReactNativeFeatureFlagsOverridesOSSCanary : public ReactNativeFeatureFlagsOverridesOSSStable {
public:
ReactNativeFeatureFlagsOverridesOSSCanary() = default;
bool enableBridgelessArchitecture() override {
return true;
}
bool enableFabricRenderer() override {
return true;
}
bool useFabricInterop() override {
return true;
}
bool useNativeViewConfigsInBridgelessMode() override {
return true;
}
bool useTurboModuleInterop() override {
return true;
}
bool useTurboModules() override {
return true;
}
};
} // namespace facebook::react