Summary:
I've doing some enhancements around the Image component for Android, and in the process of understanding the codebase I saw some opportunity to improve the test cases as there is no much coverage around the underlying functionality.
## Changelog:
[INTERNAL] [ADDED] - Improving Android Image property test cases
Pull Request resolved: https://github.com/facebook/react-native/pull/47433
Test Plan:
```bash
yarn test-android
```
Reviewed By: javache
Differential Revision: D65530813
Pulled By: cortinico
fbshipit-source-id: b314eaf7493c6f3c859b7cb0d06771c109e5e854
Summary:
I forgot to add some `\n` in the bot messages. This fixes it.
## Changelog:
[INTERNAL] - Add missing `\n` on actOnLabel.js
Pull Request resolved: https://github.com/facebook/react-native/pull/47451
Test Plan: N/A
Reviewed By: cipolleschi
Differential Revision: D65533495
Pulled By: cortinico
fbshipit-source-id: c2214d00800f6b70ec331a9ae72578414f50cd43
Summary:
Changelog:
[General][Added] Use the TypeScript key in syntax to restrict permissions and types of results
- Use key in 'GRANTED' | 'DENIED' | 'NEVER_ASK_AGAIN for RESULTS constants to ensure that only these values are allowed
- Use a detailed list of permission names for PERMISSIONS constants to restrict the type of key
Pull Request resolved: https://github.com/facebook/react-native/pull/47299
Reviewed By: yungsters
Differential Revision: D65480410
Pulled By: tdn120
fbshipit-source-id: ec23750d72ede0ba6ed96e80c35242da08b2508e
Summary:
When decoupling the community-cli-plugin from the react-native-community/cli-server-api (https://github.com/facebook/react-native/issues/45311), a middleware stub was created to allow a runtime stub to be used in this case. This middleware should be used so as not to break when the optional cli-server-api dependency isn't present.
Changelog:
[General][Fixed] - Fix npm react-native start when cli-server-api isn't installed
Pull Request resolved: https://github.com/facebook/react-native/pull/47450
Test Plan:
Forced a runtime exception simulating the package not being dependent and was able to build rn-tester.
![CleanShot 2024-11-06 at 10 49 58@2x](https://github.com/user-attachments/assets/c040ec5b-7000-43bd-ba54-52a672ff3675)
Reviewed By: cipolleschi
Differential Revision: D65532486
Pulled By: blakef
fbshipit-source-id: 2b380607de63ac2da906ef0cb1e48b9ef263cb68
Summary:
In order to use a reusable workflow in GHA, we need first to checkout the repository so the action has access to the other workflows.
## Changelog:
[Internal] - Add checkout step to Check Nightlies
Pull Request resolved: https://github.com/facebook/react-native/pull/47448
Test Plan: GHA - https://github.com/facebook/react-native/actions/runs/11702038686?pr=47448
Reviewed By: cortinico
Differential Revision: D65532274
Pulled By: cipolleschi
fbshipit-source-id: 58117ac81973e3c07829d73d5bde4e6fd4d212f9
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/47434
Migrate ReactVirtualTextShadowNode to kotlin and make it internal
changelog: [Android][Breaking] Reduce visibility of ReactVirtualTextShadowNode to internal
Reviewed By: shwanton
Differential Revision: D65493927
fbshipit-source-id: 2b5997d000b5dc489ba93edb226455ef0855b98b
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/47432
In this diff we are excluding the $$PropSetter classes from public API, we do this by adding the UnstableReactNativeAPI annotation on all $$PropSetter classes
changelog: [internal] internal
Reviewed By: cortinico
Differential Revision: D65488026
fbshipit-source-id: 9f1bbe7b25fa69c0a40f6cb0ff38a8ae6ee8d97d
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/47350
Changelog: [Internal]
we don't need any of these now since no one is calling `contextContainer_->at<std::shared_ptr>("ReactNativeConfig")` anymore
Reviewed By: NickGerleman
Differential Revision: D65304976
fbshipit-source-id: 5f835ab9ac429aa1942cc8d9669812c1ac994238
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/46868
jsBuild prasing was done at the js level.
But, for the c++ pipeline, we have to parse the js build in native.
Changelog: [Internal]
Reviewed By: javache
Differential Revision: D63927093
fbshipit-source-id: ce7ee46714ee0e72e450003330dbca78acb264a3
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/47428
This changes the messages that the bot is printing.
I've moved from using a table to using GitHub's admonitions that
renders nicely are are more informative.
Changelog:
[Internal] [Changed] - Update messages for react-native-bot
Reviewed By: mdvacca
Differential Revision: D65485633
fbshipit-source-id: f43f7bd75280bfd0aceab48b2517306c1057b778
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/47427
I've noticed that react-native-bot posts twice once we can't find a reproducer.
(see here: https://github.com/facebook/react-native/issues/47421)
This fixes it by letting it post only once.
Changelog:
[Internal] [Changed] - Prevent react-native-bot from double posting on missing reproducer
Reviewed By: mdvacca
Differential Revision: D65485634
fbshipit-source-id: dbe9b1311aef246dead6d9b922c1256363e894f7
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/47423
cipolleschi found out that we broke the `ReactViewGroup` constructor when making this class Nullsafe.
Specifically now users would need to pass a `Context` and not a `Context?` as libraries will break (and this will break a lot of them).
So I'm undoing this change by annotating this parameter as Nullable.
Changelog:
[Android] [Changed] - Undo a breaking change on ReactViewGroup constructor
Reviewed By: tdn120
Differential Revision: D65483379
fbshipit-source-id: 43f7bcab5f10b1b8b5601de1dab314d7bbb1eefe
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/47385
BridgelessCatalystInstance class is deprecated, please to migrate to new architecture using [com.facebook.react.defaults.DefaultReactHost] instead.
changelog: [Android][Changed] Deprecate BridgelessCatalystInstance class
Reviewed By: cortinico
Differential Revision: D65430789
fbshipit-source-id: 011b372c93c39862d5821713aa8f673084b52c2a
Summary:
X-link: https://github.com/facebook/yoga/pull/1736
Pull Request resolved: https://github.com/facebook/react-native/pull/47358
`LayoutableChildren<yoga::Node>::Iterator` showed up to a surprising extent on a recent trace. Part of this was during pixel grid rounding, which does full tree traversal (we should fix that...), where the iterator is the first thing to read from the node.
I ran Yoga microbenchmark with Yoga compiled with `-O2`, where we saw a regression of synthetic performance by ~10%, but it turns out this build also had ASAN and some other heavy bits enabled, so the real impact was quite lower (~6%).
I was able to make some optimizations in the meantime against that, which still show some minor wins, reducing that overhead to ~4% in the properly optimized build (and a bit more before that). This is still measurable on the beefy server, and the code is a bit cleaner, so let's commit these!
Note that, in real scenarios, measure functions may dominate layout time, so display: contents does not mean end-to-end 4% regression, even after this change.
This change makes a few different optimizations
1. Removes redundant copies
2. Removes redundant index keeping
3. Mark which branches are likely vs unlikely
4. Shrink iterator size from 6 pointers to 3 pointers
5. Avoid usage in pixel grid rounding (so we don't need to have cache read for style)
In "Huge nested layout" example
| Before display: contents support | After display: contents support | After optimizations |
| 9.77ms | 10.39ms | 10.17ms |
Changelog: [Internal]
Reviewed By: rozele
Differential Revision: D65336148
fbshipit-source-id: 01c592771ed7accf2d87dddd5a3a9e0225098b56
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/47417
Backing out this change as it was breaking an internal app. I'll reland this next week when I have more time.
## Changelog:
[iOS][Changed] - Revert fix that checks whether an image is present on disk.
## Facebook:
This is breaking twilight.
Differential Revision: D65479912
fbshipit-source-id: dcd5ac5f3d98ba2f10b9519f09d3eb1fd454da61
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/47368
This class should be internal and has no meaningful usages outside of React Native.
See https://github.com/search?type=code&q=%22DevLoadingModule%3A%3Aclass%22
So technically breaking but I expect no impact for OSS at all.
Changelog:
[Android] [Breaking] - Make `DevLoadingModule` internal
Reviewed By: javache
Differential Revision: D64725164
fbshipit-source-id: 5f39e609c611662c71cc08bffa195f7bea5db5bd
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/47371
This interface should have not been exposed in the first place.
I'm converting it to Kotlin + making it `internal`.
I found no meaningful usage in OSS so I expect no breakages.
Changelog:
[Android] [Breaking] - Stable API - Convert to Kotlin and make internal `NotThreadSafeViewHierarchyUpdateDebugListener`
Reviewed By: javache
Differential Revision: D65420912
fbshipit-source-id: 5afdb013f588a5698b4e7467a7f1096c24d1733e
Summary:
Fixes https://github.com/facebook/react-native/issues/47352
This fixes a bug when the user is providing its own CMakeLists.txt file say because they want to compile more C++ code than we actually provide.
Previously the `*.cpp` will evalute file in the current directory, meaning that the app's default `OnLoad.cpp` file would be ignored.
## Changelog:
[ANDROID] [FIXED] - Use absolute path when compiling appmodules.so sources
Pull Request resolved: https://github.com/facebook/react-native/pull/47379
Test Plan:
Tested against the reproducer provided in:
- Use absolute path when compiling appmodules.so sources
Reviewed By: cipolleschi
Differential Revision: D65428676
Pulled By: cortinico
fbshipit-source-id: 7f3e4d470da0fffc5191c1a2c7e8fec517fee496
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/47378
The RCTMD5Hash in RCTUtils is using CC_MD5 function which is deprecated. unfortunately we can't really change it or we will break many apps that use it in the AsyncStorage.
Those app wlll have to do a migration to use a different function. Meanwhile we are suppressing the warning
## Changelog
[Internal] - Suppress CC_MD5 warning
Reviewed By: cortinico
Differential Revision: D65424309
fbshipit-source-id: e0258ae68482f6c4a3a865bb52920f87bc5ada21
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/47391
React Native can preload before the activity is available.
Preloading will execute the js bundle. If the js bundle throws an error, it'll try to render a redbox.
If the activity isn't available, and hasn't been set on the react instance yet, the redbox will just render nothing.
## Changes
In this diff, just re-try displaying the redbox after the application sets the activity on the react instance (i.e: calls onHostResume(activity)).
Changelog: [Android][Breaking] - Rename DevSupportManagerBase.getCurrentContext() -> getCurrentReactContext()
Reviewed By: mdvacca
Differential Revision: D65352596
fbshipit-source-id: 7750f6ca493fc50405119958e0f2908fc24f1cb4
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/47396
Migrate ReactUnimplementedViewManager to internal visibility
verified and there are usages on OSS
changelog: [Android][Breaking] Reduce visibility of ReactUnimplementedViewManager to internal
Reviewed By: cortinico
Differential Revision: D65444514
fbshipit-source-id: 11ff2acc96098bc4e53be7ef3059e4a5c112c43e
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/46939
X-link: https://github.com/facebook/yoga/pull/1722
tsia! opted for one function for each keyword just like auto. This is kinda annoying and not the most sustainable, so maybe it makes more sense to make a new enum here and just add one function
Changelog: [Internal]
Reviewed By: NickGerleman
Differential Revision: D64002837
fbshipit-source-id: f15fae9fc0103175e1d85850fc9aa68579989fd3
Summary:
X-link: https://github.com/facebook/yoga/pull/1721
Pull Request resolved: https://github.com/facebook/react-native/pull/46938
The private internals of how we store styles needed to change a bit to support 3 new keyword values. Right now the only other keyword that can be stored is `auto`. As a result there isn't much fancy logic to support storing this and its just stored as a specific type inside of `StyleValueHandle`. There are only 3 bits for types (8 values), so it is not sustainable to just stuff every keyword in there. So the change writes the keyword as a value with a new `keyword` `Type`.
I chose not to put `auto` in there even though it is a keyword since it is a hot path, I did not want to regress perf when I did not need to.
I also make a new `StyleSizeValue` class to store size values - so values for `width`, `height`, etc. This way these new keywords are kept specific to sizes and we will not be able to create, for example, a margin: `max-content`.
Changelog: [Internal]
Reviewed By: NickGerleman
Differential Revision: D63927512
fbshipit-source-id: 7285469d37ac4b05226183b56275c77f0c06996c
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/47324
I need to reference this type somewhere else, but not an array of the type.
Generally we prefer that all exported types are the object itself, and it used as a member type of arrays when used.
Changelog: [Internal]
Reviewed By: makovkastar
Differential Revision: D65259014
fbshipit-source-id: 35fb5fe03a44bed61ad87337d0fc5c198744c0e9
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/47323
This change adds support for number literals as a type.
The codegen already has parsing support for these types
```
+passNumber: (arg: number) => void;
+passString: (arg: string) => void;
+passStringLiteral: (arg: 'A String Literal') => void;
```
This change now also supports
```
+passNumberLiteral: (arg: 4) => void;
```
On the native side this is treated the same as `number`. It could be strengthened in the future.
This is a pre-requisite for number literal unions and enums.
Changelog: [Added] Codegen: Added support for Number literals in native module specs
Reviewed By: makovkastar
Differential Revision: D65249334
fbshipit-source-id: 98b051d2a6bd1ad5cc6473ac88acfcbe82bd5c7d
Summary:
Those 2 classes are not supposed to be exposed externally, so I'm making them internal.
The were never part of the public API so I'm not marking this commit as [BREAKING]
Changelog:
[Android] [Changed] - Make ReactDebugOverlayTags, DebugOverlayTags, Printer, PrinterHolder, NoopPrinter internal
Reviewed By: fabriziocucci
Differential Revision: D65420257
fbshipit-source-id: b870274e84d9c3202b9f21360c29eeb995a8d52b
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/47374
I've converted this class to Kotlin + made it `internal` as it should not be exposed publicly.
This class is part of the iterop layer for the New Architecture.
Marked as breaking but I expect no meaningful breakages here.
Changelog:
[Android] [Breaking] - Stable API - Make InteropModuleRegistry internal
Reviewed By: javache
Differential Revision: D65421965
fbshipit-source-id: 207be5379ebe3a31530cfea75b4623787f5ae7cf