Summary:
changelog: [internal]
Add a log behind feature flag to learn more about missing component descriptor.
Component descriptor should never be missing, that's a state of program that is impossible as far as I can tell. This logic was introduced in D22216030 (https://github.com/facebook/react-native/commit/6342e6e3f11219391ac3296d41233735af7e6cad) and I think it is just cover the real cause of crashes in LA on iOS.
Reviewed By: RSNara
Differential Revision: D30765947
fbshipit-source-id: 6843384e02529de2f024c59c61ae21b8682ac371
Summary:
changelog: [internal]
Just moving two functions to separate file.
Reviewed By: RSNara
Differential Revision: D30765732
fbshipit-source-id: e85e749c2910f6f38f07e56b23a21fb9f1cbc9b5
Summary:
changelog: [internal]
Prefer `unordered_set` over `vector`. Makes for nicer APIs and has better performance characteristics.
Reviewed By: RSNara
Differential Revision: D30756215
fbshipit-source-id: d259da07f8f0d5837441dc8ba11c00324aac3fa4
Summary:
changelog: [internal]
Maybe invalid keyframe animation shouldn't be queued. This adds a fix behind feature flag to verify if it fixes iOS crashes.
Reviewed By: RSNara
Differential Revision: D30730005
fbshipit-source-id: 8a2bb54c449449a95d14d51a1a78bfaccad61877
Summary:
## Context
RCTModuleRegistry allows NativeModules to require other NativeModules, regardless of if they're using the old or the new system.
## Problems
Currently, the TurboModuleManager owns the RCTModuleRegistry. This results in the following ownership diagram:
{F660246242}
As you can see, for the bridge case, we're maintaining two *different* RCTModuleRegistry objects, both of which maintain a backward reference to the bridge and the TurboModuleManager.
## Changes
If we stop having TurboModuleManager own the RCTModuleRegistry, and just have React Native's initialization layer attach it to NativeModules, then we can simplify the above ownership diagram to this:
{F660246285}
## Benefits
- Less complicated design for RCTModuleRegistry
- RCTModuleRegistry understands the old and the new NativeModule system. So, it makes more sense for RCTModuleRegistry to be owned by the bridge, which also understands the old and the new NativeModule system.
- **Actual Motivation:** This allows us to start exporting RCTModuleRegistry from the bridgeless core, which is safer than leaking the TurboModuleManager from the bridgeless core. Diffs incoming.
Changelog: [Internal]
Reviewed By: sammy-SC
Differential Revision: D30753286
fbshipit-source-id: cf374092b7b939bc177c3c3448424f2fb53033c3
Summary:
changelog: [internal]
Group public, protected and private methods in header and implementation file. Nothing else is changed in this diff.
Reviewed By: RSNara
Differential Revision: D30729103
fbshipit-source-id: 047bfb86794caedddcf6569ffeee224fee811794
Summary:
changelog: [internal]
There was extra bookkeeping associated with lifetime of `LayoutAnimationCallbackWrapper`. We can just copy it into runtimeExecutor lambda to manage its life cycle and delete `jsi::Function` once it was called.
Reviewed By: RSNara
Differential Revision: D30728210
fbshipit-source-id: 6fc60ee83846cb73648f1c09e5aaf1ed04bd0817
Summary:
changelog: [internal]
Use set instead of vector. It makes for nicer API to check if the element exists.
Reviewed By: cortinico
Differential Revision: D30728211
fbshipit-source-id: 7b7cc1e94bb82a44b064e2945a753adbbce5dc2c
Summary:
changelog: [internal]
LayoutAnimations only animates changes inside View and Paragraph nodes. This diff extends it to any node that's ViewKind.
Reviewed By: JoshuaGross
Differential Revision: D30603138
fbshipit-source-id: 63ca1e5df420149c4ba66151e97fea419fdfe631
Summary:
changelog: [internal]
Don't use C++ 17 features in RuntimeScheduler module as it needs to be imported into C++14 module.
Also removes redundant dependency.
Reviewed By: ShikaSD
Differential Revision: D30485642
fbshipit-source-id: 0a20f85c596eebe193affc815c8ca851fc72e46d
Summary:
changelog: [internal]
Use surfaceId type instead of raw int type in PropsParserContext
Reviewed By: RSNara
Differential Revision: D30667540
fbshipit-source-id: 2bf890b892851e785318e3566692ac72ec782b91
Summary:
Ship libjsi as a standalone dynamic library. This prevents problems
with exception handling caused by duplicate typeinfo across multiple
shared libs, and reduces bundle size by removing duplicate copies of
JSI.
Changelog: [Internal]
Reviewed By: fkgozali
Differential Revision: D30599215
fbshipit-source-id: abad1398342a5328daa825f3f684e0067cad7a96
Summary:
Implements the calculation of measurement and position of Text attachments in Android
Changelog: [Internal]
Reviewed By: JoshuaGross
Differential Revision: D30586616
fbshipit-source-id: e9ecc002f03477e3465d746855e1dff2e5f0b321
Summary:
Android TextView's default for breakStrategy is BREAK_STRATEGY_HIGH_QUALITY (https://developer.android.com/reference/android/widget/TextView#setBreakStrategy(int))
RN docs also states that highQuality is default.
However, on Fabric, the default is 'simple'. This diff fixes the default to be 'highQuality'
Changelog:
[Android][Fixed] - Set textBreakStrategy default to be 'highQuality'
Reviewed By: JoshuaGross
Differential Revision: D30597085
fbshipit-source-id: 3bd7531afdaf980b342cc461dd449c3d3df12cb0
Summary:
Changelog:
[ios][added] - introduce MockSurfaceHandler
following the recommendation in https://fb.workplace.com/groups/474291069286180/posts/6540719469309946
in order to unit test classes that use SurfaceHandler, we need to be able to mock it somehow - since the class is final we aren't able to do that. in this diff, we add the mock class.
Reviewed By: sammy-SC
Differential Revision: D30578927
fbshipit-source-id: 9b39b03ad0b55cecd9b482f9cce9630d7e7d5bda
Summary:
Changelog:
[internal]
following the recommendation in https://fb.workplace.com/groups/474291069286180/posts/6540719469309946
in order to unit test classes that use SurfaceHandler, we need to be able to mock it somehow - since the class is final we aren't able to do that. in this diff, we convert the function that we need to stub / listen to to a virtual function so we can mock it.
the alternative is to keep this class final, and create another abstract interface that this will extend from. however, this class is quite large and that would have a lot more boilerplate and updation of callsites, so this simpler approach seems better.
Reviewed By: sammy-SC
Differential Revision: D30578928
fbshipit-source-id: 4a63396f049c44753986d15f1ac64332b2a8393a
Summary:
Expose android_hyphenationFrequency in Fabric as part of ParagraphAttributes
Changelog: [Internal]
Reviewed By: JoshuaGross
Differential Revision: D30583215
fbshipit-source-id: f4e9e9d6ea8efcfc10db29e1fbd651462f442837
Summary:
Changelog: [iOS] [Fixed]
TextTransform is applied when constructing NSAttributedString from C++ AttributedString in Fabric.
Reviewed By: sammy-SC
Differential Revision: D30515821
fbshipit-source-id: 8a824ff89919832f79ace693dfe3cf7ed35c3beb
Summary:
LLD, our new iOS linker, is an ongoing effort to migrate our old outdated ld64 linker. As part of our effort to rollout LLD to all apps, we are making sure LLD reaches parity with ld64.
Due to Identical Code Folding (ICF), LLD and ld64 handles strings differently. LLD treats each string as a separate object in memory even if the values of the strings are the same. ld64 happens to aggregate these values across files. This behavior creates a subtle difference on our codebase when we start comparing by value or by reference.
`char * ` fields from `RawPropsKey.h` are using `==` which compares by its address. Here, we cast the buffer to a string to make the comparison, while avoiding the cast if one happens to be null.
Changelog: [Internal]
Reviewed By: int3, JoshuaGross
Differential Revision: D30444176
fbshipit-source-id: 74216926803adbece05206ddd8478cc3c8e6812e
Summary:
Changelog:
Add UIAccessibilityTraitUpdatesFrequently when the AccessibilityRole is set to progressBar. This trait tells the accessibility system where content may change with every percentage point, but without annoying the user with constant announcements.
Reviewed By: ikenwoo
Differential Revision: D30510587
fbshipit-source-id: e75690a2a56ce42476dc999383cf58c0811fcbdf
Summary:
This diff is part of a bigger effort to remove the RTTI flags.
To do so we need to remove occurrences of `dynamic_cast` and other functions that rely on runtime
type informations.
Changelog:
[Internal][Changed] - Removed extra asserts relying on dynamic_cast
Reviewed By: JoshuaGross
Differential Revision: D30483554
fbshipit-source-id: 92b31281841a92c7b43e918938248431265dd654
Summary:
Changelog:
Add the capability to set tabbar accessibilityRole which maps to the iOS's UIAccessibilityTraitsTabBar
Reviewed By: yungsters
Differential Revision: D30490752
fbshipit-source-id: f7561a8932306e133d2f65a5ab40ba0be3899ec3
Summary:
Changelog: [iOS][Added]
1. Added new primitive type "Selection" to C++
2. Added property "selection" to TextInputProps
3. Added parser for that
Reviewed By: sammy-SC
Differential Revision: D30043256
fbshipit-source-id: eefa67ca23759761901cba1d2ab3052877a153a7
Summary:
Changelog: [internal]
Logger needs to be supplied to YGConfig, otherwise the app crashes when Yoga tries to log.
Reviewed By: fkgozali
Differential Revision: D30394676
fbshipit-source-id: bda464a4e43cb815c00650e1fedf43fe0a06f973
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/32042
This diff moves react_native_log out of utils to make it easier/possible to import from modules.
Changelog: [internal]
Reviewed By: JoshuaGross
Differential Revision: D30411247
fbshipit-source-id: 5482761b259600df051a88c6eff1834c882e7230
Summary:
Fabric core uses a lot of traits - I am reserving a few more for core usage, and also exposing a few "unreserved" traits.
It is recommended that all custom components that do use traits rely on these constants instead of hard-coding any trait values. That way, in the unlikely event that these values change in the future, it will not break components.
Changelog: [Internal]
Reviewed By: cortinico, RSNara
Differential Revision: D30401743
fbshipit-source-id: fb2e8f5cf33c94e31a0c25a89055acfc4eccf066
Summary:
In this diff:
1. Convert the ReactNativeLogger to c function for the future compatibility.
2. Bind the log function from Catalyst app
3. Update the call site
Changelog: [internal]
Reviewed By: JoshuaGross
Differential Revision: D30271863
fbshipit-source-id: 4c0ea704cf19f53468a3b72631353959ea999884
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/31998
Overall Context: We want to add a way to log errors (e.g. mustfix, warn, etc on the server with stack trace) without crashing the app (e.g. react_native_assert crashes the app).
This diff: I am writing very simple logger functions which will get resolved at build time depending on the platforms/apps.
Changelog: [internal]
Reviewed By: JoshuaGross
Differential Revision: D30174404
fbshipit-source-id: 2e5bc865dd8576c5a758c56e080a1e582a8c3ada
Summary:
Changelog: [Internal]
when we try to write a `SharedColor` type prop in the renderer, the template function we match to is the following:
https://www.internalfb.com/intern/diffusion/FBS/browsefile/master/xplat/js/react-native-github/ReactCommon/react/renderer/core/propsConversions.h?commit=28dacb972cda702d37dedd4612bc67c212d4d9eb&lines=108-132
this is because `SharedColor` is an alias of `better::optional<Color>`. ultimately, this causes a crash in L130 - the template deduction in L130 interprets the T as an `int`, rather than `SharedColor`, but our `rawValue` is pointing to `SharedColor`.
there was a number of options i considered, but didn't feel the most correct:
- wrapping `SharedColor` in another `better::optional` - this felt like a hack and didn't really provide any real benefits of the `optional` wrapper.
- writing a template specialization on SharedColor - this didn't seem future proof because we could introduce another type that could potentially wrap an integer, which doesn't seem impossible in the future - then we would get some conflict with our `SharedColor` conversion, which is custom to the behavior of colors.
- coercing the template during the function call - from an engineering perspective, this didn't seem like a great idea since it isn't clear to the engineer that this would be necessary and they would most likely only find out to do this after seeing a crash on their builds.
i ultimately decided to convert `SharedColor` to a simple class wrapper, similar to the implementation already used in Android. this alleviates all of the concerns with the other options above.
Reviewed By: sammy-SC
Differential Revision: D30149880
fbshipit-source-id: 7e8abafcd9fd7465b13ef227d140e859f8df6ecd
Summary:
Changelog: [Internal]
in this diff, we iterate through the list of color passed down in the props, and write the RGBA value of the first valid UIColor
Reviewed By: sammy-SC
Differential Revision: D30110297
fbshipit-source-id: c6730110129d0fe1f784fa89cd26b46d3dda7f28
Summary:
Changelog: [Internal]
in this diff, we add the logic to handle converting PlatformColor strings to their corresponding RGBA values, using `UIColor`'s API as the source of truth of these colors.
functionality not covered yet:
- customColor
- iOS Dynamic Colors
- Variant Colors
Reviewed By: sammy-SC
Differential Revision: D30103451
fbshipit-source-id: 7d7be0f08dc2fb95b606b8f5d73784766787a574
Summary:
This diff is cleaning up some configurations in the `Android.mk` files
of the native build. Specifically I simplified some of the rules and removed
a duplicate file specification.
Changelog:
Internal - Cleanup warnings in the NDK build
Reviewed By: ShikaSD
Differential Revision: D30220715
fbshipit-source-id: a100953fe977879a6d28cb0a2ef4b3358fb7c774