Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/38145
Add Babel type definitions ahead of moving `metro-react-native-babel-transformer` under `react-natve`.
These are mostly duplicated from https://github.com/facebook/metro, adapted for RN's naming conventions and lint rules.
Changelog:
[Internal]
Reviewed By: christophpurrer
Differential Revision: D47154206
fbshipit-source-id: a44703f6926507732f2f1c65a17e5d4ac590c724
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/38043
Resorting methods in ReactHost class, this class in very long and to make it easy to read and analyze I'm sorting methods as public -> package -> private
no changes of behavior are happening here
bypass-github-export-checks
changelog: [internal] internal
Reviewed By: cortinico
Differential Revision: D46773622
fbshipit-source-id: 4e2867930dc84ef410569532e8a195e491a6a553
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/38141
Bump CLI and Metro versions on main to latest.
Changelog:
[General][Fixed] - Bump CLI to 12.0.0-alpha.6, Metro to 0.76.7
Reviewed By: dmytrorykun
Differential Revision: D47153654
fbshipit-source-id: d9eff64e5539f0e577e059bce836af3c65a4a8c7
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/38125
On Android, when using the remote debugging feature (using legacy websockets), it's not safe to assume we can get a `jsi::Runtime` from `JSExecutor`.
Changelog: [General][Fixed] Android does't crash when using remote debugger
Reviewed By: NickGerleman
Differential Revision: D47124234
fbshipit-source-id: 0542da1aca5d411964e3a0833f4c48428ed90c91
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/38088
For better Kotlin interop we should be using `val` in this interface rather than just `fun`.
This is not a breaking change as Java users can still use `getReactNativeHost()` as before.
Changelog:
[Internal] [Changed] - Use vals inside ReactApplication
Reviewed By: javache
Differential Revision: D47053030
fbshipit-source-id: 4a7fbc71a76be54e1cf7daef499b9bc3e8fc615a
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/38139
This adds https://github.com/gradle/foojay-toolchains to our build setup.
This will make sure that if the user doesn't have JDK 17 installed, it will be
autodownloaded once they try to build the first time.
Changelog:
[Internal] [Changed] - Add foojay-resolver-convention to auto-download the right JDK
Reviewed By: sammy-SC
Differential Revision: D47129944
fbshipit-source-id: fd49f6dfe5f87ce3f01e5cce3527144fb96f032a
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/38129
changelog: [iOS] Disable NSTextStorage caching in OSS
A [bug was reported](https://github.com/facebook/react-native/issues/37944) for NSTextStorage caching. Even thought I fixed the bug in D47019250, I want to disable the feature in OSS until the fix is verified in Facebook app.
My plan is to pick this commit for 0.72.1 and reenable NSTextStorage caching once the fix is validated.
Reviewed By: NickGerleman
Differential Revision: D47127912
fbshipit-source-id: 97694e383eb751e89b776c0599969f2c411bac6f
Summary:
While setting up a monorepo that required a custom react-native path location (react-native-macos in my case) I was getting the following error when running `pod install`
![image](https://github.com/facebook/react-native/assets/11707729/29bacfbb-78d9-49db-9c75-3e75674d87e9)
That's because `build_codegen` and `checkAndGenerateEmptyThirdPartyProvider` functions don't check if the given `react_native_path` is absolute or relative.
This PR fixes this problem by checking if `react_native_path` starts with `/`
bypass-github-export-checks
## Changelog:
[IOS] [FIXED] - Fix `use_react_native` to support custom react native absolute paths
Pull Request resolved: https://github.com/facebook/react-native/pull/37545
Test Plan:
Modify [rn-tester/Podfile](https://github.com/facebook/react-native/tree/main/packages/rn-tester/Podfile) to use an absolute path when calling `use_react_native`
E.g.
```rb
rn_path = File.dirname(`node --print "require.resolve('react-native/package.json')"`)
use_react_native!(
path: rn_path,
...
)
```
then run `pod install`
Reviewed By: cortinico
Differential Revision: D46279570
Pulled By: cipolleschi
fbshipit-source-id: 0d6da12c5617cfca2c9ef9dea08ecf728a970b6f
Summary:
Adds changelog for new patch.
## Changelog:
<!-- Help reviewers and the release process by writing your own changelog entry. For an example, see:
https://reactnative.dev/contributing/changelogs-in-pull-requests
-->
[Internal] [Changed] - add changelog entry for 0.72.1
Pull Request resolved: https://github.com/facebook/react-native/pull/38131
Test Plan: N/A
Reviewed By: cortinico
Differential Revision: D47149515
Pulled By: cipolleschi
fbshipit-source-id: 737032c204d68749770801fa34ecb8d212b8958f
Summary:
This fixes a bug that started with React Native 0.72.0 when using the new architecture and installing a native lib that has Swift code (in my case, `datadog/mobile-react-native`).
Running `pod install` errors with the following output (`DatadogSDKReactNative` is the pod containing the Swift code):
```
[...]
Analyzing dependencies
Downloading dependencies
Installing DatadogSDKReactNative 1.8.0-rc0
[!] The following Swift pods cannot yet be integrated as static libraries:
The Swift pod `DatadogSDKReactNative` depends upon `React-Fabric`, `React-graphics`, `React-utils`, and `React-debug`, which do not define modules. To opt into those targets generating module maps (which is necessary to import them from Swift when building as static libraries), you may set `use_modular_headers!` globally in your Podfile, or specify `:modular_headers => true` for particular dependencies.
```
Indeed, this pods were added as dependencies in `packages/react-native/scripts/cocoapods/new_architecture.rb` but do not define modules contrary to the other pods in the list.
This PR is solving a problem that already occured in the past and was solved here: https://github.com/facebook/react-native/pull/33743
It's a new implementation for the PR initially opened here: https://github.com/facebook/react-native/pull/38039
## Changelog:
[IOS] [FIXED] - Fix pod install for libraries using Swift code when the new architecture is enabled
Pull Request resolved: https://github.com/facebook/react-native/pull/38121
Test Plan:
1. Clone [this](https://github.com/louiszawadzki/react-native) repo
2. From `main`, add a Swift file to the `MyNativeView` native module in the RN tester app (see inspiration from [this commit](26958fccf4))
3. Try to run `RCT_NEW_ARCH_ENABLED=1 USE_HERMES=0 bundle exec pod install` inside the `packages/rn-tester`
4. Observe errors
5. Apply [the commit](7b7c3ff530) from this PR
6. Both pod install and the subsequent build should succeed.
7. Revert the changes and repeat steps 2 to 6 with `RCT_NEW_ARCH_ENABLED=1 USE_HERMES=1 bundle exec pod install`
Reviewed By: cortinico
Differential Revision: D47127854
Pulled By: cipolleschi
fbshipit-source-id: bf7f65e0d126195a76a0fafbe2f3172f00d5adc1
Summary:
X-link: https://github.com/facebook/yoga/pull/1317
Pull Request resolved: https://github.com/facebook/react-native/pull/37374
This is edge-casey enough, and I actually broke this in D42282358 without us noticing (I changed height to width of the bottom usage, instead, copy/pasting the value of the top one).
Reviewed By: yungsters
Differential Revision: D45766764
fbshipit-source-id: b600b79b8436534fe48ef2acbfde8ba64068e593
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/38081
Changelog: [Internal]
As part of refactoring ReactSurface, ensuring the methods expose interfaces instead of internal classes, e.g. use TaskInterface instead of Task,
Reviewed By: cortinico
Differential Revision: D47026648
fbshipit-source-id: 5fc42693b307af057b51a869133c52de0b1dca3a
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/38114
Changelog: [Android] [Internal] - W3CPointerEvents: add unit test for JSPointerDispatcher
This adds a basic test for JSPointerDispatcher. Right now this asserts that when a MotionEvent with ACTION_DOWN is received, we send out a pointerdown event.
There's a lot to be desired here in terms of e.g. ensuring that we're dispatching the event to the right target, which we can pursue as future work (of course, more complex test cases should also be added). I suspect we'll need to do a bit more refactoring to make this code more deeply testable (e.g. right now it's not straightforward to access Event properties from the test).
Reviewed By: javache
Differential Revision: D47035119
fbshipit-source-id: 1b49e2458325d6f0cc53d3b7ade8d6328141360f
Summary:
Fix the following error:
{F1038388240}
Calling ```setRuntimeConfigProvider``` multiple times is not always a wrong behaviour, the following could happen and before this diff App C will raise above error:
- App A has main bundle X
- App B has main bundle Y
- App C has main bundle X and bundle Y
To fix we guarantee ```setRuntimeConfigProvider``` only called once instead of raising an error.
Changelog:
[iOS][Changed] Fix setRuntimeConfigProvider called multiple times error
Reviewed By: dmytrorykun
Differential Revision: D47094267
fbshipit-source-id: c8473f4f7d639a73e0201c6d72781c01e6cf95fd
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/37923
Changelog: [Internal]
in this change, i'm looking to make sure our app template will not violate apple best practices and minimize probability of app rejection.
this change entails two guardrails:
- explicitly marking disabling ATS as disabled with a comment. even though this is already the case, this will make it more unlikely someone will override this
- replacing the localhost domain override with the apple provided NSAllowsLocalNetworking key, which is the recommendation
Reviewed By: sammy-SC
Differential Revision: D46707159
fbshipit-source-id: 8fe407d08767269a18fb15c80fdd83a58cf2a4a8
Summary:
According to the podfiles, the minimum version is 13.4
## Changelog:
[General] [Fixed] - Updated docs to match iOS 13.4 minimum requirement.
<!-- 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/38108
Reviewed By: jacdebug
Differential Revision: D47093313
Pulled By: blakef
fbshipit-source-id: f59b1be3a6608082fd680e42396aff9a269c77a0
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/38079
This diff fixes the
```
out-of-line definition of constexpr static data member is redundant in C++17 and is deprecated [-Werror,-Wdeprecated]
```
error in `RAMBundleRegistry`
## Changelog:
[internal] - Fix Xcode 15 namespace build errors in `RAMBundleRegistry`.
Reviewed By: javache, cipolleschi
Differential Revision: D46988689
fbshipit-source-id: 5dc34b0f7d6fb266bc379b3639244bf69505aa88
Summary:
Add getsentry to the React Native incubating partners list.
If you are interested in Sentry's work in the RN Core, see the ReactWG Post -> [Better Error Reporting for the New Architecture
](https://github.com/reactwg/react-native-new-architecture/discussions/122)
## 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
-->
[Internal] - Add getsentry to the React Native incubating partners list
Pull Request resolved: https://github.com/facebook/react-native/pull/38091
Test Plan: None - Docs update
Reviewed By: cortinico, sammy-SC
Differential Revision: D47060764
Pulled By: blakef
fbshipit-source-id: 9a42a5d9ff9012eb4ec7ffb04fac850c750f3c65
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/37835
Chrome Dev Tools doesn't correctly display grouped console logs (i.e. console output between a `console.group` and `console.groupEnd`) when timestamps are all zero.
Populate the timestamp field so grouping functions as expected.
Changelog: [General] [Fixed] Fix timestamps and grouped display of console messages within in a `console.group`
Reviewed By: fbmal7
Differential Revision: D46605659
fbshipit-source-id: c5821bfb4807c7f0ce28b7bb95ea08de29caf8a2
Summary:
I added the contentType parameter to Blob.slice like it's in the MDN Web docs.
This PR fixes https://github.com/facebook/react-native/issues/38058
When i slice a Blob for chunked uploads with react native i lost the content type, e.g. "image/jpeg", so the server doesn't know what kind of file he gets. In the docs of MDN the slice method was described with a third contentType parameter which was missing in Metas implementation.
## Changelog:
[GENERAL] [ADDED] added a third parameter "contentType" to method slice of class Blob.
<!-- 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/38078
Test Plan:
I tested it with the unit-tests:
yarn run test Blob-test.js
yarn run v1.22.19
$ jest Blob-test.js
PASS packages/react-native/Libraries/Blob/__tests__/Blob-test.js
Blob
✓ should create empty blob (5 ms)
✓ should create blob from other blobs and strings
✓ should slice a blob (1 ms)
✓ should slice a blob and sets a contentType
✓ should close a blob (4 ms)
My added unit test results "✓ should slice a blob and sets a contentType".
Reviewed By: hoxyq
Differential Revision: D47057162
Pulled By: blakef
fbshipit-source-id: 0931b0b828f81b9b90562ffd51d4111c81034ffc
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/38075
changelog: [internal]
`SharedFunction<>` is created with nullptr for its internal `std::function`. If called after created with default constructor, it crashes app. It also does not have API to check if its internal function is not nullptr.
With image cancelation, there is a race between when native component calls `imageRequest.cancel()` and when cancelation function is set in `RCTImageManager`.
To fix this, this diff adds a nullptr check inside SharedFunction. So it is always safe to call.
Reviewed By: javache
Differential Revision: D47022957
fbshipit-source-id: 0a04a87cd1ffe6bf3ca2fded38f689f06cc92ca9
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/38089
This change add a warning if a component is registered in both the New Renderer and in the Interop layer.
This can help users migrating their components once the library has been migrated.
## Changelog:
[iOS][Added] - Add warning to help users migrate away from the interop layer.
Reviewed By: cortinico
Differential Revision: D47053556
fbshipit-source-id: cc2ba09db16aaa370947a77173b6ea6a0acfa519
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/38093
In [this issue](https://github.com/facebook/react-native/issues/37905), the community detected a strict assumption in the interop layer for which, given a component `XXXView`, its ViewManager must be called `RCTXXXViewManager`.
That's not the case for some components, for example, `BVLinearGradient`, which View manager is `BVLinearGradientManager` and not `RCTBVLinearGradientManager`.
This diff adds a secondary lookup logic:
1. We look for the `RCTXXXViewManager`.
2. If not found, we look for `XXXViewManager`.
We will assess whether to generalize this logic once and for all or to expand other lookup cases on an example/failure basis as it's not a goal to have a 100% accurate interop layer. The Goal is to cover most use cases.
## Changelog:
[iOS][Added] - Allow to lookup for ViewManager without the RCT prefix in the Interop Layer
Reviewed By: sammy-SC
Differential Revision: D47055969
fbshipit-source-id: 1d31f3f4bc6f1f543edbd157ce04ad9daf23dbc6