Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/44970
These Jest unit test cases were making assertions about shallow rendering, but that shallow rendering is now deprecated.
Changelog:
[Internal]
Reviewed By: robhogan
Differential Revision: D58643058
fbshipit-source-id: 75c95b3ef8f9c481b50d90bf195ba3bd90196f0b
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/44975
These Jest unit test cases were making assertions about shallow rendering, but that shallow rendering is now deprecated.
Changelog:
[Internal]
Reviewed By: robhogan
Differential Revision: D58643064
fbshipit-source-id: 19cb05df25b4b92ee584ea126d238276f5b214f7
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/44981
Migrates this Jest unit test away from using `react-shallow-renderer` because it is no longer recommended.
Changelog:
[Internal]
Reviewed By: robhogan
Differential Revision: D58643062
fbshipit-source-id: 6d7bba78945509bbb6bdab1e6347ba0d90343ec3
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/44971
Migrates this Jest unit test away from using `react-shallow-renderer` because it is no longer recommended.
Changelog:
[Internal]
Reviewed By: robhogan
Differential Revision: D58643068
fbshipit-source-id: f3a0331140fbaa9ee19b76da8700e60b3efc525a
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/44976
Migrates this Jest unit test away from using `react-shallow-renderer` because it is no longer recommended.
Changelog:
[Internal]
Reviewed By: robhogan
Differential Revision: D58643067
fbshipit-source-id: 2e298e2736227afb9322463daa3db0578638559a
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/44969
Migrates this Jest unit test away from using `react-shallow-renderer` because it is no longer recommended.
Changelog:
[Internal]
Reviewed By: robhogan
Differential Revision: D58643057
fbshipit-source-id: 0d2943a714ca718841ab4bec5a33f6c9e48fea92
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/44986
Migrates this Jest unit test away from using `react-shallow-renderer` because it is no longer recommended.
Changelog:
[Internal]
Reviewed By: robhogan
Differential Revision: D58643069
fbshipit-source-id: a2dbba104a7f6af57b6990da3cb0055a5390bc00
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/44983
Migrates this Jest unit test away from using `react-shallow-renderer` because it is no longer recommended.
Changelog:
[Internal]
Reviewed By: robhogan
Differential Revision: D58643056
fbshipit-source-id: 61494765f68f1810b19a33f5e2a6c5d4087ce11c
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/44972
Migrates this Jest unit test away from using `react-shallow-renderer` because it is no longer recommended.
Changelog:
[Internal]
Reviewed By: robhogan
Differential Revision: D58643055
fbshipit-source-id: 419fe07643f623e75050487beb9ca306417e43d9
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/44978
Migrates this Jest unit test away from using `react-shallow-renderer` because it is no longer recommended.
Changelog:
[Internal]
Reviewed By: robhogan
Differential Revision: D58643059
fbshipit-source-id: 0eb36537fd3a8c69f4861fac14b99755eff97f04
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/44968
Migrates this Jest unit test away from using `react-shallow-renderer` because it is no longer recommended.
Changelog:
[Internal]
Reviewed By: robhogan
Differential Revision: D58643066
fbshipit-source-id: 216a036ef8e5cfe9b362c2f367da052ee6c9808b
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/44979
Migrates this Jest unit test away from using `react-shallow-renderer` because it is no longer recommended.
Changelog:
[Internal]
Reviewed By: robhogan
Differential Revision: D58643061
fbshipit-source-id: 0c68324d4d92fc8818ac469737eda3679aa773b3
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/44974
Migrates this Jest unit test away from using `react-shallow-renderer` because it is no longer recommended.
Changelog:
[Internal]
Reviewed By: robhogan
Differential Revision: D58641098
fbshipit-source-id: be7592b3fb5c4a66879ad734439faceb4ad5cdde
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/44987
Migrates this Jest unit test away from using `react-shallow-renderer` because it is no longer recommended.
Changelog:
[Internal]
Reviewed By: robhogan
Differential Revision: D58641097
fbshipit-source-id: a9d3abee19d58262d36ac250a55780df803c464b
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/44967
Migrates this Jest unit test away from using `react-shallow-renderer` because it is no longer recommended.
Changelog:
[Internal]
Reviewed By: robhogan
Differential Revision: D58641096
fbshipit-source-id: e9752f21763156ee409ae81a304cada84a346bdb
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/44985
Migrates this Jest unit test away from using `react-shallow-renderer` because it is no longer recommended.
Changelog:
[Internal]
Reviewed By: robhogan
Differential Revision: D58641095
fbshipit-source-id: 90563955876a148a2b867e0ec5128bdd8786f274
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/44888
In https://github.com/facebook/react/pull/29839 we removed the `Warning: ` prefix. This PR replaces the special cases in LogBox for `Warning: ` to use the presence of a component stack instead. This is what LogBox really cares about anyway, since the reason to let errors pass through to the exception manager is to let DevTools add the component stacks.
Changelog: [General] [Fixed] - Fix logbox reporting for React errors
Reviewed By: rickhanlonii
Differential Revision: D58441017
fbshipit-source-id: 5355cd04ddcd5238dadbfcbd64fe1f43c8cd04dc
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/44958
Now, all soft exception methods will have raiseSoftException(...)
## Before
```
BridgelessReact: ReactHost{0}.getOrCreateDestroyTask(): handleHostException(message = "Unable to load script. Make sure you're either running Metro (run 'npx react-native start') or that your bundle 'RNTesterBundle.js' is packaged correctly for release.")
```
## After
```
BridgelessReact: ReactHost{0}.raiseSoftException(getOrCreateDestroyTask()): handleHostException(message = "Unable to load script. Make sure you're either running Metro (run 'npx react-native start') or that your bundle 'RNTesterBundle.js' is packaged correctly for release.")
```
Changelog: [Internal]
Reviewed By: alanleedev
Differential Revision: D58593609
fbshipit-source-id: 171a872cd41e4ffe9c2e9654c563a6f3af342ad9
Summary:
When an XMLHttpRequest is performed, the `onprogress` event it is not invoked when the `Content-Length` header is missing in the response. This is the case when we are calling an endpoint that responds with `transfer-encoding: chunked` (https://tools.ietf.org/html/rfc9112#section-7.1), preventing the user to keep track of the progress while the server is sending chunks. Despite we will never know the total length of the content (because it will not be known due to the RFC specification, so it will be always `-1`), we will now be able to keep track of the loaded data.
Note that in Android, this is the current default behaviour.
To address this issue:
- I removed the condition where the `downloadProgressBlock` was dispatched only when `response.expectedContentLength` was greater than 0
- I created a new test case for `XMLHttpRequest` in the tester app to download a chunked file
## Changelog:
[IOS] [CHANGED] - fire `onprogress` event for `XMLHttpRequest` even when the `Content-Length` header is missing in the response headers
Pull Request resolved: https://github.com/facebook/react-native/pull/44899
Test Plan:
|before|after|
|----------|:-------------:|
|https://github.com/facebook/react-native/assets/37150312/6da3518f-eed3-4808-a2f8-abe26e5c7487|https://github.com/facebook/react-native/assets/37150312/ed1da300-dcf7-4874-a941-a2289f1cb777
Reviewed By: cortinico
Differential Revision: D58562088
Pulled By: NickGerleman
fbshipit-source-id: 23a1cafa49ddcd25fa0db7d04fae845126771425
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/44952
The test_helloworld_android Release variant are broken on GHA.
This fixes it as it forces hermesc to be built *before* the app attempts to create a bundle.
Changelog:
[Internal] [Changed] - Fix for broken test_helloworld_android on Release
Reviewed By: cipolleschi, blakef
Differential Revision: D58591480
fbshipit-source-id: 2afc1cfe8c416da6f5919d20098639653798dd1a
Summary:
With the migration to GHA, we are updating the testing scripts to work with the new CI.
There are a bit of shenanigans due to:
* How GHA archives artifacts => they are all `.zip` files, so I had to play around with unzipping them
* GHA seems to create a different commit, like if it is forking the repo instead of using it. I think that it is how the checkout action works. *Note:* this might be a problem for the `Create React Native Release` workflow because it has to commit on the stable branch!
* Android is building only the simulator architecture when running from regular CI. The app is not configured to run only on that, so the RNTestProject was a failing because it was trying to build all the available architectures. It is an easy fix in the user project space when release testing.
## Changelog:
[Internal] - Update the testing script to work with the new CI
Pull Request resolved: https://github.com/facebook/react-native/pull/44923
Test Plan:
Tested locally.
* [iOS] RNTester - Hermes ✅
* [iOS] RNTester - JSC ✅
* [Android] RNTester - Hermes ✅
* [Android] RNTester - JSC ✅
* [iOS] RNTestProject - Hermes ✅ (The project is created correctly and it builds, crash at runtime for https://github.com/facebook/react-native/issues/44926)
* [iOS] RNTestProject - JSC ✅ (The project is created correctly and it builds, crash at runtime for https://github.com/facebook/react-native/issues/44926)
* [Android] RNTester - Hermes ✅ (Needed to build only the simulator architecture)
* [Android] RNTester - JSC ✅ (Needed to build only the simulator architecture)
Reviewed By: andrewdacenko
Differential Revision: D58528432
Pulled By: cipolleschi
fbshipit-source-id: 733065de4c532b13d8e95e2217f9aafd5a2ef8a0
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/44924
# Changelog: [Internal]
For Strict Mode, RDT backend will apply ANSI escape codes to style the message, basically to dim it for 2-nd invocations of logs / warnings / errors in Strict Mode.
With these changes, LogBox will filter out these stylings, so that the message is displayed correctly in the LogBox bubble and in LogBox panel (full screen mode).
Reviewed By: rickhanlonii, yungsters
Differential Revision: D58477316
fbshipit-source-id: 17773f658d2a3bfa7f6a3ccec9fc88a97dd2c0af
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/44919
## Changelog:
[Internal] [Fixed] - Call Turbo Module methods 'methods' in the Turbo Module JSON schema
We don't support `properties` on Turbo Modules. We only support methods (even eventEmitters are just methods)
Reviewed By: javache
Differential Revision: D58510557
fbshipit-source-id: 02b1dc93a37b58b47bb9fd94a9658b5a7301bf55
Summary:
PR changing the single mountingOverrideDelegate to a vector of those, so other listeners can operate on the transaction. Used by `react-native-screens` in https://github.com/software-mansion/react-native-screens/pull/2134 and `react-native-reanimated` in https://github.com/software-mansion/react-native-reanimated/pull/6055.
Till now, only one listener could be added there, meaning that e.g. `Layout Animations` from `react-native`, `Layout Animations` from `react-native-reanimated` and listening for `Screen` removal in `react-native-screens` could not operate at the same time.
## Changelog:
<!-- Help reviewers and the release process by writing your own changelog entry.
Pick one each for the category and type tags:
[GENERAL] [FIXED] - Message
For more details, see:
https://reactnative.dev/contributing/changelogs-in-pull-requests
-->
[GENERAL] [FIXED] - Add option for multiple `mountingOverrideDelegates`
Pull Request resolved: https://github.com/facebook/react-native/pull/44927
Test Plan: The code of `LayoutAnimations` inside `react-native` should work the same since it will add just one listener then. For other cases, different libraries can read/mutate transactions.
Reviewed By: javache
Differential Revision: D58530278
Pulled By: sammy-SC
fbshipit-source-id: d6305963621000be11d51a50cffff64526cca934
Summary:
CircleCI is removing support for intel machines at the end of June, hence we have to migrate to M1.
## Changelog:
[Internal] - Migrate to M1
Pull Request resolved: https://github.com/facebook/react-native/pull/44944
Test Plan: CircleCI is green
Reviewed By: robhogan
Differential Revision: D58589100
Pulled By: cipolleschi
fbshipit-source-id: da7359d8c13093ef1595adc5fabb4f3628006c7a
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/44951
As the latest minor of AGP just released, let's bump it so that 0.75 users can use it.
Changelog:
[Android] [Changed] - AGP to 8.5.0
Reviewed By: cipolleschi
Differential Revision: D58587826
fbshipit-source-id: c14091faba1cb270ea2386f22fdbf079bce61421
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/44948
This is a small improvement suggested by tido64 to also account for package.json when computing caching
for autolinking of libraries.
Changelog:
[Internal] [Changed] - Add package.json to default `lockFiles` for ReactSettingsExtension
Reviewed By: cipolleschi
Differential Revision: D58587739
fbshipit-source-id: 6e0acf7d4badd8d8cc25dd90bb55fd6c0fa3779b
Summary:
## Context
Right now, the ReactInstance construtor eagerly initializes native modules.
## Problem
When these modules initialize, they may load other modules. But, all those loads will fail, because the react instance is in the process of being constructed.
## Changes
Eagerly initialize modules after the react instance is created. That way, these native module requires work.
Changelog: [Internal]
Reviewed By: javache
Differential Revision: D58537536
fbshipit-source-id: d0e424df708ec35b014f5cecda11e8756e8f4346
Summary:
## Changes
1. Store the react instance inside a private property (vs in the mReactInstanceTaskRef)
2. Attach the react instance to that property immediatley, after create
## Problems resolved
1. React host apis that use the instance (like ReactContext.getNativeModule()) will now also work **during** react native init. (see T191972567).
2. If exceptions get thrown during react instance init, the react instance will now get cleaned up (see test plan).
Changelog: [Internal]
Reviewed By: javache
Differential Revision: D58537535
fbshipit-source-id: fddf44d45b214b52a950e33d67ac6612a50ddcba
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/44905
Replaces the last template CI job.
Changelog: [Internal] [Changed] Use Helloworld in GHA CI workflow.
Reviewed By: cortinico
Differential Revision: D58466813
fbshipit-source-id: 333b9a4c71eec6901c78f144db48f365539c6a5a
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/44936
# Changelog: [Internal]
Added a small test that uses `folly:ManualExecutor`, which reproduces the memory leak issue in Hermes' RemoteObjectsTable:
1. Send `Runtime.enable`
2. Evaluate `console.log(<object>);` to populate `RemoteObjectsTable`
3. Send `Page.reload` to reload VM
This test is expected to fail, because by the time it is published, the D58398254 hasn't landed.
Reviewed By: motiz88
Differential Revision: D58531763
fbshipit-source-id: 99af3bfce0a31fe905d5bf2bf433f62cfbc34897
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/44887
The previous inexact object types and documentation for Share.share()'s arguments have led to confusion in how this library should be used. This diff updates the argument types to be more explicit, and rewrites some of the documentation for clarity.
Changelog:
[General][Breaking] Update `Share.share()`'s argument types to be more explicit.
Reviewed By: NickGerleman
Differential Revision: D58224906
fbshipit-source-id: 5ac8efe7caa0ecdd430fa7a1951c73c4acd8c6a1
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/44938
Yoga is transitively included in Swift targets and needs to be modular.
Changelog: [Internal]
Reviewed By: NickGerleman
Differential Revision: D58469454
fbshipit-source-id: 72bc6b5d3e5ee0710d9334a626e4e7297ce26b09
Summary:
Changelog: [ANDROID] [ADDED] - Add the ReactMarkerConstants.CONTENT_APPEARED support on Android in bridgeless mode.
This re-applies https://github.com/facebook/react-native/pull/43620 which was reverted because a CI job started failing because we forgot to update `packages/react-native/ReactAndroid/api/ReactAndroid.api`.
Reviewed By: cortinico
Differential Revision: D58535868
fbshipit-source-id: 9eec33c5e798850a7434a6c391abf2fc3fc9d0a6
Summary:
Changelog: [Internal]
Showing warnings in LogBox is noisy, confusing for web developers, and not the best use of screen real estate on mobile platforms. Since the Fusebox console offers a superior experience, as of this diff we'll suppress warnings in LogBox if we detect that Fusebox is available.
*The first time* a warning is suppressed, globally (i.e. at most once per app launch), we'll show a notification pointing the user towards Fusebox. When the notification is clicked, we call the `DevSettings.openDebugger` method and dismiss it.
The wording of the notification ("Open debugger to view warnings") is intentional:
1. It's short enough to fit on small screens in its entirety.
2. It doesn't actually say "*click here* to open the debugger". This is for the best because `DevSettings.openDebugger` is a best-effort method that might fail, and in the current implementation there's no reliable feedback to the user about the success/failure of the launch.
Reviewed By: huntie
Differential Revision: D57681446
fbshipit-source-id: fe6101785780de3bc586ade11f471f7c74707be1
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/44934
Resubmission of D57681447 with an updated `ReactAndroid.api`.
---
Changelog: [Internal]
Adds a private API that gives JS the ability to trigger the same "open debugger" action as in the Dev Menu. This is in preparation for changes to LogBox.
For simplicity, this method operates on a best-effort basis - i.e. it doesn't report the success or failure (or failure reason) of the launch.
Reviewed By: huntie
Differential Revision: D58529832
fbshipit-source-id: e5510f529a19e0149d8dce04fa610e6c2371cc79
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/44910
Props within the `Text` component are accessed both via destructuring the props object but also in some cases by using a "dot" access on the destructured `restProps`. However in all of the "dot" access cases the property is being overrided. Which means in the final JSX these properties get set twice, e.g. via the `restProps` spread then overrrided by static properties. This change just destructures all values to avoid this inefficiency.
Changelog: [Internal]
Reviewed By: javache
Differential Revision: D58446569
fbshipit-source-id: 12a800f5e2218a1d95d57cc689a4c79caab480b4
Summary:
This change removes the need for the trigger-react-native-release.js script.
Thanks to the migration to Github Actions, we can now leverage the GHA workflow UI to trigger a Prepare Release job that creates a github tag that will spin a new release.
The pro of this approach are:
- less code to maintain: instead of a complex trigger release scripts, we only have to maintain two very straightforward scripts for the CI
- easier to trigger a release: instead of running a script, we can now just use the GH UI
The `trigger-react-native-release` script was doing the following steps:
- check that we are in the release branch ==> Already implemented in the GHA workflow
- Gets the branch name (not needed) ==> the job will automatically run on the stable branch
- Check for unsent changes (not needed) ==> we are not in a local environment
- get the gh token (not needed) ==> You need to be logged in GH and have write access to the repo
- get the version ==> provided as a parameter
- fails if the tag is already there ==> Functionality added in the workflow
- Parse and validate the version ==> Functionality added to the action prepare-release action + the JS Script
- Compute the npmTag ==> Functionality added to the action prepare-release action + the JS Script
- trigger the release workflow ==> The GH UI does that for us
## Changelog:
[Internal] - Remove the trigger-react-native-release.js
Pull Request resolved: https://github.com/facebook/react-native/pull/44898
Test Plan: Testing in Production!
Reviewed By: cortinico, huntie
Differential Revision: D58461470
Pulled By: cipolleschi
fbshipit-source-id: 32bb0ee91370c9483a29e2ca2e18e24557d5fd53
Summary:
Add 0.72.15 to Changelog
## Changelog:
[Internal] [Changed] - Generated changelog
<!-- Help reviewers and the release process by writing your own changelog entry.
Pick one each for the category and type tags:
[ANDROID|GENERAL|IOS|INTERNAL] [BREAKING|ADDED|CHANGED|DEPRECATED|REMOVED|FIXED|SECURITY] - Message
For more details, see:
https://reactnative.dev/contributing/changelogs-in-pull-requests
Pull Request resolved: https://github.com/facebook/react-native/pull/44904
Reviewed By: cipolleschi
Differential Revision: D58470819
Pulled By: cortinico
fbshipit-source-id: 20a1816811213ed9a69f1ede3579aa8fc661faf2