Commit Graph

10 Commits

Author SHA1 Message Date
Rubén Norte 5030f4e015 Move feature flag definitions to JS file instead of JSON (#42815)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/42815

Feature flags were originally defined in a JSON file for easier interoperability but we're only using the definitions in JS anyway, so having the definitions in a JS file is more flexible (e.g.: adding comments).

Changelog: [internal]

Reviewed By: huntie

Differential Revision: D53351483

fbshipit-source-id: 23fe0a3898b4facf2f2cf9645f78c45d78937f31
2024-02-05 11:02:48 -08:00
Samuel Susla 4473fe8f2e fix crash in ReactGroupView when subview clipping is enabled (#42811)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/42811

changelog: [internal]

Attempt to fixing a crash in ReactViewGroup when removeClippedSubviews is enabled.
The implementation of removeClippedSubviews in ReactViewGroup is stateful and must be in sync between children of view and [member variables in ReactViewGroup](https://fburl.com/code/l22wewzc) that keep reference to all children. When it gets out of sync, it manifests itself as `java.lang.IndexOutOfBoundsException` crash.

The mounting layer counts on the fact that view hierarchy will never be directly mutated and all mutations will go through [ReactClippingViewManager](https://fburl.com/code/esl3vqhh). ReactClippingViewManager, if clipping is enabled, calls appropriate methods on ReactViewGroup to make sure member variables to manage clipping are in sync with view hierarchy.

This is true, except for a retry mechanism in SurfaceMountingManager. The retry mechanism tries to manually reconciliation the state with android view hierarchy. It bypasses ReactClippingViewManager in the process.

Reviewed By: javache, mdvacca

Differential Revision: D53348831

fbshipit-source-id: b6b190781a7c85ee4dfd7cb9bc74fd3a55466e45
2024-02-03 10:53:32 -08:00
David Vacca 044b50b53d Re-enable CustomDrawOrder in RN Android (#42719)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/42719

The task T175989432 started firing on October 30 2020, which correspond to the landing of D24512203. I believe disabling CustomDrawOrder could be a potential cause of T175989432, that's why in this diff I'm creating an experiment to understand what is the impact (negative or positive) of re-enabling CustomDrawOrder in RN Android

Original diff: D24512203

Changelog: [Internal] internal

Reviewed By: javache

Differential Revision: D53150292

fbshipit-source-id: f0abbc7d175c2cd717ce87bbe69aeaf3db0b0e5c
2024-01-31 23:28:32 -08:00
Nick Gerleman daa308027a Migrate enableSpannableBuildingUnification to new feature flag system (#42716)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/42716

Migrates this to the new flag system just added.

Made a quick change to the Android template, to mark Kotlin accessors as `JvmStatic` to make calling from Java more idiomatic.

Next diff will wire to MC.

Changelog: [Internal]

Reviewed By: rubennorte, mdvacca

Differential Revision: D53198874

fbshipit-source-id: 6ab5b279d9ac59733c6e820c25be72383ce0e54a
2024-01-29 18:15:22 -08:00
Rubén Norte f8f7949e25 Move feature flags for the event loop to ReactNativeFeatureFlags (re-land) (#42677)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/42677

Changelog: [internal]

This is a re-application of https://github.com/facebook/react-native/pull/42434 which had to be reverted after a problem in a previous PR.

See details in the original PR.

Reviewed By: huntie

Differential Revision: D53122991

fbshipit-source-id: 5bc4306522fc5fa48ea81d0802d0f891706cfbf5
2024-01-26 09:55:27 -08:00
Rubén Norte 5e66f41697 Implement new feature flag system (re-land) (#42678)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/42678

Changelog: [internal]

This is a re-application of https://github.com/facebook/react-native/pull/42430, which had to be reverted because of crashes in optimized builds on Android:

```
Abort Reason: terminating due to uncaught exception of type facebook::jni::JniException: java.lang.ClassNotFoundException: com.facebook.react.internal.featureflags.ReactNativeFeatureFlagsProvider
```

The root cause of that was that that class was removed because it wasn't statically referenced from Kotlin/Java, but it was dynamically referenced from C++ (in `ReactNativeFeatureFlagsProviderHolder.cpp`).

This applies the same changes + adds `DoNotStrip` annotations for the affected class and all its methods.

Reviewed By: huntie

Differential Revision: D53122992

fbshipit-source-id: efc4d5636a3f2d39b86e9c098bff408b6688b80b
2024-01-26 09:55:27 -08:00
David Vacca ffaeaba213 Back out "Implement new feature flag system"
Summary:
Original commit changeset: 0ba95803f61e

Original Phabricator Diff: D52806730

bypass-github-export-checks

changelog: [internal] internal

Reviewed By: yungsters

Differential Revision: D53113947

fbshipit-source-id: ace1222a861a739fcd3f4b0e12c135db47a93344
2024-01-25 21:52:59 -08:00
David Vacca 31a8bc9644 Back out "Move feature flags for the event loop to ReactNativeFeatureFlags"
Summary:
Original commit changeset: e30a6f2e12b4

Original Phabricator Diff: D52819137

bypass-github-export-checks

changelog: [internal] internal

Reviewed By: yungsters

Differential Revision: D53113944

fbshipit-source-id: daac6f2bf1e9cd16354987e17cb27f0bcda25f9d
2024-01-25 21:52:59 -08:00
Rubén Norte e04d1b47b6 Move feature flags for the event loop to ReactNativeFeatureFlags (#42434)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/42434

Changelog: [internal]

The flags for the event loop were set up using different mechanisms due to the limitations of the previous feature flags systems. Now we can centralize on the new system and use them consistently on Android and iOS.

Reviewed By: RSNara

Differential Revision: D52819137

fbshipit-source-id: e30a6f2e12b4a027a906502b80a70dd48bb657b6
2024-01-25 13:55:11 -08:00
Rubén Norte 705c675d51 Implement new feature flag system (#42430)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/42430

This PR creates a new internal feature flags system for React Native. This is only meant to be used internally within the framework, but we might expose it externally in some form in the future to allow customizing specific feature flags in frameworks and applications.

Features:
* 2 types of flags:
  * Common: can be overridden from native and are accessible from all layers of the stack (Objective-C/Swift, Java/Kotlin, C++ and JavaScript).
  * JS-only: flags that can only be defined and accessed from JS (to allow things like hot reloading without a native build).
* 1 source of truth for each flag.
* Feature flags are application/process scoped (using C++ singletons).

See the `README.md` file in this PR for additional information.

This also adds modifies `run-ci-javascript-tests` to run a new check to make sure that the generate files are in sync with the JSON file that contains the definitions.

Changelog: [internal]

Reviewed By: huntie

Differential Revision: D52806730

fbshipit-source-id: 0ba95803f61ec2f05266ee535921321bf6d3dc6a
2024-01-25 13:55:11 -08:00