Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/48029
Changelog: [Internal]
Adding snapshot support for rendered output only for now.
This will only work if snapshot is created beforehand by hand.
# Next steps
* Create snapshot when no prior snapshot is available
* Pass and update if instructed
Reviewed By: christophpurrer
Differential Revision: D66601387
fbshipit-source-id: fe528cded43c5ba36d314bd9af8e3fb84b98ac3e
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/47939
Before we were clipping Android background drawable to the padding box. This is not how its done on web.
The background should remain under the border so that if the border is traslucent you can see the background underneath
Reviewed By: NickGerleman
Differential Revision: D66463305
fbshipit-source-id: 427acea760b2748a07cc28bbd362aaaae0811093
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/48133
[Changelog] [Internal] - Share common (Base)TextInputState properties
This change allows to share common TextInput State properties between various platforms.
Reviewed By: rshest
Differential Revision: D66855831
fbshipit-source-id: d0f85c419b82445ac84bfcc606f1bf752f5dba73
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/47973
Gap can be styled using both `points` and `percentages`, but YGNodeStyleGetGap currently returns a float value.
To maintain alignment with the `padding` and `margin` functionalities and allow it to be handled in bridging code, this function has been updated to return YGValue.
X-link: https://github.com/facebook/yoga/pull/1753
Reviewed By: joevilches
Differential Revision: D66513236
Pulled By: NickGerleman
fbshipit-source-id: b7110855c037f20780f031f22a945bde4446687d
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/48161
[Changelog] [Internal] - Remove unused defaultThemePaddingStart|End|Top|Bottom from AndroidTextInputState
This data is set, but never read
Reviewed By: javache
Differential Revision: D66904641
fbshipit-source-id: 4db1cd49e9ec63b62f75070b478d2006ea101f8c
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/48180
Changelog: [Internal]
Releasing runtime shadow node reference updates, enabling it by default now that the fix for RN Windows landed.
Reviewed By: javache
Differential Revision: D66959896
fbshipit-source-id: dcf1c4a7257fe60ae0faffe1952fc2c80effe406
Summary:
Fixes https://github.com/facebook/react-native/issues/47045
On Android `adjustsFontSizeToFit` relies on two metrics:
- Text with line breaks results in more lines than `maximumNumberOfLines`
- The overall height of the text is larger than the available height
None of these two was fulfilled when a single-character string had a higher width than the available one (a single character will not be broken into multiple lines). This PR adds exactly that as a third option to trigger the scaling algorithm - a single-character string that has a higher width than the available one.
On iOS `adjustsFontSizeToFit` relies on `truncatedGlyphRangeInLineFragmentForGlyphAtIndex` which seems to be returning `NSNotFound` when a single-character sting gets truncated. Similarly to Android, this PR adds an additional check to make sure that single-character strings actually fit inside the container.
## Changelog:
[GENERAL] [FIXED] - Fixed `adjustsFontSizeToFit` not working for text with a single character
Pull Request resolved: https://github.com/facebook/react-native/pull/47082
Test Plan:
Tested on the code from the issue:
|Android (old arch)|Android (new arch)|iOS (old arch)|iOS (new arch)|
|-|-|-|-|
|<img width="406" alt="android_old" src="https://github.com/user-attachments/assets/91b1af41-4ef7-46cc-bb04-374f860d93ac">|<img width="406" alt="android_new" src="https://github.com/user-attachments/assets/90e3cde1-e6c0-4b25-8325-c62a37773002">|<img width="546" alt="ios_old" src="https://github.com/user-attachments/assets/902b9c10-84e0-4372-bcc8-07cd1ef006f6">|<img width="546" alt="ios_new" src="https://github.com/user-attachments/assets/f4df4f0e-7649-47f3-9c81-e38f8665d9a2">|
Reviewed By: javache
Differential Revision: D64664351
Pulled By: NickGerleman
fbshipit-source-id: b68f318a0fbd5ebed947a70d1e3fb0515b5fb409
Summary:
Fixes an [issue](https://github.com/facebook/react-native/issues/48168) where only iOS configurations with "Debug" in the name are configured to use the hermes debugger.
## Changelog:
<!-- Help reviewers and the release process by writing your own changelog entry.
Pick one each for the category and type tags:
For more details, see:
https://reactnative.dev/contributing/changelogs-in-pull-requests
-->
[IOS] [FIXED] - Enable hermes debugger by configuration type instead of configuration name
Pull Request resolved: https://github.com/facebook/react-native/pull/48174
Test Plan:
Added new test scenarios that all pass:
```
ruby -Itest packages/react-native/scripts/cocoapods/__tests__/utils-test.rb
Loaded suite packages/react-native/scripts/cocoapods/__tests__/utils-test
Started
Finished in 0.336047 seconds.
-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
56 tests, 149 assertions, 0 failures, 0 errors, 0 pendings, 0 omissions, 0 notifications
100% passed
-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
166.64 tests/s, 443.39 assertions/s
```
In a personal project with the following configurations:
```
project 'ReactNativeProject', {
'Local' => :debug,
'Development' => :release,
'Staging' => :release,
'Production' => :release,
}
```
I added the following to my Podfile:
```
installer.pods_project.targets.each do |target|
target.build_configurations.each do |config|
puts "#{config.name} is debug? #{config.type == :debug}"
end
end
```
To confirm that my logic is correct:
```
Local is debug? true
Development is debug? false
Staging is debug? false
Production is debug? false
```
Reviewed By: robhogan
Differential Revision: D66962860
Pulled By: cipolleschi
fbshipit-source-id: 7bd920e123c9064c8a1b5d45df546ff5d2a7d8be
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/48113
Processing cookies can have a non-trivial impact on startup-time. It requires reading OkHttp's `PublicSuffixDatabase` but also allocating various WebKit components. Instead handle the cookiejar being set to non-CookieJarContainer instances gracefully, which allows a custom client builder to set `CookieJar.NO_COOKIES`.
Changelog: [Internal]
Reviewed By: cortinico
Differential Revision: D66787514
fbshipit-source-id: bf790691496f674ec743ba4791552b12e06eda29
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/48178
Changelog: [internal]
Adds a new mode for Fantom to run tests with dev-mode bytecode. Right now the modes were only dev (development with source code) or opt (optimized bytecode).
Reviewed By: rshest
Differential Revision: D66888986
fbshipit-source-id: 34b2566a65d138790e16f8fb5787fd9c2bcde536
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/48179
Changelog: [internal]
Migrating this type to an enum, which is safer, because it prevents errors like:
```
// when it's actually 'dev'
if (mode === 'development') {
}
```
Reviewed By: rshest
Differential Revision: D66888985
fbshipit-source-id: 4f3f91fad6ca5256baa2123425b2bad11fe036f9
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/48151
Changelog: [internal]
We have global setup step in Fantom to prewarm caches to properly attribute test running time, but this isn't necessary when running tests locally. Attribution isn't as important there. This disables the prewarming step so we can run individual tests as fast as we can.
Reviewed By: sammy-SC
Differential Revision: D66877990
fbshipit-source-id: 1f33c19a3c537c1c0e499fd7a6c405450cb9f86d
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/48150
Changelog: [internal]
We're starting to have some Fantom tests that run in optimized mode, but we're not currently prewarming for that case. This adds that capability to do proper attribution of run time for tests.
Reviewed By: javache
Differential Revision: D66877991
fbshipit-source-id: dccb80cd6a4f664de7df0661456bad78d960826d
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/48123
Changelog: [internal]
This verifies that the modes specified in the pragmas are applied correctly.
Reviewed By: andrewdacenko
Differential Revision: D66822377
fbshipit-source-id: 420f21f171c5d356ab91b49f7a33345386f6f0c0
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/48012
Match the OkHttp version we use for NetworkingModule and FrescoModule, to unblock pulling in D66498305
Changelog: [Internal]
Reviewed By: cortinico
Differential Revision: D66595222
fbshipit-source-id: 1c29b061866be5d8bcc87aaa0c8a1de846198e4e
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/48136
[Changelog] [Internal] - Remove unused code in AndroidTextInputShadowNode.h|cpp
A bit of code clean-up to simplify a planned refactoring of this class
Reviewed By: rshest
Differential Revision: D66862820
fbshipit-source-id: 88114d8711b572f105d804cdddc6c087c94e3f49
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/48094
There were a few math inaccuracies in the algorithm for overlapping radii. After fixing there were also minor pixel differences on the unit tests but this is the most correct implementation.
Also, improved the algorithm's verbiage since stuff like "EdgeInset" is not really related and is misleading to what the algorithm is actually doing. (Edge Insets play no part in this)
Changelog: [Internal]
Reviewed By: NickGerleman
Differential Revision: D66728227
fbshipit-source-id: 56a6d59504e784fc245ed6fe306402a15cfd9611
Summary:
X-link: https://github.com/facebook/yoga/pull/1763
Pull Request resolved: https://github.com/facebook/react-native/pull/48080
Small bug that I noticed while doing intrinsic sizing. We have the ownerHeight as the axis size despite bounding the length of the cross axis. This should therefore be the crossAxisOwnerSize, which might be the width in some cases
Changelog: [Internal]
Reviewed By: NickGerleman
Differential Revision: D66736539
fbshipit-source-id: 528fc438b3327cd6f7890ea0ba408e4ce7b0f02c
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/48129
Continuation of https://github.com/facebook/react-native/pull/48106
* Every AnimatedNode subclasses now have an optional `config` arg as last arg in constructor. `Animation` base constructor already takes in config with debugID, since last PR.
* thread down debugID value to all the native configs
Changelog: [Internal] Allow setting debugID on all types of AnimatedNode and Animation
Reviewed By: yungsters
Differential Revision: D66834935
fbshipit-source-id: 18e5cbc3f701114ef945a237cb5944ef5eb6408e
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/48127
[Changelog] [Internal] - Allow to provide a custom TextLayoutManager for cxx platform
This change allows target platforms to pass a platform specific or app specific TextLayoutManager implementation
Reviewed By: zeyap
Differential Revision: D66802434
fbshipit-source-id: a64e28d357bf601c7234b43f86538f49e62c8435
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/48100
This diff renames `shouldNotify` to `shouldNotifyLoadEvents` as it is named in the spec.
Changelog: [Internal]
Reviewed By: javache
Differential Revision: D66769660
fbshipit-source-id: 64282c08ab82101d51dedb583e0c34476ed90eeb
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/48124
Fixes https://github.com/facebook/react-native/issues/47592
The logic in HeadlessJsTaskService is broken. We should not check whether `getReactContext` is null or not.
Instead we should use the `enableBridgelessArchitecture` feature flag to understand if New Architecture was enabled or not.
The problem we were having is that `HeadlessJsTaskService` was attempting to load the New Architecture even if the user would have it turned off. The Service would then die attempting to load `libappmodules.so` which was correctly missing.
Changelog:
[Android] [Fixed] - Fix crash on HeadlessJsTaskService on old architecture
Reviewed By: javache
Differential Revision: D66826271
fbshipit-source-id: 2b8418e0b01b65014cdbfd0ec2f843420a15f9db
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/48146
The NoRetryPolicy class is `internal`. Having those `public` modifiers on methods has no effect
and can be safely removed.
Changelog:
[Internal] [Changed] -
Reviewed By: fabriziocucci
Differential Revision: D66875443
fbshipit-source-id: 64c63c7000617cf94c36ce3d25927d3a270ac370
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/48132
Backs out D63573322 and D65645981, reverting the change that makes callbacks passed to `animation.start(<callback>)` scheduled for execution in a microtask.
This is being reverted becuase the latency introduced by the current macro and pending micro tasks can introduce visible latency artifacts that diminish the fidelity of animations.
Changelog:
[General][Changed] - Reverts #47503. (~~Callbacks passed to `animation.start(<callback>)` will be scheduled for execution in a microtask. Previously, there were certain scenarios in which the callback could be synchronously executed by `start`.~~)
Reviewed By: javache
Differential Revision: D66852804
fbshipit-source-id: 08434b9876813fe9e8b189b6b467198933843bf0
Summary:
Someone always has to merge in from Meta, so this is just noise.
Refactored some of this older code.
Changelog: [Internal]
Pull Request resolved: https://github.com/facebook/react-native/pull/48148
Test Plan:
This PR, but this doesn't build a lot of confidence:
{F1973526183}
Reviewed By: rubennorte
Differential Revision: D66876722
Pulled By: blakef
fbshipit-source-id: 52e1f15577f8f057ceee9427af65df43f152bffa
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/48143
Changelog: [internal]
Just a small cleanup to move `jest/integration/*` to `packages/react-native-fantom`, so everything related to Fantom (config, runner, runtime, etc.) is in the same directory.
Reviewed By: javache
Differential Revision: D66874763
fbshipit-source-id: 8b87d7320c7704f7ce6cd58761508193784f5ce2
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/48142
Changelog: [internal]
This is the default export from the `react-native/fantom` package and it makes sense to be called that way. Also, this is similar to the `jest` global.
Reviewed By: javache
Differential Revision: D66874225
fbshipit-source-id: 8b43a637ebb42b5b1acb9ea5a6dbedd4c1a4f9e0
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/48141
Changelog: [internal]
This just aligns the file name with the common convention to name modules with the same name as their default export (if any).
Reviewed By: javache
Differential Revision: D66874227
fbshipit-source-id: 2a619b434c26a29f1774cba1c32ba711b1a7af46
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/48140
Changelog: [internal]
These tests test an API that's part of `ReactNativeTester` (will be renamed as `Fantom`) so it makes sense that they're in the same test file as the tests for the rest of the API.
Reviewed By: javache
Differential Revision: D66874226
fbshipit-source-id: f17e14c83cb5ca95ac619c5398c49ad84a27cfa5
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/48125
Changelog: [internal]
This just moves the runtime modules for Fantom to its own package.
Reviewed By: javache
Differential Revision: D66825478
fbshipit-source-id: ac4dbc23b86895f09abc46345d497c1c53737ae2
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/48145
While writing the docs for 0.77, I found an edge case in the generation of the RCTThirdPartyComponentProvider:
* If the app has the `codegenConfig` field set in the `package.json`
* And it does not have the `ios.componentProvider` field is not provided
Codegen was generating the mapping for the react-native core components. That's not expected as, in that case, it should only generate components that are declared in the app or in libraries.
This change fixes this edge case.
## Changelog:
[Internal] - Exclude mapping generation of core component
Reviewed By: blakef
Differential Revision: D66875080
fbshipit-source-id: 65fe10381729ec7808efec70feacf2a55f0056e9
Summary:
This PR adds `pointerEvents` to the `TextProps` type.
### Motivation:
The `pointerEvents` property is already supported in `Text` components internally, but it was missing from the TypeScript definitions. By adding it to `TextProps`, developers can now use this property with full type safety and without TypeScript errors.
This is a type-only change and does not introduce any functional modifications.
## Changelog:
[GENERAL] [ADDED] - Added `pointerEvents` to `TextProps` type.
Pull Request resolved: https://github.com/facebook/react-native/pull/48081
Test Plan:
As this is a type-only update:
- Verified that the `pointerEvents` property is now recognized when used with `Text` components in TypeScript projects.
- Ensured there are no runtime changes or regressions by testing existing `Text` components for expected behavior.
Reviewed By: cipolleschi
Differential Revision: D66753454
Pulled By: javache
fbshipit-source-id: c8f21b11daa6001a309b1d29fd6259101d11f5d2
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/48062
We never need the full ShadowView representation of `parent` and this is significantly cheaper to construct and pass around.
Changelog: [Internal]
Reviewed By: rubennorte
Differential Revision: D66656411
fbshipit-source-id: 0b20e04c6beb95c498350085ec06fd57d1c11237
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/48106
This could make it easier to locate and debug AnimatedValue and driver from native - so far on the native side of animated, the only way to identify an Animation driver or AnimatedNode is integer IDs and the type, which made it difficult to debug when surface gets complicated
Here I only enabled it for AnimatedValue and TimingAnimation, because
* TimingAnimation is most commonly used
* all the animation drivers (frames, spring, decay) can only drive Value type of AnimatedNode on the native side, so it's the primitive component of AnimatedNode
Changelog: [Internal]
Reviewed By: yungsters
Differential Revision: D66790298
fbshipit-source-id: ddd64a5728120f061aa902f25c93b1701617031b
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/47530
Adds the default implementation for `getStringData`/`getPropNameIdData`
for VMs that do not provide their own implementation
Changelog: [Internal]
Reviewed By: neildhar
Differential Revision: D65638889
fbshipit-source-id: 0a97569433c09ffafbd08fec5d9c9fbf5639b778
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/48109
[Changelog] [Internal] - Allow to provide a custom ImageManager for cxx platform
This change allows target platforms to pass a platform specific or app specific ImageManager implementation
Reviewed By: javache
Differential Revision: D66788794
fbshipit-source-id: d7e99cae5de0a4c60047763dce368271dd191b9c
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/48097
Changelog: [internal]
As per title, this allows us to specify both common and JS-only feature flags for tests in the docblock as pragmas (in the same pragma separated by spaces, or in different pragmas). E.g.:
```
/**
* fantom_flags commonTestFlag:true
* fantom_flags jsOnlyTestFlag:true
*/
```
The feature flags are overridden automatically for us before the tests start.
Reviewed By: javache
Differential Revision: D66760121
fbshipit-source-id: 7e227e0035a170dab81b1e6ce39600a01a748867