Compare commits

...
Author SHA1 Message Date
React Native Bot 23f62acd83 Release 0.76.0-rc.2
#publish-packages-to-npm&next
2024-09-24 08:25:33 +00:00
Riccardo Cipolleschi 1099c0ccf7 [RN][iOS] Fix SVC for lineBreakModeIOS (#46514) 2024-09-23 14:30:05 +01:00
Riccardo Cipolleschi e8fdd3c5ac Fix crash when navigating away from screens (#46559)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/46559

There is an edge case when we navigate away from a screen that contains a scroll view where one of the UISCrollViewDelegates does not implement the scrollViewDidEndDecelerating method.

This happens because the Macro used assumes that the event that we are forwarding is the actual method from where the macro is called. Which is not true when it comes to `didMoveToWindow`.

This change fixes that by explicitly expanding the macro in this scenario and passing the right selector.

## Changelog:
[iOS][Fixed] - Fixed a crash when navigating away from a screen that contains a scrollView

## Facebook
This should fix T201780472

Reviewed By: philIip

Differential Revision: D62935876

fbshipit-source-id: e29aadf201c8066b5d3b7b0ada21fa8d763e9af0
2024-09-23 14:28:54 +01:00
Nicola Corti a22e29c192 Fix init behavior for 0.76 (#46560)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/46560

The `init` command should still keep on working till 2024-12-31

This handles this scenario as currently `npx react-native@next init` is broken.

Changelog:
[Internal] [Changed] - Clarify init behavior for 0.76

Reviewed By: huntie, cipolleschi

Differential Revision: D62958747

fbshipit-source-id: ce3d974df55162720d59a7ece7fcb816e257185d
2024-09-23 14:28:31 +01:00
Dawid 6d300b6fb8 fix app crashing when reloads overlap (#46416)
Summary:
Regarding the [issue](https://github.com/facebook/react-native/issues/44755) where the app sometimes crashes due to race condition when two reloads overlap in unfortunate way. This PR fixes it in some way by introducing throttling on reload command. For now I set it to 700ms as I was still able to reproduce it on 500-550ms for provided repro in the issue. The problem may still happen for bigger apps where reload may take more time to finish.

## 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
-->

[GENERAL] [FIXED] - throttle reload command

Pull Request resolved: https://github.com/facebook/react-native/pull/46416

Test Plan: I've tested on provided repro and a smaller app trying to brake it.

Reviewed By: huntie

Differential Revision: D62847076

Pulled By: cipolleschi

fbshipit-source-id: 6471f792d6b692e87e3e98a699443a88c6ef43cd
2024-09-23 14:26:26 +01:00
Alex Hunt e490b1ed9f Add missing babel-jest dependency to react-native package (#46539)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/46539

Resubmission of D62583665, addressing internal CI errors from dep relocation.

Changelog: [Internal]

Reviewed By: robhogan

Differential Revision: D62867287

fbshipit-source-id: d28d35e2c0a82d7d2bfdaa26c4f9fe8c3a5ef41a
2024-09-23 14:25:35 +01:00
MasGaNo 1a04e5db62 fix(ios): allow pods mixte type settings on post-install (#46536)
Summary:
Following the discussion on https://github.com/facebook/react-native/issues/46505, this PR aims to allow mixte type configuration (String and/or Array of String) during the post installation of pods.

## 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
-->
[IOS] [FIXED] - allow pods mixte type settings on post-install

Pull Request resolved: https://github.com/facebook/react-native/pull/46536

Test Plan: `packages/react-native/scripts/cocoapods/__tests__/utils-test.rb` test suits was updated to support array and works as expected

Reviewed By: shwanton

Differential Revision: D62870582

Pulled By: cipolleschi

fbshipit-source-id: c0ace6d9d20e6609ceae5aafd236d97fc9e86ddf
2024-09-23 14:24:26 +01:00
Vin Xi efc475c3f9 fix(react-native-xcode): Add back BUNDLE_COMMAND (#46495)
Summary:
In this PR https://github.com/facebook/react-native/issues/45560  the BUNDLE_COMMAND initialization was removed while it is still being used. Without it, building from Xcode throws unknown options error for Physical iOS devices.

I have just brought back the initialization from the PR before that, so the bundle phase is successful.

## Changelog:
[IOS][Fixed] - Add back the BUNDLE_COMMAND

Pull Request resolved: https://github.com/facebook/react-native/pull/46495

Test Plan: I have bundled release builds in Xcode. Everything seems to be fine.

Reviewed By: cortinico

Differential Revision: D62846877

Pulled By: cipolleschi

fbshipit-source-id: 3f07e8c0bc5acf98177582f1fee9a55ae77b31a1
2024-09-23 14:23:59 +01:00
Alex Hunt 947734f235 Switch to Hermes parser in Jest preset (#46465)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/46465

Resolves https://github.com/facebook/react-native/issues/46355.

Changelog: [Internal]

bypass-github-export-checks

Reviewed By: robhogan

Differential Revision: D62583337

fbshipit-source-id: 64813d84c2a6395be8ef4f138398834ddae6e54b
2024-09-23 14:23:17 +01:00
shubhamguptadream11 a4210ef245 fix(iOS): fire onMomentumScrollEnd when UIScrollView is removed from window (#46277)
Summary:
Solves this issue: https://github.com/facebook/react-native/issues/46276

## 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] [ADDED] - fire onMomentumScrollEnd when UIScrollView is removed from window

**Why the issue is happening?**
The `onMomentumScrollEnd` event is typically triggered by the `UIScrollView` delegate methods `scrollViewDidEndDecelerating` and `scrollViewDidEndScrollingAnimation`. However, if the scroll view is removed from the window while navigating away, these delegate methods are not called, resulting in the event not being dispatched.

This behaviour was particularly problematic in scenarios where a scroll view is in motion, and the user navigates away from the screen before the scrolling completes. In such cases, the `onMomentumScrollEnd` event would never fire, which further make scroll area un touchable or un responsive.

**What we changed?**
In the didMoveToWindow method, we added logic to handle the scenario where the UIScrollView is being removed from the window (i.e., when the component is unmounted or the user navigates away). Here’s a breakdown of the changes:

- **Added a Check for Scroll State:** We check if the UIScrollView was decelerating or had stopped tracking (_scrollView.isDecelerating || _scrollView.isTracking == NO).

- **Manually Triggered onMomentumScrollEnd:** If the scroll view was in motion and is being removed from the window, we manually trigger the `onMomentumScrollEnd` event to ensure that the final scroll state is captured.

**_I had fixed this issue on both Old and New arch._**

Pull Request resolved: https://github.com/facebook/react-native/pull/46277

Test Plan:
Attaching a video with working solution:

https://github.com/user-attachments/assets/1a1f3765-3f11-46c3-af18-330c88478db8

Reviewed By: andrewdacenko

Differential Revision: D62374798

Pulled By: cipolleschi

fbshipit-source-id: 014be8d313bab0257459dc4e53f5b0386a39d5e0
2024-09-23 14:20:59 +01:00
Saad Najmi d129e9a1b5 Revert "feat: build codegen on postinstall (#46227)" (#46420)
Summary:
This reverts commit 0cb97f0261.

Revert this commit that adds a `post install` script for a couple of reasons:

1. (EDIT: This turns out to be unrelated) The `postinstall` script causes `yarn install` to fail on React Native macOS, where we use Yarn 4. I'm not entirely sure why, but I probably won't debug it for the rest of the reasons.
2. `postinstall` scripts (at least inside Microsoft) are viewed as a security risk. Any package in your dependency tree can get compromised, add the phase, and run arbitrary code. This has happened in the past with React Native past if I recall correctly. As such, we disable `postinstall` scripts in many of our repos (including `rnx-kit` and `react-native-test-app`).
3. The issue this is trying to solve is to help newcomers avoid a stale cache when they switch branches in the React Native monorepo and only run `yarn install`. I think it would be sufficient to add some documentation somewhere that it is expected one runs `yarn && yarn build` to use this repo locally? That's a fairly common practice in monorepos, at least ones inside Microsoft.

## Changelog:

[INTERNAL] [SECURITY] - Remove post install script phase in the React Native monorepo

Pull Request resolved: https://github.com/facebook/react-native/pull/46420

Test Plan: CI should pass

Reviewed By: christophpurrer, robhogan, cortinico, rshest

Differential Revision: D62755022

Pulled By: huntie

fbshipit-source-id: bf94ed33e3e451ea337ef7a6984f7ba964d0b212
2024-09-23 14:20:09 +01:00
Riccardo Cipolleschi b958fe13f9 [LOCAL] Bump Podfile.lock 2024-09-16 20:07:15 +02:00
React Native Bot ec9e1718aa Release 0.76.0-rc.1
#publish-packages-to-npm&next
2024-09-16 16:25:38 +00:00
Riccardo Cipolleschi c4714e81d8 [LOCAL] Bump Podfile.lock 2024-09-16 16:01:20 +02:00
Riccardo Cipolleschi b8fa7c80ff Revert "Animated: Restore AnimatedNode.prototype.toJSON (#46498)"
This reverts commit 83eb95e72a.
2024-09-16 16:00:00 +02:00
Rob Hogan 4126ce844d [0.76] Bump Metro to 0.81.0-alpha (#46431) 2024-09-16 15:44:00 +02:00
Rodolfo Gomez Sirimarco 95021db72a Fix Headless Crash Tried to finish non-existent task with id (#46497)
Summary:
Sometimes a headless task tries to finish, but it doesn’t exist, which causes an exception.
No one knows how to reliably reproduce it, as it could be a race condition. However, if you attempt to remove a task that has already been removed, it shouldn’t cause an issue since you're trying to remove something that’s already gone (which is exactly what you want).

Fixes:
 - https://github.com/facebook/react-native/issues/46496
 - https://github.com/facebook/react-native/issues/33883
 - https://github.com/facebook/react-native/issues/27597
 - https://github.com/transistorsoft/react-native-background-fetch/issues/202
 - https://github.com/transistorsoft/react-native-background-fetch/issues/369
 - https://github.com/transistorsoft/react-native-background-geolocation/issues/2096
 - https://github.com/jpush/jpush-react-native/issues/78

## Stacktrace:
```
Fatal Exception: java.lang.AssertionError: Tried to finish non-existent task with id 28.
  at com.facebook.infer.annotation.Assertions.assertCondition(Assertions.java:88)
  at com.facebook.react.jstasks.HeadlessJsTaskContext.finishTask(HeadlessJsTaskContext.java:179)
  at com.facebook.react.jstasks.HeadlessJsTaskContext$3.run(HeadlessJsTaskContext.java:217)
  at android.os.Handler.handleCallback(Handler.java:958)
  at android.os.Handler.dispatchMessage(Handler.java:99)
  at android.os.Looper.loopOnce(Looper.java:257)
  at android.os.Looper.loop(Looper.java:368)
  at com.facebook.react.bridge.queue.MessageQueueThreadImpl$4.run(MessageQueueThreadImpl.java:233)
  at java.lang.Thread.run(Thread.java:1012)
```

## Screenshot

https://github.com/user-attachments/assets/101f0f53-95c9-40ec-a59d-22d6d474b457

## Changelog:

[ANDROID] [FIXED] - Fix Headless Crash `Tried to finish non-existent task with id`

Pull Request resolved: https://github.com/facebook/react-native/pull/46497

Test Plan:
I created an example where I attempt to remove a task that doesn’t exist.

Example: https://github.com/RodolfoGS/react-native-fix-non-existent-task

### How to reproduce using the example above:
1. `git clone git@github.com:RodolfoGS/react-native-fix-non-existent-task.git`
2. `cd react-native-fix-non-existent-task`
3. `npm install`
4. `npm run android`
5. Notice the crash

### Steps to create the example from scratch and reproduce the crash:
1. `npx react-native-community/cli@latest init AwesomeProject`
2. `cd AwesomeProject`
3. Add call to finishTask to reproduce the crash (https://github.com/RodolfoGS/react-native-fix-non-existent-task/commit/6fe3c1388a58b9ffdcca5f9c6f00a4f2fea725ea)
4. `npm run android`
5. Notice the crash

Reviewed By: javache

Differential Revision: D62738059

Pulled By: rshest

fbshipit-source-id: 3232dc76ba8a069279c2b741d62372537a3f9140
2024-09-16 15:43:00 +02:00
Tim Yung 83eb95e72a Animated: Restore AnimatedNode.prototype.toJSON (#46498)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/46498

Looks like this is still necessary because we still run into this error when using the Components tab when using React DevTools:

> TypeError: cyclical structure in JSON object

This effectively reverts https://github.com/facebook/react-native/pull/46382.

Changelog:
[General][Changed] - AnimatedNode (and its subclasses) once again implement `toJSON()`.

Reviewed By: javache

Differential Revision: D62690380

fbshipit-source-id: d5b7c1d156b49838abefe48a7d7b61471cc3488a
2024-09-16 15:42:54 +02:00
Nick Gerleman 3b44182c1d Unhide new arch layout props (#46478)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/46478

These are all supported in the new arch (default as of 0.76), across all platforms. but were previously hidden from types, and undocumented.

I will make a pick request for this change, and we should then add these to documentation.

Changelog:
[General][Added] - Unhide new arch layout props

Reviewed By: cortinico

Differential Revision: D62616897

fbshipit-source-id: f6c2e71785284e667824a76918ccf2724adc4e98
2024-09-16 15:42:43 +02:00
Alan Lee f4fd248d53 fix SafeAreaView mis-used import (#46402)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/46402

JS code for importing SafeAreaView is causing error in windows due to import being used.
Fix it by using conditional require instead

Changelog:
[Internal] -  Fixed mis-used import of core only SafeAreaView in JS

Reviewed By: fkgozali

Differential Revision: D62392588

fbshipit-source-id: 65c4728ff73b43cc54543ec2d141a88fce1275ca
2024-09-16 15:41:43 +02:00
Nicola Corti c41ab475b1 Back out "Remove some Tasks overhead" (#46483)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/46483

Original commit changeset: 631d741bd2ec

This is breaking the RedBox on React Native 0.76 on Android when not connected to Metro.

Original Phabricator Diff: D62213722

Changelog:
[Internal] [Changed] - Back out "[react-native] Remove some Tasks overhead"

Reviewed By: cipolleschi

Differential Revision: D62644614

fbshipit-source-id: a092614da78bef65546c2539a3ebc9bff5e807b2
2024-09-16 15:41:39 +02:00
Oskar Kwaśniewski 1dd89df561 fix(iOS): don't reference PrivacyInfo.xcprivacy twice for new projects (#46457)
Summary:
This PR fixes an issue with PrivacyInfo files.

When generating a new project for using the latest RC 0.76.0.rc0 I got two privacy manifests references in Xcode.

This is because `PrivacyManifestUtils` look for build phase reference:

```ruby
reference_exists = target.resources_build_phase.files_references.any? { |file_ref| file_ref&.path&.end_with? "xcprivacy" }
```

Which doesn't exist for the generated template.

Here is how Xcode file tree looks like after installing pods:

![CleanShot 2024-09-12 at 13 23 21@2x](https://github.com/user-attachments/assets/44e5bb55-a1ab-4b4b-bfe4-e4a6808afd15)

## Changelog:

[IOS] [FIXED] - don't reference PrivacyInfo.xcprivacy twice for new projects

Pull Request resolved: https://github.com/facebook/react-native/pull/46457

Test Plan:
1. Generate a new project
2. Execute pod install
3. Check if only one PrivacyInfo file exists

Reviewed By: cortinico

Differential Revision: D62580116

Pulled By: cipolleschi

fbshipit-source-id: 1224a41307ae6c9b862832f145baf0edc92476d6
2024-09-16 15:41:34 +02:00
Riccardo Cipolleschi a0f11acc34 Fix SVC Validator for Box Shadow and filter (#46454)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/46454

The SVC Validator have no idea on how to process a simple NSArray *.

With this change, we are creating two named types for the NSArray:
* BoxShadowArray
* FilterArray
To create unique types that we can reference in JS.

We are then enhancing the `getProcessor` function to return the proper processor when those types are found in the NativeViewConfig

## Changelog:
[iOS][Fixed] - Fixed warnings when validating SVC

## Facebook:
This change is OTA safe: even when we ship the JS before the native code, the new cases in the switch will be never hit, similarly to the situation we have right now.

As soon as the native code is shipped, the new cases will start get hit and the wrning will disappear

Reviewed By: NickGerleman

Differential Revision: D62574612

fbshipit-source-id: d173bf5534ee5e436f23a4bc6e2fb25e72a4b06d
2024-09-16 15:41:26 +02:00
Riccardo Cipolleschi 507934f7d9 Fix Basic SVC for RNTester iOS (#46439)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/46439

The SVC for some components on iOS got out of sync.
This was creating warnings in the React Native DevTools and it was affecting the release of 0.76.

With this change, I updated the manually written SVC so that we don't have warnings anymore.

We still have to fix the `boxShadow` and `filter`. This will happen in a later change.

## Changelog
[iOS][Fixed] - Solved SVC warnings for RNTester

Reviewed By: NickGerleman

Differential Revision: D62501704

fbshipit-source-id: 3c02f7615c3511a97eba73a2ddaa713d2e4e30f0
2024-09-16 15:41:22 +02:00
Jorge Cabiedes Acosta e6396039c7 Rename DropShadowPrimitive to DropShadowValue (#46476)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/46476

Keep the type naming consistent with examples like `DimensionValue`, `ColorValue`, etc.

Changelog: [Internal]

Reviewed By: NickGerleman

Differential Revision: D62614579

fbshipit-source-id: 824ea9af17487a4459e8f39d9374e2e00452db43
2024-09-16 15:41:03 +02:00
Jorge Cabiedes Acosta fdb5721ead Rename BoxShadowPrimitive to BoxShadowValue (#46485)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/46485

Keep the type naming consistent with examples like `DimensionValue`, `ColorValue`, etc.

Changelog: [Internal]

Reviewed By: NickGerleman

Differential Revision: D62614444

fbshipit-source-id: 3ff66d3f52623b6fb7bd8d31d2910aa255ae8a31
2024-09-16 15:40:50 +02:00
Jorge Cabiedes Acosta 123b25226a Remove experimental_ prefix from filter (#46406)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/46406

As title

Second attempt at landing the new name. There were 2 issues previously which led us to revert.

1. **Error on workrooms tests.** This ended up not being caused by us but rather by D61896776. After renaming the error changed which might've caused the renaming to be blamed for the issue. It has since been resolved

2. **FB crash** FB was crashing when using drop-shadow after renaming. For some reason after renaming `filter` an invalid stylex property was making FB crash. We don't know why renaming uncovered the issue but the the code was using unsupported features on RN (`calc` & `stylex`) which then led to passing a raw unsupported value for `filter` and crashing on the `processFilter` function.

FB was fixed here D62407454 to prevent crashing after landing this diff

Changelog: [General] [Changed] - Add official `filter` CSSProperty.

Reviewed By: NickGerleman

Differential Revision: D62401985

fbshipit-source-id: 14422603c40b7ddf8300029165a85655354075c3
2024-09-16 15:36:41 +02:00
Jorge Cabiedes Acosta 6259ee91bd Remove experimental_ prefix from boxShadow (#46404)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/46404

As title

Second attempt to rename the prop. BoxShadow caused no issues after renaming but it was batched with `filter` which we reverted.

Changelog: [General] [Changed] - Add official `boxShadow` CSSProperty.

Reviewed By: NickGerleman, cyan33

Differential Revision: D62400814

fbshipit-source-id: ad721f6d11d614e987048e55556b05ff74a4747d
2024-09-16 15:36:31 +02:00
Riccardo Cipolleschi b4aab7fb52 Exclude dSYM from the archive (#46472)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/46472

Currently, we are building the Debug symbols (dSYM) for hermes dSYM but we are not shipping them with the xcframework.
This is correct, because Debug symbols can increase the size of Hermes thus enalrging the iOS IPA and increasing the download time when installing pods.

We distribute the dSYM separatedly, in case users needs to symbolicate Hermes stack traces.

However the path to the dSYM still appears in the Info.plist of the universal XCFramework and this can cause issues when submitting an app to apple.

This change should remove those lines from the universal framework.

It fixes https://github.com/facebook/react-native/issues/35863

## Changelog
[Internal] - Remove dSYM path from Info.plist

Reviewed By: cortinico

Differential Revision: D62603425

fbshipit-source-id: 038ec3d6b056a3d6f5585c8125d0430f56f11bb9
2024-09-16 15:29:38 +02:00
Tommy Nguyen 064887675b Re-add RCTHermesInstance constructor for compatibility (#46453)
Summary:
https://github.com/facebook/react-native/pull/46314 introduced a breaking change, making it hard to maintain backwards compatibility elsewhere. This change re-introduces the constructor that takes two arguments.

## Changelog:

[IOS] [FIXED] - Unbreak `RCTHermesInstance` constructor breaking change

Pull Request resolved: https://github.com/facebook/react-native/pull/46453

Test Plan: n/a

Reviewed By: javache

Differential Revision: D62574496

Pulled By: cortinico

fbshipit-source-id: dcd15bf9694f4b14e37d61d7209193b3e448cd6b
2024-09-16 15:29:33 +02:00
Nicola Corti 2a10923863 Bump SoLoader to 0.12.1 and remove unnecessary extra manifest metadata. (#46461)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/46461

This bumps SoLoader to 0.12.1 inside React Native and cleans up the extra
`com.facebook.soloader.enabled` metadata which are not necessary anymore.

Changelog:
[Internal] [Changed] - Bump SoLoader to 0.12.1 and remove unnecessary extra manifest metadata

Reviewed By: cipolleschi

Differential Revision: D62581188

fbshipit-source-id: ff990c0af1f0f51070037fcb4c7c13fbe6bae234
2024-09-16 15:29:27 +02:00
Nicola Corti bf14325d30 Unblock RNTester instacrashing due to SoLoader not being enabled (#46459)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/46459

After the SoLoader 0.12.0 bump I've noticed RNTester is instacrashing due to us not having enabled it
explicitely in the Manifest:

Changelog:
[Internal] [Changed] - Unblock RNTester instacrashing due to SoLoader not being enabled

Reviewed By: cipolleschi

Differential Revision: D62580751

fbshipit-source-id: 3b291e7f82daf1a6bd61bc9588c2d49a389801ef
2024-09-16 15:29:22 +02:00
Nicola Corti 2085076449 Do not stub SoLoader and use version 0.12.0 (#46422)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/46422

Stubbing SoLoader comes with a couple of breaking changes (e.g. users in OSS are using `com.facebook.common.logging.FLog` which is exposed by Fresco).

In order to reduce those breaking changes, here I'm moving React Native to use SoLoader 0.12.0.
This new version comes with a constructor that accepts a MergedSoMapping implementation which we provide only for OSS apps.

Please note that the CI on this Diff will be red till SoLoader 0.12.0 releases.

Changelog:
[Internal] [Changed] - Do not stub SoLoader and use version 0.12.0

Reviewed By: cipolleschi

Differential Revision: D62447566

fbshipit-source-id: 6ff38799ed0c9f40cf3ab84be8a05979def63dc2
2024-09-16 15:29:13 +02:00
Ruslan Lesiutin d67d91407e Update debugger-frontend from 50a4d4f...e8c7943 (#46414)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/46414

Changelog: [Internal] - Update `react-native/debugger-frontend` from 50a4d4f...e8c7943

Resyncs `react-native/debugger-frontend` from GitHub - see `rn-chrome-devtools-frontend` [changelog](https://github.com/facebookexperimental/rn-chrome-devtools-frontend/compare/50a4d4f7fd86c73860498a24c763d99e07bc31ae...e8c79432972029c625c91d16967b07fe61f04a61).

Reviewed By: robhogan

Differential Revision: D62436953

fbshipit-source-id: 7a877142c5713c78cb6f1a3d839c4e90f93fa0c6
2024-09-16 15:29:04 +02:00
Ruslan Lesiutin 4d67a27c37 Update debugger-frontend from a556d26...50a4d4f (#46401)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/46401

Changelog: [Internal] - Update `react-native/debugger-frontend` from a556d26...50a4d4f

Resyncs `react-native/debugger-frontend` from GitHub - see `rn-chrome-devtools-frontend` [changelog](https://github.com/facebookexperimental/rn-chrome-devtools-frontend/compare/a556d261a5e2131864f4e38ded62d8f90e81c39a...50a4d4f7fd86c73860498a24c763d99e07bc31ae).

Reviewed By: huntie

Differential Revision: D62385355

fbshipit-source-id: 77056540c9d40cd7cfc8098332e86f9521633619
2024-09-16 15:29:01 +02:00
Tomek Zawadzki b0db081a76 Expose jsctooling via prefab (#46430)
Summary:
This PR exposes `jsctooling` prefab that contains `facebook::jsc::makeJSCRuntime` used by Reanimated and other third-party libraries previously accessed via `libjscexecutor.so`.

Based on https://github.com/facebook/react-native/pull/46423.

## Changelog:

[Android] [Changed] - Expose jsctooling via prefab

Pull Request resolved: https://github.com/facebook/react-native/pull/46430

Test Plan: Tested on Reanimated paper-example app built from source on RN 0.76.0-rc.0 with JSC enabled

Reviewed By: cipolleschi

Differential Revision: D62492763

Pulled By: cortinico

fbshipit-source-id: 53b6c0d9bb88559c40b5b8796bf6a1513bd388d9
2024-09-16 15:28:53 +02:00
Tomek Zawadzki 959eafca33 Expose react_timing headers in reactnative prefab (#46427)
Summary:
This PR fixes the following error when building third-party libraries that `#include <react/fabric/Binding.h>` which includes `react/timing/primitives.h` which is not included in `reactnative` prefab.

```
FAILED: CMakeFiles/rnscreens.dir/src/main/cpp/NativeProxy.cpp.o
/Users/tomekzaw/Library/Android/sdk/ndk/26.1.10909125/toolchains/llvm/prebuilt/darwin-x86_64/bin/clang++ --target=aarch64-none-linux-android24 --sysroot=/Users/tomekzaw/Library/Android/sdk/ndk/26.1.10909125/toolchains/llvm/prebuilt/darwin-x86_64/sysroot -DFOLLY_NO_CONFIG=1 -Drnscreens_EXPORTS -I/Users/tomekzaw/RNOS/react-native-reanimated/node_modules/react-native-screens/android/../cpp -isystem /Users/tomekzaw/.gradle/caches/8.10.1/transforms/eb5443cef7868b6c3cc54bbf3f161a63/transformed/react-android-0.76.0-rc.0-debug/prefab/modules/jsi/include -isystem /Users/tomekzaw/.gradle/caches/8.10.1/transforms/eb5443cef7868b6c3cc54bbf3f161a63/transformed/react-android-0.76.0-rc.0-debug/prefab/modules/reactnative/include -isystem /Users/tomekzaw/.gradle/caches/8.10.1/transforms/b0878eb14f826ac5f04db98523604de2/transformed/fbjni-0.6.0/prefab/modules/fbjni/include -g -DANDROID -fdata-sections -ffunction-sections -funwind-tables -fstack-protector-strong -no-canonical-prefixes -D_FORTIFY_SOURCE=2 -Wformat -Werror=format-security   -fno-limit-debug-info  -fPIC -std=c++20 -MD -MT CMakeFiles/rnscreens.dir/src/main/cpp/NativeProxy.cpp.o -MF CMakeFiles/rnscreens.dir/src/main/cpp/NativeProxy.cpp.o.d -o CMakeFiles/rnscreens.dir/src/main/cpp/NativeProxy.cpp.o -c /Users/tomekzaw/RNOS/react-native-reanimated/node_modules/react-native-screens/android/src/main/cpp/NativeProxy.cpp
In file included from /Users/tomekzaw/RNOS/react-native-reanimated/node_modules/react-native-screens/android/src/main/cpp/NativeProxy.cpp:2:
In file included from /Users/tomekzaw/.gradle/caches/8.10.1/transforms/eb5443cef7868b6c3cc54bbf3f161a63/transformed/react-android-0.76.0-rc.0-debug/prefab/modules/reactnative/include/react/fabric/Binding.h:17:
In file included from /Users/tomekzaw/.gradle/caches/8.10.1/transforms/eb5443cef7868b6c3cc54bbf3f161a63/transformed/react-android-0.76.0-rc.0-debug/prefab/modules/reactnative/include/react/jni/JRuntimeScheduler.h:11:
In file included from /Users/tomekzaw/.gradle/caches/8.10.1/transforms/eb5443cef7868b6c3cc54bbf3f161a63/transformed/react-android-0.76.0-rc.0-debug/prefab/modules/reactnative/include/react/renderer/runtimescheduler/RuntimeScheduler.h:11:
/Users/tomekzaw/.gradle/caches/8.10.1/transforms/eb5443cef7868b6c3cc54bbf3f161a63/transformed/react-android-0.76.0-rc.0-debug/prefab/modules/reactnative/include/react/performance/timeline/PerformanceEntryReporter.h:10:10: fatal error: 'react/timing/primitives.h' file not found
#include <react/timing/primitives.h>
         ^~~~~~~~~~~~~~~~~~~~~~~~~~~
1 error generated.
```

## Changelog:

[ANDROID] [FIXED] - Expose `react_timing` headers in `reactnative` prefab

Pull Request resolved: https://github.com/facebook/react-native/pull/46427

Test Plan: Tested on Reanimated fabric-example app with react-native-screens installed built from source on top of RN 0.76.0-rc.0 with new arch enabled

Reviewed By: cipolleschi

Differential Revision: D62492707

Pulled By: cortinico

fbshipit-source-id: 94ed7044457bea53660a6ca6d5342cf8ea20a8b4
2024-09-16 15:28:47 +02:00
Nicola Corti bc62261dfa Expose hermestooling via prefab (#46423)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/46423

This is used by Reanimated as they were previously accessing `libhermes_executor.so`

Changelog:
[Android] [Changed] - Expose hermestooling via prefab

Reviewed By: cipolleschi

Differential Revision: D62447875

fbshipit-source-id: e863c56bc5a801ee7de8a4e5d45f95481d3497f8
2024-09-16 15:28:42 +02:00
Nicola Corti 4af4311fc8 RNGP - Sanitize the output of the config command (#46482)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/46482

Fixes https://github.com/facebook/react-native/issues/46443
Fixes https://github.com/facebook/react-native/issues/46134

I'm sanitizing the output of the `config` command + I've added some more logging in case of failure.

Changelog:
[Android] [Fixed] - RNGP - Sanitize the output of the config command

Reviewed By: cipolleschi

Differential Revision: D62641979

fbshipit-source-id: c13d27a42beeb7a973c1802e7204631d49d3d09b
2024-09-16 15:28:34 +02:00
Hampus Sjöberg e78ea9f6d9 fix: RNGP autolink not properly filter out pure C++ TurboModules (#46381)
Summary:
Hey.

The react-native gradle plugin didn't properly filter out [Pure](https://github.com/react-native-community/cli/pull/2387) C++ TurboModules for autolinking, which caused build failures as a non-existing gradle dependency would be emitted.

This makes Pure C++ TurboModules work again for Android.

## 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
-->

[ANDROID][FIXED] Fix autolinking issues for Pure C++ TurboModules

Pull Request resolved: https://github.com/facebook/react-native/pull/46381

Test Plan:
https://github.com/hsjoberg/rn75autolinkregression

Try running this repro project to observe the error:

```
1: Task failed with an exception.
-----------
* Where:
Build file '/Users/coco/Projects/Blixt/rn75autolinkregression/example/android/app/build.gradle' line: 54

* What went wrong:
A problem occurred evaluating project ':app'.
> Project with path ':react-native-cxx-turbomodule' could not be found in project ':app'.
```

Simply add the 1-line code from this PR to make the build succeed.

Cheers.

Reviewed By: cipolleschi

Differential Revision: D62377757

Pulled By: cortinico

fbshipit-source-id: 9e3fa3777b4e6e4d3f2eb0f996ac0ac7676eedbe
2024-09-16 15:28:29 +02:00
Riccardo Cipolleschi 33d175f51b [LOCAL] Bump Podfile.lock 2024-09-10 16:30:47 +01:00
React Native Bot f60fbc15ae Release 0.76.0-rc.0
#publish-packages-to-npm&next
2024-09-10 13:17:08 +00:00
Nicola Corti 28facc2824 Revert "Release 0.76.0-rc.0"
This reverts commit 1e3c583d73.
2024-09-10 14:09:13 +01:00
Nicola Corti cf5d04d3e1 [LOCAL] Fix wrong command for publishing of external-artifacts 2024-09-10 14:08:42 +01:00
React Native Bot 1e3c583d73 Release 0.76.0-rc.0
#publish-packages-to-npm&next
2024-09-10 10:47:25 +00:00
Riccardo Cipolleschi 026fd325ab [LOCAL] Fix testing script to use debug versions of the Android APK 2024-09-10 08:25:26 +01:00
Riccardo Cipolleschi b395208303 [LOCAL] Properly make ScrollView compatible with React19 2024-09-09 18:01:41 +01:00
Riccardo Cipolleschi 8041e410e3 [LOCAL] Make ScrollView compatible with React 18.3.1 2024-09-09 16:57:24 +01:00
Riccardo Cipolleschi 13ab63b60a Revert "Revert "RN: Remove forwardRef from ScrollView (#45197)""
This reverts commit 965d84314a.
2024-09-09 16:56:20 +01:00
Riccardo Cipolleschi 965d84314a Revert "RN: Remove forwardRef from ScrollView (#45197)"
This reverts commit 1341169a4b.
2024-09-09 15:03:13 +01:00
Riccardo Cipolleschi b93b378fa0 [LOCAL] Revert React 19 to React 18.3.1 2024-09-09 14:33:25 +01:00
Riccardo Cipolleschi f55759e633 [LOCAL] Bump hermes version 2024-09-09 14:30:57 +01:00
118 changed files with 62673 additions and 45532 deletions
@@ -22,7 +22,7 @@ runs:
- name: Restore Cached Artifacts
uses: actions/cache/restore@v4
with:
key: v4-hermes-artifacts-${{ inputs.flavor }}-${{ inputs.hermes-version }}-${{ inputs.react-native-version }}
key: v4-hermes-artifacts-${{ inputs.flavor }}-${{ inputs.hermes-version }}-${{ inputs.react-native-version }}-${{ hashFiles('./packages/react-native/sdks/hermes/utils/build-apple-frameworks.sh') }}
path: |
/tmp/hermes/osx-bin/${{ inputs.flavor }}
/tmp/hermes/dSYM/${{ inputs.flavor }}
@@ -200,7 +200,7 @@ runs:
uses: actions/cache/save@v4
if: ${{ github.ref == 'refs/heads/main' || contains(github.ref, '-stable') }} # To avoid that the cache explode.
with:
key: v4-hermes-artifacts-${{ inputs.flavor }}-${{ inputs.hermes-version }}-${{ inputs.react-native-version }}
key: v4-hermes-artifacts-${{ inputs.flavor }}-${{ inputs.hermes-version }}-${{ inputs.react-native-version }}-${{ hashFiles('./packages/react-native/sdks/hermes/utils/build-apple-frameworks.sh') }}
path: |
/tmp/hermes/osx-bin/${{ inputs.flavor }}
/tmp/hermes/dSYM/${{ inputs.flavor }}
+7 -11
View File
@@ -32,8 +32,7 @@
"test-typescript": "dtslint packages/react-native/types",
"test": "jest",
"trigger-react-native-release": "node ./scripts/releases-local/trigger-react-native-release.js",
"update-lock": "npx yarn-deduplicate",
"postinstall": "cd packages/react-native-codegen && yarn build"
"update-lock": "npx yarn-deduplicate"
},
"workspaces": [
"packages/*",
@@ -50,8 +49,8 @@
"@definitelytyped/dtslint": "^0.0.127",
"@jest/create-cache-key-function": "^29.6.3",
"@pkgjs/parseargs": "^0.11.0",
"@react-native/metro-babel-transformer": "0.76.0-main",
"@react-native/metro-config": "0.76.0-main",
"@react-native/metro-babel-transformer": "0.76.0-rc.2",
"@react-native/metro-config": "0.76.0-rc.2",
"@tsconfig/node18": "1.0.1",
"@types/react": "^18.2.6",
"@typescript-eslint/parser": "^7.1.1",
@@ -87,24 +86,21 @@
"jest": "^29.6.3",
"jest-junit": "^10.0.0",
"jscodeshift": "^0.14.0",
"metro-babel-register": "^0.80.10",
"metro-memory-fs": "^0.80.10",
"metro-babel-register": "^0.81.0-alpha.0",
"metro-memory-fs": "^0.81.0-alpha.0",
"micromatch": "^4.0.4",
"mkdirp": "^0.5.1",
"node-fetch": "^2.2.0",
"nullthrows": "^1.1.1",
"prettier": "2.8.8",
"prettier-plugin-hermes-parser": "0.23.1",
"react": "19.0.0-rc-fb9a90fa48-20240614",
"react-test-renderer": "19.0.0-rc-fb9a90fa48-20240614",
"react": "18.3.1",
"react-test-renderer": "18.3.1",
"rimraf": "^3.0.2",
"shelljs": "^0.8.5",
"signedsource": "^1.0.0",
"supports-color": "^7.1.0",
"typescript": "5.0.4",
"ws": "^6.2.3"
},
"resolutions": {
"react-is": "19.0.0-rc-fb9a90fa48-20240614"
}
}
+1 -1
View File
@@ -1,6 +1,6 @@
{
"name": "@react-native/assets-registry",
"version": "0.76.0-main",
"version": "0.76.0-rc.2",
"description": "Asset support code for React Native.",
"license": "MIT",
"repository": {
+2 -2
View File
@@ -1,6 +1,6 @@
{
"name": "@react-native/babel-plugin-codegen",
"version": "0.76.0-main",
"version": "0.76.0-rc.2",
"description": "Babel plugin to generate native module and view manager code for React Native.",
"license": "MIT",
"repository": {
@@ -25,7 +25,7 @@
"index.js"
],
"dependencies": {
"@react-native/codegen": "0.76.0-main"
"@react-native/codegen": "0.76.0-rc.2"
},
"devDependencies": {
"@babel/core": "^7.25.2"
+7 -7
View File
@@ -1,6 +1,6 @@
{
"name": "@react-native/community-cli-plugin",
"version": "0.76.0-main",
"version": "0.76.0-rc.2",
"description": "Core CLI commands for React Native",
"keywords": [
"react-native",
@@ -22,18 +22,18 @@
"dist"
],
"dependencies": {
"@react-native/dev-middleware": "0.76.0-main",
"@react-native/metro-babel-transformer": "0.76.0-main",
"@react-native/dev-middleware": "0.76.0-rc.2",
"@react-native/metro-babel-transformer": "0.76.0-rc.2",
"chalk": "^4.0.0",
"execa": "^5.1.1",
"metro": "^0.80.10",
"metro-config": "^0.80.10",
"metro-core": "^0.80.10",
"metro": "^0.81.0-alpha.0",
"metro-config": "^0.81.0-alpha.0",
"metro-core": "^0.81.0-alpha.0",
"node-fetch": "^2.2.0",
"readline": "^1.3.0"
},
"devDependencies": {
"metro-resolver": "^0.80.10"
"metro-resolver": "^0.81.0-alpha.0"
},
"peerDependencies": {
"@react-native-community/cli-server-api": "*"
@@ -19,6 +19,18 @@ import fetch from 'node-fetch';
const CTRL_C = '\u0003';
const CTRL_D = '\u0004';
const RELOAD_TIMEOUT = 500;
const throttle = (callback: () => void, timeout: number) => {
let previousCallTimestamp = 0;
return () => {
const currentCallTimestamp = new Date().getTime();
if (currentCallTimestamp - previousCallTimestamp > timeout) {
previousCallTimestamp = currentCallTimestamp;
callback();
}
};
};
export default function attachKeyHandlers({
cliConfig,
@@ -41,11 +53,15 @@ export default function attachKeyHandlers({
env: {FORCE_COLOR: chalk.supportsColor ? 'true' : 'false'},
};
const reload = throttle(() => {
logger.info('Reloading connected app(s)...');
messageSocket.broadcast('reload', null);
}, RELOAD_TIMEOUT);
const onPress = async (key: string) => {
switch (key.toLowerCase()) {
case 'r':
logger.info('Reloading connected app(s)...');
messageSocket.broadcast('reload', null);
reload();
break;
case 'd':
logger.info('Opening Dev Menu...');
+1 -1
View File
@@ -1,6 +1,6 @@
{
"name": "@react-native/core-cli-utils",
"version": "0.76.0-main",
"version": "0.76.0-rc.2",
"description": "React Native CLI library for Frameworks to build on",
"license": "MIT",
"main": "./src/index.flow.js",
+2 -2
View File
@@ -1,5 +1,5 @@
@generated SignedSource<<d156d11a5d3cc2a10238c2f014ada9f9>>
Git revision: a556d261a5e2131864f4e38ded62d8f90e81c39a
@generated SignedSource<<85fb986aee1b601b649481b64d2b5dc8>>
Git revision: e8c79432972029c625c91d16967b07fe61f04a61
Built with --nohooks: false
Is local checkout: false
Remote URL: https://github.com/facebookexperimental/rn-chrome-devtools-frontend
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
@@ -1 +1 @@
import*as e from"../../core/i18n/i18n.js";import*as o from"../../ui/legacy/legacy.js";const t={title:"⚛️ Components",command:"Show React DevTools Components panel"},n=e.i18n.registerUIStrings("panels/react_devtools/react_devtools_components-meta.ts",t),a=e.i18n.getLazilyComputedLocalizedString.bind(void 0,n);let i;o.ViewManager.registerViewExtension({location:"panel",id:"react-devtools-components",title:a(t.title),commandPrompt:a(t.command),persistence:"permanent",order:1e3,loadView:async()=>new((await async function(){return i||(i=await import("./react_devtools.js")),i}()).ReactDevToolsComponentsView.ReactDevToolsComponentsViewImpl)});
import*as e from"../../core/i18n/i18n.js";import*as o from"../../ui/legacy/legacy.js";const t={title:"Components",command:"Show React DevTools Components panel"},n=e.i18n.registerUIStrings("panels/react_devtools/react_devtools_components-meta.ts",t),a=e.i18n.getLazilyComputedLocalizedString.bind(void 0,n);let i;o.ViewManager.registerViewExtension({location:"panel",id:"react-devtools-components",title:a(t.title),commandPrompt:a(t.command),persistence:"permanent",order:1e3,loadView:async()=>new((await async function(){return i||(i=await import("./react_devtools.js")),i}()).ReactDevToolsComponentsView.ReactDevToolsComponentsViewImpl)});
@@ -1 +1 @@
import*as e from"../../core/i18n/i18n.js";import*as o from"../../ui/legacy/legacy.js";const t={title:"⚛️ Profiler",command:"Show React DevTools Profiler panel"},i=e.i18n.registerUIStrings("panels/react_devtools/react_devtools_profiler-meta.ts",t),r=e.i18n.getLazilyComputedLocalizedString.bind(void 0,i);let a;o.ViewManager.registerViewExtension({location:"panel",id:"react-devtools-profiler",title:r(t.title),commandPrompt:r(t.command),persistence:"permanent",order:1e3,loadView:async()=>new((await async function(){return a||(a=await import("./react_devtools.js")),a}()).ReactDevToolsProfilerView.ReactDevToolsProfilerViewImpl)});
import*as e from"../../core/i18n/i18n.js";import*as o from"../../ui/legacy/legacy.js";const t={title:"Profiler",command:"Show React DevTools Profiler panel"},i=e.i18n.registerUIStrings("panels/react_devtools/react_devtools_profiler-meta.ts",t),r=e.i18n.getLazilyComputedLocalizedString.bind(void 0,i);let a;o.ViewManager.registerViewExtension({location:"panel",id:"react-devtools-profiler",title:r(t.title),commandPrompt:r(t.command),persistence:"permanent",order:1e3,loadView:async()=>new((await async function(){return a||(a=await import("./react_devtools.js")),a}()).ReactDevToolsProfilerView.ReactDevToolsProfilerViewImpl)});
File diff suppressed because one or more lines are too long
+1 -1
View File
@@ -1,6 +1,6 @@
{
"name": "@react-native/debugger-frontend",
"version": "0.76.0-main",
"version": "0.76.0-rc.2",
"description": "Debugger frontend for React Native based on Chrome DevTools",
"keywords": [
"react-native",
+2 -2
View File
@@ -1,6 +1,6 @@
{
"name": "@react-native/dev-middleware",
"version": "0.76.0-main",
"version": "0.76.0-rc.2",
"description": "Dev server middleware for React Native",
"keywords": [
"react-native",
@@ -23,7 +23,7 @@
],
"dependencies": {
"@isaacs/ttlcache": "^1.4.1",
"@react-native/debugger-frontend": "0.76.0-main",
"@react-native/debugger-frontend": "0.76.0-rc.2",
"chrome-launcher": "^0.15.2",
"chromium-edge-launcher": "^0.2.0",
"connect": "^3.6.5",
@@ -1,6 +1,6 @@
{
"name": "@react-native/eslint-config",
"version": "0.76.0-main",
"version": "0.76.0-rc.2",
"description": "ESLint config for React Native",
"license": "MIT",
"repository": {
@@ -22,7 +22,7 @@
"dependencies": {
"@babel/core": "^7.25.2",
"@babel/eslint-parser": "^7.25.1",
"@react-native/eslint-plugin": "0.76.0-main",
"@react-native/eslint-plugin": "0.76.0-rc.2",
"@typescript-eslint/eslint-plugin": "^7.1.1",
"@typescript-eslint/parser": "^7.1.1",
"eslint-config-prettier": "^8.5.0",
@@ -1,6 +1,6 @@
{
"name": "@react-native/eslint-plugin",
"version": "0.76.0-main",
"version": "0.76.0-rc.2",
"description": "ESLint rules for @react-native/eslint-config",
"license": "MIT",
"repository": {
+2 -2
View File
@@ -1,6 +1,6 @@
{
"name": "@react-native/eslint-plugin-specs",
"version": "0.76.0-main",
"version": "0.76.0-rc.2",
"description": "ESLint rules to validate NativeModule and Component Specs",
"license": "MIT",
"repository": {
@@ -31,7 +31,7 @@
"@babel/eslint-parser": "^7.25.1",
"@babel/plugin-transform-flow-strip-types": "^7.25.2",
"@babel/preset-flow": "^7.24.7",
"@react-native/codegen": "0.76.0-main",
"@react-native/codegen": "0.76.0-rc.2",
"make-dir": "^2.1.0",
"pirates": "^4.0.1",
"source-map-support": "0.5.0"
+1 -1
View File
@@ -1,6 +1,6 @@
{
"name": "@react-native/gradle-plugin",
"version": "0.76.0-main",
"version": "0.76.0-rc.2",
"description": "Gradle Plugin for React Native",
"license": "MIT",
"repository": {
@@ -188,6 +188,7 @@ abstract class ReactExtension @Inject constructor(val project: Project) {
?.dependencies
?.values
?.filter { it.platforms?.android !== null }
?.filterNot { it.platforms?.android?.isPureCxxDependency == true }
?.forEach { deps ->
val nameCleansed = deps.nameCleansed
val dependencyConfiguration = deps.platforms?.android?.dependencyConfiguration
@@ -30,10 +30,19 @@ abstract class GeneratePackageListTask : DefaultTask() {
@TaskAction
fun taskAction() {
val model = JsonUtils.fromAutolinkingConfigJson(autolinkInputFile.get().asFile)
val model =
JsonUtils.fromAutolinkingConfigJson(autolinkInputFile.get().asFile)
?: error(
"""
RNGP - Autolinking: Could not parse autolinking config file:
${autolinkInputFile.get().asFile.absolutePath}
The file is either missing or not containing valid JSON so the build won't succeed.
"""
.trimIndent())
val packageName =
model?.project?.android?.packageName
model.project?.android?.packageName
?: error(
"RNGP - Autolinking: Could not find project.android.packageName in react-native config output! Could not autolink packages without this field.")
@@ -189,6 +189,44 @@ class ReactExtensionTest {
assertThat(deps).isEmpty()
}
@Test
fun getGradleDependenciesToApply_withIsPureCxxDeps_filtersCorrectly() {
val validJsonFile =
createJsonFile(
"""
{
"reactNativeVersion": "1000.0.0",
"dependencies": {
"@react-native/oss-library-example": {
"root": "./node_modules/@react-native/android-example",
"name": "@react-native/android-example",
"platforms": {
"android": {
"sourceDir": "src/main/java",
"packageImportPath": "com.facebook.react"
}
}
},
"@react-native/another-library-for-testing": {
"root": "./node_modules/@react-native/cxx-testing",
"name": "@react-native/cxx-testing",
"platforms": {
"android": {
"sourceDir": "src/main/java",
"packageImportPath": "com.facebook.react",
"isPureCxxDependency": true
}
}
}
}
}
"""
.trimIndent())
val deps = getGradleDependenciesToApply(validJsonFile)
assertThat(deps).containsExactly("implementation" to ":react-native_android-example")
}
private fun createJsonFile(@Language("JSON") input: String) =
tempFolder.newFile().apply { writeText(input) }
}
@@ -21,8 +21,23 @@ object JsonUtils {
}
fun fromAutolinkingConfigJson(input: File): ModelAutolinkingConfigJson? =
input.bufferedReader().use {
runCatching { gsonConverter.fromJson(it, ModelAutolinkingConfigJson::class.java) }
input.bufferedReader().use { reader ->
runCatching {
// We sanitize the output of the `config` command as it could contain debug logs
// such as:
//
// > AwesomeProject@0.0.1 npx
// > rnc-cli config
//
// which will render the JSON invalid.
val content =
reader
.readLines()
.filterNot { line -> line.startsWith(">") }
.joinToString("\n")
.trim()
gsonConverter.fromJson(content, ModelAutolinkingConfigJson::class.java)
}
.getOrNull()
}
}
@@ -186,6 +186,54 @@ class JsonUtilsTest {
assertThat("implementation").isEqualTo(parsed.project!!.android!!.dependencyConfiguration)
}
@Test
fun fromAutolinkingConfigJson_withInfoLogs_sanitizeAndParseIt() {
@Suppress("JsonStandardCompliance")
val validJson =
createJsonFile(
"""
> AwesomeProject@0.0.1 npx
> rnc-cli config
{
"reactNativeVersion": "1000.0.0",
"project": {
"ios": {
"sourceDir": "./packages/rn-tester",
"xcodeProject": {
"name": "RNTesterPods.xcworkspace",
"isWorkspace": true
},
"automaticPodsInstallation": false
},
"android": {
"sourceDir": "./packages/rn-tester",
"appName": "RN-Tester",
"packageName": "com.facebook.react.uiapp",
"applicationId": "com.facebook.react.uiapp",
"mainActivity": ".RNTesterActivity",
"watchModeCommandParams": [
"--mode HermesDebug"
],
"dependencyConfiguration": "implementation"
}
}
}
"""
.trimIndent())
val parsed = JsonUtils.fromAutolinkingConfigJson(validJson)!!
assertThat("./packages/rn-tester").isEqualTo(parsed.project!!.android!!.sourceDir)
assertThat("RN-Tester").isEqualTo(parsed.project!!.android!!.appName)
assertThat("com.facebook.react.uiapp").isEqualTo(parsed.project!!.android!!.packageName)
assertThat("com.facebook.react.uiapp").isEqualTo(parsed.project!!.android!!.applicationId)
assertThat(".RNTesterActivity").isEqualTo(parsed.project!!.android!!.mainActivity)
assertThat("--mode HermesDebug")
.isEqualTo(parsed.project!!.android!!.watchModeCommandParams!![0])
assertThat("implementation").isEqualTo(parsed.project!!.android!!.dependencyConfiguration)
}
@Test
fun fromAutolinkingConfigJson_withDependenciesSpecified_canParseIt() {
val validJson =
@@ -16,6 +16,7 @@ import com.facebook.react.ReactPackage
import com.facebook.react.defaults.DefaultNewArchitectureEntryPoint.load
import com.facebook.react.defaults.DefaultReactHost.getDefaultReactHost
import com.facebook.react.defaults.DefaultReactNativeHost
import com.facebook.react.soloader.OpenSourceMergedSoMapping
import com.facebook.soloader.SoLoader
class MainApplication : Application(), ReactApplication {
@@ -41,7 +42,7 @@ class MainApplication : Application(), ReactApplication {
override fun onCreate() {
super.onCreate()
SoLoader.init(this, false)
SoLoader.init(this, OpenSourceMergedSoMapping)
if (BuildConfig.IS_NEW_ARCHITECTURE_ENABLED) {
// If you opted-in for the New Architecture, we load the native entry point for this app.
load()
+8 -8
View File
@@ -1,6 +1,6 @@
{
"name": "helloworld",
"version": "0.76.0-main",
"version": "0.76.0-rc.2",
"private": true,
"scripts": {
"bootstrap": "node ./cli.js bootstrap",
@@ -12,24 +12,24 @@
"test": "jest"
},
"dependencies": {
"react": "19.0.0-rc-fb9a90fa48-20240614",
"react-native": "1000.0.0"
"react": "18.3.1",
"react-native": "0.76.0-rc.2"
},
"devDependencies": {
"@babel/core": "^7.25.2",
"@babel/preset-env": "^7.25.3",
"@babel/runtime": "^7.25.0",
"@react-native/babel-preset": "0.76.0-main",
"@react-native/core-cli-utils": "0.76.0-main",
"@react-native/eslint-config": "0.76.0-main",
"@react-native/metro-config": "0.76.0-main",
"@react-native/babel-preset": "0.76.0-rc.2",
"@react-native/core-cli-utils": "0.76.0-rc.2",
"@react-native/eslint-config": "0.76.0-rc.2",
"@react-native/metro-config": "0.76.0-rc.2",
"babel-jest": "^29.6.3",
"chalk": "^4.1.2",
"commander": "^12.0.0",
"eslint": "^8.19.0",
"jest": "^29.6.3",
"listr2": "^8.2.1",
"react-test-renderer": "19.0.0-rc-fb9a90fa48-20240614",
"react-test-renderer": "18.3.1",
"rxjs": "^7.8.1"
},
"engines": {
@@ -1,6 +1,6 @@
{
"name": "@react-native/hermes-inspector-msggen",
"version": "0.76.0-main",
"version": "0.76.0-rc.2",
"private": true,
"description": "Hermes Inspector Message Generator for React Native",
"license": "MIT",
+5 -5
View File
@@ -1,6 +1,6 @@
{
"name": "@react-native/metro-config",
"version": "0.76.0-main",
"version": "0.76.0-rc.2",
"description": "Metro configuration for React Native.",
"license": "MIT",
"repository": {
@@ -26,9 +26,9 @@
"dist"
],
"dependencies": {
"@react-native/js-polyfills": "0.76.0-main",
"@react-native/metro-babel-transformer": "0.76.0-main",
"metro-config": "^0.80.10",
"metro-runtime": "^0.80.10"
"@react-native/js-polyfills": "0.76.0-rc.2",
"@react-native/metro-babel-transformer": "0.76.0-rc.2",
"metro-config": "^0.81.0-alpha.0",
"metro-runtime": "^0.81.0-alpha.0"
}
}
+1 -1
View File
@@ -1,6 +1,6 @@
{
"name": "@react-native/normalize-colors",
"version": "0.76.0-main",
"version": "0.76.0-rc.2",
"description": "Color normalization for React Native.",
"license": "MIT",
"repository": {
+1 -1
View File
@@ -1,6 +1,6 @@
{
"name": "@react-native/js-polyfills",
"version": "0.76.0-main",
"version": "0.76.0-rc.2",
"description": "Polyfills for React Native.",
"license": "MIT",
"repository": {
@@ -1,6 +1,6 @@
{
"name": "@react-native/babel-preset",
"version": "0.76.0-main",
"version": "0.76.0-rc.2",
"description": "Babel preset for React Native applications",
"main": "src/index.js",
"repository": {
@@ -56,7 +56,7 @@
"@babel/plugin-transform-typescript": "^7.25.2",
"@babel/plugin-transform-unicode-regex": "^7.24.7",
"@babel/template": "^7.25.0",
"@react-native/babel-plugin-codegen": "0.76.0-main",
"@react-native/babel-plugin-codegen": "0.76.0-rc.2",
"babel-plugin-transform-flow-enums": "^0.0.2",
"react-refresh": "^0.14.0"
},
@@ -1,6 +1,6 @@
{
"name": "@react-native/metro-babel-transformer",
"version": "0.76.0-main",
"version": "0.76.0-rc.2",
"description": "Babel transformer for React Native applications.",
"main": "src/index.js",
"repository": {
@@ -16,7 +16,7 @@
"license": "MIT",
"dependencies": {
"@babel/core": "^7.25.2",
"@react-native/babel-preset": "0.76.0-main",
"@react-native/babel-preset": "0.76.0-rc.2",
"hermes-parser": "0.23.1",
"nullthrows": "^1.1.1"
},
+1 -1
View File
@@ -1,7 +1,7 @@
{
"name": "@react-native/bots",
"description": "React Native Bots",
"version": "0.76.0-main",
"version": "0.76.0-rc.2",
"private": true,
"license": "MIT",
"repository": {
@@ -1,6 +1,6 @@
{
"name": "@react-native/codegen-typescript-test",
"version": "0.76.0-main",
"version": "0.76.0-rc.2",
"private": true,
"description": "TypeScript related unit test for @react-native/codegen",
"license": "MIT",
@@ -19,7 +19,7 @@
"prepare": "yarn run build"
},
"dependencies": {
"@react-native/codegen": "0.76.0-main"
"@react-native/codegen": "0.76.0-rc.2"
},
"devDependencies": {
"@babel/core": "^7.25.2",
+1 -1
View File
@@ -1,6 +1,6 @@
{
"name": "@react-native/codegen",
"version": "0.76.0-main",
"version": "0.76.0-rc.2",
"description": "Code generation tools for React Native",
"license": "MIT",
"repository": {
+1 -1
View File
@@ -1,6 +1,6 @@
{
"name": "react-native-info",
"version": "0.76.0-main",
"version": "0.76.0-rc.2",
"main": "build/index.js",
"license": "MIT",
"private": true,
@@ -1,6 +1,6 @@
{
"name": "@react-native/popup-menu-android",
"version": "0.76.0-main",
"version": "0.76.0-rc.2",
"description": "PopupMenu for the Android platform",
"main": "index.js",
"files": [
@@ -17,7 +17,7 @@
],
"license": "MIT",
"devDependencies": {
"@react-native/codegen": "0.76.0-main"
"@react-native/codegen": "0.76.0-rc.2"
},
"peerDependencies": {
"@types/react": "^18.2.6",
@@ -1,6 +1,6 @@
{
"name": "@react-native/oss-library-example",
"version": "0.76.0-main",
"version": "0.76.0-rc.2",
"private": true,
"description": "Package that includes native module exapmle, native component example, targets both the old and the new architecture. It should serve as an example of a real-world OSS library.",
"license": "MIT",
@@ -26,8 +26,8 @@
],
"devDependencies": {
"@babel/core": "^7.25.2",
"@react-native/babel-preset": "0.76.0-main",
"react-native": "1000.0.0"
"@react-native/babel-preset": "0.76.0-rc.2",
"react-native": "0.76.0-rc.2"
},
"peerDependencies": {
"react": "*",
@@ -1,7 +1,7 @@
{
"name": "@react-native/test-renderer",
"private": true,
"version": "0.76.0-main",
"version": "0.76.0-rc.2",
"description": "A Test rendering library for React Native",
"license": "MIT",
"devDependencies": {
@@ -1931,19 +1931,22 @@ function createRefForwarder<TNativeInstance, TPublicInstance>(
return state;
}
// TODO: After upgrading to React 19, remove `forwardRef` from this component.
// NOTE: This wrapper component is necessary because `ScrollView` is a class
// component and we need to map `ref` to a differently named prop. This can be
// removed when `ScrollView` is a functional component.
function Wrapper({
ref,
...props
}: {
...Props,
ref: React.RefSetter<PublicScrollViewInstance>,
}): React.Node {
return <ScrollView {...props} scrollViewRef={ref} />;
}
const Wrapper = React.forwardRef(function Wrapper(
props: Props,
ref: ?React.RefSetter<PublicScrollViewInstance>,
): React.Node {
return ref == null ? (
<ScrollView {...props} />
) : (
<ScrollView {...props} scrollViewRef={ref} />
);
});
Wrapper.displayName = 'ScrollView';
// $FlowExpectedError[prop-missing]
Wrapper.Context = ScrollViewContext;
module.exports = ((Wrapper: $FlowFixMe): React.AbstractComponent<
@@ -160,6 +160,9 @@ export const __INTERNAL_VIEW_CONFIG: PartialViewConfig =
snapToInterval: true,
snapToOffsets: true,
snapToStart: true,
verticalScrollIndicatorInsets: {
diff: require('../../Utilities/differ/insetsDiffer'),
},
zoomScale: true,
...ConditionallyIgnoredEventHandlers({
onScrollBeginDrag: true,
@@ -85,8 +85,15 @@ const RCTTextInputViewConfig = {
topContentSizeChange: {
registrationName: 'onContentSizeChange',
},
topChangeSync: {
registrationName: 'onChangeSync',
},
topKeyPressSync: {
registrationName: 'onKeyPressSync',
},
},
validAttributes: {
dynamicTypeRamp: true,
fontSize: true,
fontWeight: true,
fontVariant: true,
@@ -97,6 +104,7 @@ const RCTTextInputViewConfig = {
textTransform: true,
textAlign: true,
fontFamily: true,
lineBreakModeIOS: true,
lineHeight: true,
isHighlighted: true,
writingDirection: true,
@@ -150,6 +158,8 @@ const RCTTextInputViewConfig = {
onSelectionChange: true,
onContentSizeChange: true,
onScroll: true,
onChangeSync: true,
onKeyPressSync: true,
}),
},
};
@@ -120,7 +120,7 @@ const ReactNativeStyleAttributes: {[string]: AnyAttributeType, ...} = {
/**
* Filter
*/
experimental_filter: {process: processFilter},
filter: {process: processFilter},
/**
* MixBlendMode
@@ -135,7 +135,7 @@ const ReactNativeStyleAttributes: {[string]: AnyAttributeType, ...} = {
/*
* BoxShadow
*/
experimental_boxShadow: {process: processBoxShadow},
boxShadow: {process: processBoxShadow},
/**
* Linear Gradient
+3 -3
View File
@@ -14,10 +14,10 @@ const version: $ReadOnly<{
patch: number,
prerelease: string | null,
}> = {
major: 1000,
minor: 0,
major: 0,
minor: 76,
patch: 0,
prerelease: null,
prerelease: 'rc.2',
};
module.exports = {version};
@@ -169,10 +169,10 @@ const validAttributesForNonEventProps = {
experimental_backgroundImage: {
process: require('../StyleSheet/processBackgroundImage').default,
},
experimental_boxShadow: {
boxShadow: {
process: require('../StyleSheet/processBoxShadow').default,
},
experimental_filter: {
filter: {
process: require('../StyleSheet/processFilter').default,
},
experimental_mixBlendMode: true,
@@ -198,6 +198,7 @@ const validAttributesForNonEventProps = {
testID: true,
backgroundColor: {process: require('../StyleSheet/processColor').default},
backfaceVisibility: true,
cursor: true,
opacity: true,
shadowColor: {process: require('../StyleSheet/processColor').default},
shadowOffset: {diff: require('../Utilities/differ/sizesDiffer')},
@@ -216,16 +217,18 @@ const validAttributesForNonEventProps = {
role: true,
borderRadius: true,
borderColor: {process: require('../StyleSheet/processColor').default},
borderBlockColor: {process: require('../StyleSheet/processColor').default},
borderCurve: true,
borderWidth: true,
borderBlockWidth: true,
borderStyle: true,
hitSlop: {diff: require('../Utilities/differ/insetsDiffer')},
collapsable: true,
collapsableChildren: true,
experimental_filter: {
filter: {
process: require('../StyleSheet/processFilter').default,
},
experimental_boxShadow: {
boxShadow: {
process: require('../StyleSheet/processBoxShadow').default,
},
experimental_mixBlendMode: true,
@@ -240,9 +243,15 @@ const validAttributesForNonEventProps = {
borderLeftWidth: true,
borderLeftColor: {process: require('../StyleSheet/processColor').default},
borderStartWidth: true,
borderBlockStartWidth: true,
borderStartColor: {process: require('../StyleSheet/processColor').default},
borderBlockStartColor: {
process: require('../StyleSheet/processColor').default,
},
borderEndWidth: true,
borderBlockEndWidth: true,
borderEndColor: {process: require('../StyleSheet/processColor').default},
borderBlockEndColor: {process: require('../StyleSheet/processColor').default},
borderTopLeftRadius: true,
borderTopRightRadius: true,
@@ -188,6 +188,10 @@ function getProcessorForType(typeName: string): ?(nextProp: any) => any {
case 'UIImage':
case 'RCTImageSource':
return resolveAssetSource;
case 'BoxShadowArray':
return processBoxShadow;
case 'FilterArray':
return processFilter;
// Android Types
case 'Color':
return processColor;
File diff suppressed because it is too large Load Diff
File diff suppressed because it is too large Load Diff
File diff suppressed because it is too large Load Diff
File diff suppressed because it is too large Load Diff
File diff suppressed because it is too large Load Diff
File diff suppressed because it is too large Load Diff
@@ -110,11 +110,102 @@ export interface FlexStyle {
top?: DimensionValue | undefined;
width?: DimensionValue | undefined;
zIndex?: number | undefined;
direction?: 'inherit' | 'ltr' | 'rtl' | undefined;
/**
* @platform ios
* Equivalent to `top`, `bottom`, `right` and `left`
*/
direction?: 'inherit' | 'ltr' | 'rtl' | undefined;
inset?: DimensionValue | undefined;
/**
* Equivalent to `top`, `bottom`
*/
insetBlock?: DimensionValue | undefined;
/**
* Equivalent to `bottom`
*/
insetBlockEnd?: DimensionValue | undefined;
/**
* Equivalent to `top`
*/
insetBlockStart?: DimensionValue | undefined;
/**
* Equivalent to `right` and `left`
*/
insetInline?: DimensionValue | undefined;
/**
* Equivalent to `right` or `left`
*/
insetInlineEnd?: DimensionValue | undefined;
/**
* Equivalent to `right` or `left`
*/
insetInlineStart?: DimensionValue | undefined;
/**
* Equivalent to `marginVertical`
*/
marginBlock?: DimensionValue | undefined;
/**
* Equivalent to `marginBottom`
*/
marginBlockEnd?: DimensionValue | undefined;
/**
* Equivalent to `marginTop`
*/
marginBlockStart?: DimensionValue | undefined;
/**
* Equivalent to `marginHorizontal`
*/
marginInline?: DimensionValue | undefined;
/**
* Equivalent to `marginEnd`
*/
marginInlineEnd?: DimensionValue | undefined;
/**
* Equivalent to `marginStart`
*/
marginInlineStart?: DimensionValue | undefined;
/**
* Equivalent to `paddingVertical`
*/
paddingBlock?: DimensionValue | undefined;
/**
* Equivalent to `paddingBottom`
*/
paddingBlockEnd?: DimensionValue | undefined;
/**
* Equivalent to `paddingTop`
*/
paddingBlockStart?: DimensionValue | undefined;
/**
* Equivalent to `paddingHorizontal`
*/
paddingInline?: DimensionValue | undefined;
/**
* Equivalent to `paddingEnd`
*/
paddingInlineEnd?: DimensionValue | undefined;
/**
* Equivalent to `paddingStart`
*/
paddingInlineStart?: DimensionValue | undefined;
}
export interface ShadowStyleIOS {
@@ -239,16 +330,16 @@ export type FilterFunction =
| {opacity: number | string}
| {saturate: number | string}
| {sepia: number | string}
| {dropShadow: DropShadowPrimitive | string};
| {dropShadow: DropShadowValue | string};
export type DropShadowPrimitive = {
export type DropShadowValue = {
offsetX: number | string;
offsetY: number | string;
standardDeviation?: number | string | undefined;
color?: ColorValue | number | undefined;
};
export type BoxShadowPrimitive = {
export type BoxShadowValue = {
offsetX: number | string;
offsetY: number | string;
color?: string | undefined;
@@ -336,6 +427,8 @@ export interface ViewStyle extends FlexStyle, ShadowStyleIOS, TransformsStyle {
pointerEvents?: 'box-none' | 'none' | 'box-only' | 'auto' | undefined;
isolation?: 'auto' | 'isolate' | undefined;
cursor?: CursorValue | undefined;
boxShadow?: ReadonlyArray<BoxShadowValue> | string | undefined;
filter?: ReadonlyArray<FilterFunction> | string | undefined;
}
export type FontVariant =
@@ -700,9 +700,9 @@ export type FilterFunction =
| {opacity: number | string}
| {saturate: number | string}
| {sepia: number | string}
| {dropShadow: DropShadowPrimitive | string};
| {dropShadow: DropShadowValue | string};
export type DropShadowPrimitive = {
export type DropShadowValue = {
offsetX: number | string,
offsetY: number | string,
standardDeviation?: number | string,
@@ -719,7 +719,7 @@ export type GradientValue = {
}>,
};
export type BoxShadowPrimitive = {
export type BoxShadowValue = {
offsetX: number | string,
offsetY: number | string,
color?: ____ColorValue_Internal,
@@ -788,8 +788,8 @@ export type ____ViewStyle_InternalCore = $ReadOnly<{
elevation?: number,
pointerEvents?: 'auto' | 'none' | 'box-none' | 'box-only',
cursor?: CursorValue,
experimental_boxShadow?: $ReadOnlyArray<BoxShadowPrimitive> | string,
experimental_filter?: $ReadOnlyArray<FilterFunction> | string,
boxShadow?: $ReadOnlyArray<BoxShadowValue> | string,
filter?: $ReadOnlyArray<FilterFunction> | string,
experimental_mixBlendMode?: ____BlendMode_Internal,
experimental_backgroundImage?: $ReadOnlyArray<GradientValue> | string,
isolation?: 'auto' | 'isolate',
@@ -10,7 +10,7 @@
*/
import type {ProcessedColorValue} from './processColor';
import type {BoxShadowPrimitive} from './StyleSheetTypes';
import type {BoxShadowValue} from './StyleSheetTypes';
import processColor from './processColor';
@@ -24,7 +24,7 @@ export type ParsedBoxShadow = {
};
export default function processBoxShadow(
rawBoxShadows: ?($ReadOnlyArray<BoxShadowPrimitive> | string),
rawBoxShadows: ?($ReadOnlyArray<BoxShadowValue> | string),
): Array<ParsedBoxShadow> {
const result: Array<ParsedBoxShadow> = [];
if (rawBoxShadows == null) {
@@ -106,16 +106,14 @@ export default function processBoxShadow(
return result;
}
function parseBoxShadowString(
rawBoxShadows: string,
): Array<BoxShadowPrimitive> {
let result: Array<BoxShadowPrimitive> = [];
function parseBoxShadowString(rawBoxShadows: string): Array<BoxShadowValue> {
let result: Array<BoxShadowValue> = [];
for (const rawBoxShadow of rawBoxShadows
.split(/,(?![^()]*\))/) // split by comma that is not in parenthesis
.map(bS => bS.trim())
.filter(bS => bS !== '')) {
const boxShadow: BoxShadowPrimitive = {
const boxShadow: BoxShadowValue = {
offsetX: 0,
offsetY: 0,
};
@@ -12,7 +12,7 @@
'use strict';
import type {ColorValue} from './StyleSheet';
import type {DropShadowPrimitive, FilterFunction} from './StyleSheetTypes';
import type {DropShadowValue, FilterFunction} from './StyleSheetTypes';
import processColor from './processColor';
@@ -179,7 +179,7 @@ function _getFilterAmount(filterName: string, filterArgs: mixed): ?number {
}
function parseDropShadow(
rawDropShadow: string | DropShadowPrimitive,
rawDropShadow: string | DropShadowValue,
): ?ParsedDropShadow {
const dropShadow =
typeof rawDropShadow === 'string'
@@ -248,8 +248,8 @@ function parseDropShadow(
return parsedDropShadow;
}
function parseDropShadowString(rawDropShadow: string): ?DropShadowPrimitive {
const dropShadow: DropShadowPrimitive = {
function parseDropShadowString(rawDropShadow: string): ?DropShadowValue {
const dropShadow: DropShadowValue = {
offsetX: 0,
offsetY: 0,
};
@@ -8232,8 +8232,8 @@ export type FilterFunction =
| { opacity: number | string }
| { saturate: number | string }
| { sepia: number | string }
| { dropShadow: DropShadowPrimitive | string };
export type DropShadowPrimitive = {
| { dropShadow: DropShadowValue | string };
export type DropShadowValue = {
offsetX: number | string,
offsetY: number | string,
standardDeviation?: number | string,
@@ -8247,7 +8247,7 @@ export type GradientValue = {
positions?: $ReadOnlyArray<string>,
}>,
};
export type BoxShadowPrimitive = {
export type BoxShadowValue = {
offsetX: number | string,
offsetY: number | string,
color?: ____ColorValue_Internal,
@@ -8314,8 +8314,8 @@ export type ____ViewStyle_InternalCore = $ReadOnly<{
elevation?: number,
pointerEvents?: \\"auto\\" | \\"none\\" | \\"box-none\\" | \\"box-only\\",
cursor?: CursorValue,
experimental_boxShadow?: $ReadOnlyArray<BoxShadowPrimitive> | string,
experimental_filter?: $ReadOnlyArray<FilterFunction> | string,
boxShadow?: $ReadOnlyArray<BoxShadowValue> | string,
filter?: $ReadOnlyArray<FilterFunction> | string,
experimental_mixBlendMode?: ____BlendMode_Internal,
experimental_backgroundImage?: $ReadOnlyArray<GradientValue> | string,
isolation?: \\"auto\\" | \\"isolate\\",
@@ -8586,7 +8586,7 @@ exports[`public API should not change unintentionally Libraries/StyleSheet/proce
inset?: boolean,
};
declare export default function processBoxShadow(
rawBoxShadows: ?($ReadOnlyArray<BoxShadowPrimitive> | string)
rawBoxShadows: ?($ReadOnlyArray<BoxShadowValue> | string)
): Array<ParsedBoxShadow>;
"
`;
@@ -21,10 +21,10 @@ NSDictionary* RCTGetReactNativeVersion(void)
static dispatch_once_t onceToken;
dispatch_once(&onceToken, ^(void){
__rnVersion = @{
RCTVersionMajor: @(1000),
RCTVersionMinor: @(0),
RCTVersionMajor: @(0),
RCTVersionMinor: @(76),
RCTVersionPatch: @(0),
RCTVersionPrerelease: [NSNull null],
RCTVersionPrerelease: @"rc.2",
};
});
return __rnVersion;
@@ -723,6 +723,29 @@ static inline UIViewAnimationOptions animationOptionsWithCurve(UIViewAnimationCu
[self _handleFinishedScrolling:scrollView];
}
- (void)didMoveToWindow
{
[super didMoveToWindow];
if (!self.window) {
// The view is being removed, ensure that the scroll end event is dispatched
[self _handleScrollEndIfNeeded];
}
}
- (void)_handleScrollEndIfNeeded
{
if (_scrollView.isDecelerating || !_scrollView.isTracking) {
if (!_eventEmitter) {
return;
}
static_cast<const ScrollViewEventEmitter &>(*_eventEmitter).onMomentumScrollEnd([self _scrollViewMetrics]);
[self _updateStateWithContentOffset];
_isUserTriggeredScrolling = NO;
}
}
- (void)_handleFinishedScrolling:(UIScrollView *)scrollView
{
[self _forceDispatchNextScrollEvent];
@@ -431,18 +431,19 @@ RCT_CUSTOM_VIEW_PROPERTY(experimental_layoutConformance, NSString *, RCTView)
// filtered by view configs.
}
RCT_CUSTOM_VIEW_PROPERTY(experimental_filter, NSArray *, RCTView)
typedef NSArray *FilterArray; // Custom type to make the StaticViewConfigValidator Happy
RCT_CUSTOM_VIEW_PROPERTY(filter, FilterArray, RCTView)
{
// Property is only to be used in the new renderer.
// It is necessary to add it here, otherwise it gets
// filtered by view configs.
// Property is only to be used in the new renderer.
// It is necessary to add it here, otherwise it gets
// filtered by view configs.
}
RCT_CUSTOM_VIEW_PROPERTY(experimental_boxShadow, NSArray *, RCTView)
typedef NSArray *BoxShadowArray; // Custom type to make the StaticViewConfigValidator Happy
RCT_CUSTOM_VIEW_PROPERTY(boxShadow, BoxShadowArray, RCTView)
{
// Property is only to be used in the new renderer.
// It is necessary to add it here, otherwise it gets
// filtered by view configs.
// Property is only to be used in the new renderer.
// It is necessary to add it here, otherwise it gets
// filtered by view configs.
}
RCT_CUSTOM_VIEW_PROPERTY(experimental_mixBlendMode, NSString *, RCTView)
@@ -848,6 +848,26 @@ RCT_SCROLL_EVENT_HANDLER(scrollViewDidScrollToTop, onScrollToTop)
RCT_FORWARD_SCROLL_EVENT(scrollViewDidEndZooming : scrollView withView : view atScale : scale);
}
- (void)didMoveToWindow
{
[super didMoveToWindow];
if (self.window == nil) {
// Check if the ScrollView was in motion
if (_scrollView.isDecelerating || !_scrollView.isTracking) {
// Trigger the onMomentumScrollEnd event manually
RCT_SEND_SCROLL_EVENT(onMomentumScrollEnd, nil);
// We can't use the RCT_FORWARD_SCROLL_EVENT here beacuse the `_cmd` parameter passed
// to `respondsToSelector` is the current method - so it will be `didMoveToWindow` - and not
// `scrollViewDidEndDecelerating` that is passed.
for (NSObject<UIScrollViewDelegate> *scrollViewListener in _scrollListeners) {
if ([scrollViewListener respondsToSelector:@selector(scrollViewDidEndDecelerating:)]) {
[scrollViewListener scrollViewDidEndDecelerating:_scrollView];
}
}
}
}
}
- (void)scrollViewDidEndDecelerating:(UIScrollView *)scrollView
{
// Fire a final scroll event
@@ -4047,6 +4047,33 @@ public class com/facebook/react/shell/MainReactPackage$$ReactModuleInfoProvider
public fun getReactModuleInfos ()Ljava/util/Map;
}
public final class com/facebook/react/soloader/OpenSourceMergedSoMapping : com/facebook/soloader/ExternalSoMapping {
public static final field INSTANCE Lcom/facebook/react/soloader/OpenSourceMergedSoMapping;
public fun invokeJniOnload (Ljava/lang/String;)V
public final fun libfabricjni_so ()I
public final fun libhermes_executor_so ()I
public final fun libhermesinstancejni_so ()I
public final fun libhermestooling_so ()I
public final fun libjscexecutor_so ()I
public final fun libjscinstance_so ()I
public final fun libjscruntime_so ()I
public final fun libjsctooling_so ()I
public final fun libjsijniprofiler_so ()I
public final fun libjsinspector_so ()I
public final fun libmapbufferjni_so ()I
public final fun libreact_devsupportjni_so ()I
public final fun libreact_featureflagsjni_so ()I
public final fun libreact_newarchdefaults_so ()I
public final fun libreactnative_so ()I
public final fun libreactnativeblob_so ()I
public final fun libreactnativejni_so ()I
public final fun librninstance_so ()I
public final fun libturbomodulejsijni_so ()I
public final fun libuimanagerjni_so ()I
public final fun libyoga_so ()I
public fun mapLibName (Ljava/lang/String;)Ljava/lang/String;
}
public final class com/facebook/react/touch/JSResponderHandler : com/facebook/react/touch/OnInterceptTouchEventListener {
public fun <init> ()V
public final fun clearJSResponder ()V
@@ -220,10 +220,20 @@ val preparePrefab by
Pair(
"../ReactCommon/react/renderer/observers/events/",
"react/renderer/observers/events/"),
// react_timing
Pair("../ReactCommon/react/timing/", "react/timing/"),
// yoga
Pair("../ReactCommon/yoga/", ""),
Pair("src/main/jni/first-party/yogajni/jni", ""),
)),
PrefabPreprocessingEntry("hermestooling",
// hermes_executor
Pair("../ReactCommon/hermes/inspector-modern/", "hermes/inspector-modern/")
),
PrefabPreprocessingEntry("jsctooling",
// jsc
Pair("../ReactCommon/jsc/", "jsc/")
),
))
outputDir.set(prefabHeadersDir)
}
@@ -550,7 +560,6 @@ android {
"src/main/res/views/alert",
"src/main/res/views/modal",
"src/main/res/views/uimanager"))
kotlin.srcDir(project.file("../sdks/ossonly-soloader/src/main/java"))
java.exclude("com/facebook/react/processing")
java.exclude("com/facebook/react/module/processing")
}
@@ -580,6 +589,8 @@ android {
prefab {
create("jsi") { headers = File(prefabHeadersDir, "jsi").absolutePath }
create("reactnative") { headers = File(prefabHeadersDir, "reactnative").absolutePath }
create("hermestooling") { headers = File(prefabHeadersDir, "hermestooling").absolutePath }
create("jsctooling") { headers = File(prefabHeadersDir, "jsctooling").absolutePath }
}
publishing {
@@ -598,11 +609,6 @@ android {
tasks.withType<KotlinCompile>().configureEach { exclude("com/facebook/annotationprocessors/**") }
dependencies {
implementation(libs.fresco)
implementation(libs.fresco.middleware)
implementation(libs.fresco.imagepipeline.okhttp3)
implementation(libs.fresco.ui.common)
api(libs.androidx.appcompat)
api(libs.androidx.appcompat.resources)
api(libs.androidx.autofill)
@@ -610,7 +616,12 @@ dependencies {
api(libs.androidx.tracing)
api(libs.fbjni)
api(libs.fresco)
api(libs.fresco.imagepipeline.okhttp3)
api(libs.fresco.middleware)
api(libs.fresco.ui.common)
api(libs.infer.annotation)
api(libs.soloader)
api(libs.yoga.proguard.annotations)
api(libs.jsr305)
@@ -631,8 +642,6 @@ dependencies {
testImplementation(libs.thoughtworks)
}
configurations.all { exclude(group = "com.facebook.soloader") }
react {
// TODO: The library name is chosen for parity with Fabric components & iOS
// This should be changed to a more generic name, e.g. `ReactCoreSpec`.
@@ -1,4 +1,4 @@
VERSION_NAME=1000.0.0
VERSION_NAME=0.76.0-rc.2
react.internal.publishingGroup=com.facebook.react
android.useAndroidX=true
@@ -315,8 +315,6 @@ android {
}
}
configurations.all { exclude(group = "com.facebook.soloader") }
afterEvaluate {
if (!overrideHermesDir) {
// If you're not specifying a Hermes Path override, we want to
@@ -169,26 +169,25 @@ public class HeadlessJsTaskContext {
/**
* Finish a JS task. Doesn't actually stop the task on the JS side, only removes it from the list
* of active tasks and notifies listeners. A task can only be finished once.
* of active tasks and notifies listeners.
*
* @param taskId the unique id returned by {@link #startTask}.
*/
public synchronized void finishTask(final int taskId) {
Assertions.assertCondition(
mActiveTasks.remove(taskId), "Tried to finish non-existent task with id " + taskId + ".");
Assertions.assertCondition(
mActiveTaskConfigs.remove(taskId) != null,
"Tried to remove non-existent task config with id " + taskId + ".");
boolean removed = mActiveTasks.remove(taskId);
mActiveTaskConfigs.remove(taskId);
removeTimeout(taskId);
UiThreadUtil.runOnUiThread(
new Runnable() {
@Override
public void run() {
for (HeadlessJsTaskEventListener listener : mHeadlessJsTaskEventListeners) {
listener.onHeadlessJsTaskFinish(taskId);
if (removed) {
UiThreadUtil.runOnUiThread(
new Runnable() {
@Override
public void run() {
for (HeadlessJsTaskEventListener listener : mHeadlessJsTaskEventListeners) {
listener.onHeadlessJsTaskFinish(taskId);
}
}
}
});
});
}
}
private void removeTimeout(int taskId) {
@@ -15,8 +15,8 @@ import java.util.Map;
public class ReactNativeVersion {
public static final Map<String, Object> VERSION = MapBuilder.<String, Object>of(
"major", 1000,
"minor", 0,
"major", 0,
"minor", 76,
"patch", 0,
"prerelease", null);
"prerelease", "rc.2");
}
@@ -23,6 +23,8 @@ import com.facebook.react.devsupport.HMRClient;
import com.facebook.react.devsupport.ReactInstanceDevHelper;
import com.facebook.react.devsupport.interfaces.DevSplitBundleCallback;
import com.facebook.react.modules.core.DeviceEventManagerModule;
import com.facebook.react.runtime.internal.bolts.Continuation;
import com.facebook.react.runtime.internal.bolts.Task;
/**
* An implementation of {@link com.facebook.react.devsupport.interfaces.DevSupportManager} that
@@ -67,17 +69,20 @@ class BridgelessDevSupportManager extends DevSupportManagerBase {
mReactHost
.loadBundle(bundleLoader)
.onSuccess(
task -> {
if (task.isCompleted()) {
String bundleURL =
getDevServerHelper().getDevServerSplitBundleURL(bundlePath);
ReactContext reactContext = mReactHost.getCurrentReactContext();
if (reactContext != null) {
reactContext.getJSModule(HMRClient.class).registerBundle(bundleURL);
new Continuation<Boolean, Void>() {
@Override
public Void then(Task<Boolean> task) {
if (task.getResult().equals(Boolean.TRUE)) {
String bundleURL =
getDevServerHelper().getDevServerSplitBundleURL(bundlePath);
ReactContext reactContext = mReactHost.getCurrentReactContext();
if (reactContext != null) {
reactContext.getJSModule(HMRClient.class).registerBundle(bundleURL);
}
callback.onSuccess();
}
callback.onSuccess();
return null;
}
return null;
});
}
@@ -9,6 +9,8 @@ package com.facebook.react.runtime;
import static com.facebook.infer.annotation.Assertions.assertNotNull;
import static com.facebook.infer.annotation.ThreadConfined.UI;
import static java.lang.Boolean.FALSE;
import static java.lang.Boolean.TRUE;
import android.app.Activity;
import android.content.Context;
@@ -250,12 +252,13 @@ public class ReactHostImpl implements ReactHost {
detachSurface(surface);
return callWithExistingReactInstance(
method,
reactInstance -> {
log(method, "Execute");
reactInstance.stopSurface(surface);
},
mBGExecutor);
method,
reactInstance -> {
log(method, "Execute");
reactInstance.stopSurface(surface);
},
mBGExecutor)
.makeVoid();
}
/**
@@ -776,7 +779,7 @@ public class ReactHostImpl implements ReactHost {
};
}
/* package */ Task<Void> loadBundle(final JSBundleLoader bundleLoader) {
/* package */ Task<Boolean> loadBundle(final JSBundleLoader bundleLoader) {
final String method = "loadBundle()";
log(method, "Schedule");
@@ -789,7 +792,7 @@ public class ReactHostImpl implements ReactHost {
null);
}
/* package */ Task<Void> registerSegment(
/* package */ Task<Boolean> registerSegment(
final int segmentId, final String path, final Callback callback) {
final String method =
"registerSegment(segmentId = \"" + segmentId + "\", path = \"" + path + "\")";
@@ -825,7 +828,7 @@ public class ReactHostImpl implements ReactHost {
* @param args Arguments to be passed to the function
* @return A Task that will complete when the function call has been enqueued on the JS thread.
*/
/* package */ Task<Void> callFunctionOnModule(
/* package */ Task<Boolean> callFunctionOnModule(
final String moduleName, final String methodName, final NativeArray args) {
final String method = "callFunctionOnModule(\"" + moduleName + "\", \"" + methodName + "\")";
return callWithExistingReactInstance(
@@ -947,9 +950,9 @@ public class ReactHostImpl implements ReactHost {
}
/** Schedule work on a ReactInstance that is already created. */
private Task<Void> callWithExistingReactInstance(
private Task<Boolean> callWithExistingReactInstance(
final String callingMethod,
final ReactInstanceCalback callback,
final ReactInstanceCalback continuation,
@Nullable Executor executor) {
final String method = "callWithExistingReactInstance(" + callingMethod + ")";
@@ -959,18 +962,19 @@ public class ReactHostImpl implements ReactHost {
return mCreateReactInstanceTaskRef
.get()
.continueWith(
.onSuccess(
task -> {
final ReactInstance reactInstance =
ReactNativeFeatureFlags.completeReactInstanceCreationOnBgThreadOnAndroid()
? task.getResult()
: mReactInstance;
if (reactInstance == null || task.isFaulted()) {
if (reactInstance == null) {
raiseSoftException(method, "Execute: reactInstance is null. Dropping work.");
} else {
callback.then(reactInstance);
return FALSE;
}
return null;
continuation.then(reactInstance);
return TRUE;
},
executor);
}
@@ -978,7 +982,7 @@ public class ReactHostImpl implements ReactHost {
/** Create a ReactInstance if it doesn't exist already, and schedule work on it. */
private Task<Void> callAfterGetOrCreateReactInstance(
final String callingMethod,
final ReactInstanceCalback callback,
final ReactInstanceCalback runnable,
@Nullable Executor executor) {
final String method = "callAfterGetOrCreateReactInstance(" + callingMethod + ")";
@@ -987,17 +991,18 @@ public class ReactHostImpl implements ReactHost {
}
return getOrCreateReactInstance()
.continueWith(
.onSuccess(
task -> {
final ReactInstance reactInstance =
ReactNativeFeatureFlags.completeReactInstanceCreationOnBgThreadOnAndroid()
? task.getResult()
: mReactInstance;
if (reactInstance == null || task.isFaulted()) {
if (reactInstance == null) {
raiseSoftException(method, "Execute: reactInstance is null. Dropping work.");
} else {
callback.then(reactInstance);
return null;
}
runnable.then(reactInstance);
return null;
},
executor)
@@ -5,7 +5,9 @@
* LICENSE file in the root directory of this source tree.
*/
package com.facebook.soloader
package com.facebook.react.soloader
import com.facebook.soloader.ExternalSoMapping
/**
* This class is a manually created MergedSoMapping.
@@ -16,9 +18,9 @@ package com.facebook.soloader
* entry in the [invokeJniOnload] method, the [mapLibName] method as well as a new external function
* that will take care of calling the JNI_OnLoad method.
*/
public object MergedSoMapping {
public object OpenSourceMergedSoMapping : ExternalSoMapping {
public fun mapLibName(input: String): String =
override public fun mapLibName(input: String): String =
when (input) {
"fabricjni",
"jsinspector",
@@ -47,7 +49,7 @@ public object MergedSoMapping {
else -> input
}
public fun invokeJniOnload(libraryName: String): Unit {
override public fun invokeJniOnload(libraryName: String): Unit {
when (libraryName) {
"fabricjni" -> libfabricjni_so()
"hermes_executor" -> libhermes_executor_so()
@@ -136,8 +136,8 @@ public object ViewProps {
public const val BORDER_START_COLOR: String = "borderStartColor"
public const val BORDER_END_COLOR: String = "borderEndColor"
public const val ON_LAYOUT: String = "onLayout"
public const val BOX_SHADOW: String = "experimental_boxShadow"
public const val FILTER: String = "experimental_filter"
public const val BOX_SHADOW: String = "boxShadow"
public const val FILTER: String = "filter"
public const val MIX_BLEND_MODE: String = "experimental_mixBlendMode"
public const val TRANSFORM: String = "transform"
public const val TRANSFORM_ORIGIN: String = "transformOrigin"
@@ -24,7 +24,8 @@
// Class with mapping that will be generated by buck or manually edited by
// users.
static const char* invoke_class_name = "com/facebook/soloader/MergedSoMapping";
static const char* invoke_class_name =
"com/facebook/react/soloader/OpenSourceMergedSoMapping";
// Stub pre-merged library to ensure that our custom section gets created
// when we merge a group of native libraries with no JNI_OnLoad. We don't
@@ -15,10 +15,10 @@
namespace facebook::react {
constexpr struct {
int32_t Major = 1000;
int32_t Minor = 0;
int32_t Major = 0;
int32_t Minor = 76;
int32_t Patch = 0;
std::string_view Prerelease = "";
std::string_view Prerelease = "rc.2";
} ReactNativeVersion;
} // namespace facebook::react
@@ -155,7 +155,7 @@ BaseViewProps::BaseViewProps(
: convertRawProp(
context,
rawProps,
"experimental_boxShadow",
"boxShadow",
sourceProps.boxShadow,
{})),
filter(
@@ -163,7 +163,7 @@ BaseViewProps::BaseViewProps(
: convertRawProp(
context,
rawProps,
"experimental_filter",
"filter",
sourceProps.filter,
{})),
backgroundImage(
@@ -346,8 +346,8 @@ void BaseViewProps::setProp(
RAW_SET_PROP_SWITCH_CASE_BASIC(removeClippedSubviews);
RAW_SET_PROP_SWITCH_CASE_BASIC(experimental_layoutConformance);
RAW_SET_PROP_SWITCH_CASE_BASIC(cursor);
RAW_SET_PROP_SWITCH_CASE(filter, "experimental_filter");
RAW_SET_PROP_SWITCH_CASE(boxShadow, "experimental_boxShadow");
RAW_SET_PROP_SWITCH_CASE(filter, "filter");
RAW_SET_PROP_SWITCH_CASE(boxShadow, "boxShadow");
// events field
VIEW_EVENT_CASE(PointerEnter);
VIEW_EVENT_CASE(PointerEnterCapture);
@@ -22,6 +22,9 @@ using CrashManagerProvider =
class RCTHermesInstance : public JSRuntimeFactory {
public:
RCTHermesInstance();
RCTHermesInstance(
std::shared_ptr<const ReactNativeConfig> reactNativeConfig,
CrashManagerProvider crashManagerProvider);
RCTHermesInstance(
std::shared_ptr<const ReactNativeConfig> reactNativeConfig,
CrashManagerProvider crashManagerProvider,
@@ -11,6 +11,13 @@ namespace facebook::react {
RCTHermesInstance::RCTHermesInstance() : RCTHermesInstance(nullptr, nullptr, false) {}
RCTHermesInstance::RCTHermesInstance(
std::shared_ptr<const ReactNativeConfig> reactNativeConfig,
CrashManagerProvider crashManagerProvider)
: RCTHermesInstance(reactNativeConfig, std::move(crashManagerProvider), false)
{
}
RCTHermesInstance::RCTHermesInstance(
std::shared_ptr<const ReactNativeConfig> reactNativeConfig,
CrashManagerProvider crashManagerProvider,
+9 -5
View File
@@ -109,7 +109,7 @@ function warnWithDeprecationSchedule() {
${chalk.yellow('⚠️')} The \`init\` command is deprecated.
The behavior will be changed on ${chalk.white.bold(CLI_DEPRECATION_DATE.toLocaleDateString())} ${emphasis(`(${daysRemaining} day${daysRemaining > 1 ? 's' : ''})`)}.
- Switch to ${chalk.dim('npx @react-native-community/cli init')} for the identical behavior.
- Switch to ${chalk.grey.bold('npx @react-native-community/cli init')} for the identical behavior.
- Refer to the documentation for information about alternative tools: ${chalk.dim('https://reactnative.dev/docs/getting-started')}`);
}
@@ -117,11 +117,10 @@ function warnWithDeprecated() {
if (!isInitCommand) {
return;
}
console.warn(`
🚨 The \`init\` command is deprecated.
- Switch to ${chalk.dim('npx @react-native-community/cli init')} for the identical behavior.
- Switch to ${chalk.grey.bold('npx @react-native-community/cli init')} for the identical behavior.
- Refer to the documentation for information about alternative tools: ${chalk.dim('https://reactnative.dev/docs/getting-started')}`);
}
@@ -174,7 +173,7 @@ async function main() {
const isDeprecated =
CLI_DEPRECATION_DATE.getTime() <= new Date().getTime() ||
currentVersion.startsWith('0.76');
currentVersion.startsWith('0.77');
/**
* This command is now deprecated. We will continue to proxy commands to @react-native-community/cli, but it
@@ -191,8 +190,13 @@ async function main() {
warnWithDeprecated();
// We only exit if the user calls `init` and it's deprecated. All other cases should proxy to to @react-native-community/cli.
// Be careful with this as it can break a lot of users.
console.warn(`${chalk.green('Exiting...')}`);
process.exit(1);
} else if (currentVersion.startsWith('0.75')) {
} else if (
currentVersion.startsWith('0.75') ||
currentVersion.startsWith('0.76')
) {
// We check deprecation schedule only for 0.75 and 0.76 and 0.77 is expected to land in Jan 2025.
warnWithDeprecationSchedule();
}
warnWhenRunningInit();
@@ -29,6 +29,7 @@ nexus-publish = "1.3.0"
okhttp = "4.9.2"
okio = "2.9.0"
robolectric = "4.9.2"
soloader = "0.12.1"
xstream = "1.4.20"
yoga-proguard-annotations = "1.19.0"
# Native Dependencies
@@ -55,6 +56,7 @@ fresco-middleware = { module = "com.facebook.fresco:middleware", version.ref = "
fresco-imagepipeline-okhttp3 = { module = "com.facebook.fresco:imagepipeline-okhttp3", version.ref = "fresco" }
fresco-ui-common = { module = "com.facebook.fresco:ui-common", version.ref = "fresco" }
infer-annotation = { module = "com.facebook.infer.annotation:infer-annotation", version.ref = "infer-annotation" }
soloader = { module = "com.facebook.soloader:soloader", version.ref = "soloader" }
yoga-proguard-annotations = { module = "com.facebook.yoga:proguard-annotations", version.ref = "yoga-proguard-annotations" }
jsr305 = { module = "com.google.code.findbugs:jsr305", version.ref = "jsr305" }
+5 -1
View File
@@ -15,7 +15,11 @@ module.exports = {
platforms: ['android', 'ios', 'native'],
},
transform: {
'^.+\\.(js|ts|tsx)$': 'babel-jest',
'^.+\\.(js)$': [
'babel-jest',
{plugins: ['babel-plugin-syntax-hermes-parser']},
],
'^.+\\.(ts|tsx)$': 'babel-jest',
'^.+\\.(bmp|gif|jpg|jpeg|mp4|png|psd|svg|webp)$': require.resolve(
'./jest/assetFileTransformer.js',
),
+14 -13
View File
@@ -1,6 +1,6 @@
{
"name": "react-native",
"version": "1000.0.0",
"version": "0.76.0-rc.2",
"description": "A framework for building native apps using React",
"license": "MIT",
"repository": {
@@ -82,7 +82,6 @@
"scripts/react-native-xcode.sh",
"sdks/.hermesversion",
"sdks/hermes-engine",
"sdks/ossonly-soloader",
"sdks/hermesc",
"settings.gradle.kts",
"src",
@@ -101,7 +100,7 @@
},
"peerDependencies": {
"@types/react": "^18.2.6",
"react": "^19.0.0-rc-fb9a90fa48-20240614"
"react": "^18.2.0"
},
"peerDependenciesMeta": {
"@types/react": {
@@ -110,16 +109,18 @@
},
"dependencies": {
"@jest/create-cache-key-function": "^29.6.3",
"@react-native/assets-registry": "0.76.0-main",
"@react-native/codegen": "0.76.0-main",
"@react-native/community-cli-plugin": "0.76.0-main",
"@react-native/gradle-plugin": "0.76.0-main",
"@react-native/js-polyfills": "0.76.0-main",
"@react-native/normalize-colors": "0.76.0-main",
"@react-native/virtualized-lists": "0.76.0-main",
"@react-native/assets-registry": "0.76.0-rc.2",
"@react-native/codegen": "0.76.0-rc.2",
"@react-native/community-cli-plugin": "0.76.0-rc.2",
"@react-native/gradle-plugin": "0.76.0-rc.2",
"@react-native/js-polyfills": "0.76.0-rc.2",
"@react-native/normalize-colors": "0.76.0-rc.2",
"@react-native/virtualized-lists": "0.76.0-rc.2",
"abort-controller": "^3.0.0",
"anser": "^1.4.9",
"ansi-regex": "^5.0.0",
"babel-jest": "^29.7.0",
"babel-plugin-syntax-hermes-parser": "^0.23.1",
"base64-js": "^1.5.1",
"chalk": "^4.0.0",
"commander": "^12.0.0",
@@ -130,8 +131,8 @@
"jest-environment-node": "^29.6.3",
"jsc-android": "^250231.0.0",
"memoize-one": "^5.0.0",
"metro-runtime": "^0.80.10",
"metro-source-map": "^0.80.10",
"metro-runtime": "^0.81.0-alpha.0",
"metro-source-map": "^0.81.0-alpha.0",
"mkdirp": "^0.5.1",
"nullthrows": "^1.1.1",
"pretty-format": "^29.7.0",
@@ -139,7 +140,7 @@
"react-devtools-core": "^5.3.1",
"react-refresh": "^0.14.0",
"regenerator-runtime": "^0.13.2",
"scheduler": "0.25.0-rc-fb9a90fa48-20240614",
"scheduler": "0.24.0-canary-efb381bbf-20230505",
"semver": "^7.1.3",
"stacktrace-parser": "^0.1.10",
"whatwg-fetch": "^3.0.0",
@@ -40,27 +40,15 @@ class NewArchitectureTests < Test::Unit::TestCase
assert_equal(installer.aggregate_targets[0].user_project.build_configurations[0].build_settings["CLANG_CXX_LANGUAGE_STANDARD"], "c++20")
assert_equal(installer.aggregate_targets[1].user_project.build_configurations[0].build_settings["CLANG_CXX_LANGUAGE_STANDARD"], "c++20")
assert_equal(installer.pods_project.targets[1].received_resolved_build_setting_parameters, [ReceivedCommonResolvedBuildSettings.new("CLANG_CXX_LANGUAGE_STANDARD", true)])
assert_equal(Pod::UI.collected_messages, ["Setting CLANG_CXX_LANGUAGE_STANDARD to c++20 on /test/path.xcproj", "Setting CLANG_CXX_LANGUAGE_STANDARD to c++20 on /test/path2.xcproj"])
end
def test_setClangCxxLanguageStandardIfNeeded_whenReactCoreIsNotPresent
installer = prepare_mocked_installer_without_react_core
NewArchitectureHelper.set_clang_cxx_language_standard_if_needed(installer)
assert_equal(installer.aggregate_targets[0].user_project.build_configurations[0].build_settings["CLANG_CXX_LANGUAGE_STANDARD"], nil)
assert_equal(installer.aggregate_targets[1].user_project.build_configurations[0].build_settings["CLANG_CXX_LANGUAGE_STANDARD"], nil)
assert_equal(installer.pods_project.targets[0].received_resolved_build_setting_parameters, [])
assert_equal(Pod::UI.collected_messages, [])
end
def test_setClangCxxLanguageStandardIfNeeded_whenThereAreDifferentValuesForLanguageStandard_takesTheFirstValue
installer = prepare_mocked_installer_with_react_core_and_different_language_standards
NewArchitectureHelper.set_clang_cxx_language_standard_if_needed(installer)
assert_equal(installer.aggregate_targets[0].user_project.build_configurations[0].build_settings["CLANG_CXX_LANGUAGE_STANDARD"], "c++20")
assert_equal(installer.aggregate_targets[1].user_project.build_configurations[0].build_settings["CLANG_CXX_LANGUAGE_STANDARD"], "c++20")
assert_equal(installer.pods_project.targets[1].received_resolved_build_setting_parameters, [ReceivedCommonResolvedBuildSettings.new("CLANG_CXX_LANGUAGE_STANDARD", true)])
assert_equal(Pod::UI.collected_messages, ["Setting CLANG_CXX_LANGUAGE_STANDARD to c++20 on /test/path.xcproj", "Setting CLANG_CXX_LANGUAGE_STANDARD to c++20 on /test/path2.xcproj"])
end
@@ -701,9 +701,6 @@ class UtilsTests < Test::Unit::TestCase
# Assert
assert_equal(FileMock.exist_invocation_params, ["/.xcode.env", "/.xcode.env.local"])
assert_equal($collected_commands[0], "echo 'export NODE_BINARY=$(command -v node)' > /.xcode.env")
assert_true($collected_commands[1].start_with? "echo 'export NODE_BINARY=")
assert_true($collected_commands[1].end_with? "' > /.xcode.env.local")
end
# ============================ #
@@ -1116,6 +1113,26 @@ class UtilsTests < Test::Unit::TestCase
assert_equal("$(inherited)" + test_flag, twiceProcessed_xcconfig.attributes["OTHER_CPLUSPLUSFLAGS"])
end
def test_add_flag_to_map_with_inheritance_whenUsedWithArrayAttributes
# Arrange
initialized_xcconfig = XCConfigMock.new("InitializedConfig", attributes: {
"OTHER_CPLUSPLUSFLAGS" => ["INIT_FLAG"]
})
twiceProcessed_xcconfig = XCConfigMock.new("TwiceProcessedConfig", attributes: {
"OTHER_CPLUSPLUSFLAGS" => []
})
test_flag = " -DTEST_FLAG=1"
# Act
ReactNativePodsUtils.add_flag_to_map_with_inheritance(initialized_xcconfig.attributes, "OTHER_CPLUSPLUSFLAGS", test_flag)
ReactNativePodsUtils.add_flag_to_map_with_inheritance(twiceProcessed_xcconfig.attributes, "OTHER_CPLUSPLUSFLAGS", test_flag)
ReactNativePodsUtils.add_flag_to_map_with_inheritance(twiceProcessed_xcconfig.attributes, "OTHER_CPLUSPLUSFLAGS", test_flag)
# Assert
assert_equal(["$(inherited)", "INIT_FLAG", test_flag], initialized_xcconfig.attributes["OTHER_CPLUSPLUSFLAGS"])
assert_equal(["$(inherited)", test_flag], twiceProcessed_xcconfig.attributes["OTHER_CPLUSPLUSFLAGS"])
end
def test_add_ndebug_flag_to_pods_in_release
# Arrange
xcconfig = XCConfigMock.new("Config")
@@ -67,14 +67,29 @@ module PrivacyManifestUtils
end
def self.ensure_reference(file_path, user_project, target)
reference_exists = target.resources_build_phase.files_references.any? { |file_ref| file_ref&.path&.end_with? "PrivacyInfo.xcprivacy" }
unless reference_exists
# We try to find the main group, but if it doesn't exist, we default to adding the file to the project root both work
file_root = user_project.root_object.main_group.children.find { |group|
group.class == Xcodeproj::Project::Object::PBXGroup && (group.name == target.name || group.path == target.name)
} || user_project
file_ref = file_root.new_file(file_path)
build_file = target.resources_build_phase.add_file_reference(file_ref, true)
privacy_info_filename = File.basename(file_path)
# Check if the file is already in the PBXBuildFile section
build_phase_reference_exists = target.resources_build_phase.files_references.any? { |file_ref| file_ref&.path&.end_with?(privacy_info_filename) }
unless build_phase_reference_exists
# Check if the file is already in the PBXFileReference section
existing_file_reference = user_project.files.find { |file| file.path&.end_with?(privacy_info_filename) }
if existing_file_reference
# If the file reference exists, add it to the build phase
target.resources_build_phase.add_file_reference(existing_file_reference, true)
else
# If the file reference doesn't exist, add it to the project and the build phase
# We try to find the main group, but if it doesn't exist, we default to adding the file to the project root - both work
file_root = user_project.root_object.main_group.children.find { |group|
group.class == Xcodeproj::Project::Object::PBXGroup && (group.name == target.name || group.path == target.name)
} || user_project
puts "file_root: #{file_root}"
file_ref = file_root.new_file(file_path)
target.resources_build_phase.add_file_reference(file_ref, true)
end
end
end
@@ -696,10 +696,18 @@ class ReactNativePodsUtils
map[field] = "$(inherited)" + flag
else
unless map[field].include?(flag)
map[field] = map[field] + flag
if map[field].instance_of? String
map[field] = map[field] + flag
elsif map[field].instance_of? Array
map[field].push(flag)
end
end
unless map[field].include?("$(inherited)")
map[field] = "$(inherited) " + map[field]
if map[field].instance_of? String
map[field] = "$(inherited) " + map[field]
elsif map[field].instance_of? Array
map[field].unshift("$(inherited)")
end
end
end
end
@@ -92,6 +92,8 @@ fi
[ -z "$CLI_PATH" ] && CLI_PATH="$REACT_NATIVE_DIR/scripts/bundle.js"
[ -z "$BUNDLE_COMMAND" ] && BUNDLE_COMMAND="bundle"
[ -z "$COMPOSE_SOURCEMAP_PATH" ] && COMPOSE_SOURCEMAP_PATH="$REACT_NATIVE_DIR/scripts/compose-source-maps.js"
if [[ -z "$BUNDLE_CONFIG" ]]; then
@@ -0,0 +1 @@
hermes-2024-09-09-RNv0.76.0-db6d12e202e15f7a446d8848d6ca8f7abb3cfb32
@@ -207,19 +207,7 @@ function create_universal_framework {
for i in "${!platforms[@]}"; do
local platform="${platforms[$i]}"
local hermes_framework_path="${platform}/hermes.framework"
local dSYM_path="$hermes_framework_path"
local dSYM_base_path="$HERMES_PATH/destroot/Library/Frameworks"
# If the dSYM rename has failed, the dSYM are generated as 0.dSYM
# (Apple default name) rather then hermes.framework.dSYM.
if [[ -e "$dSYM_base_path/${platform}/0.dSYM" ]]; then
dSYM_path="${platform}/0"
fi
args+="-framework $hermes_framework_path "
# Path to dSYM must be absolute
args+="-debug-symbols $dSYM_base_path/$dSYM_path.dSYM "
done
mkdir -p universal
@@ -1,10 +0,0 @@
/*
* Copyright (c) Meta Platforms, Inc. and affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/
package com.facebook.soloader
public annotation class DoNotOptimize {}
@@ -1,53 +0,0 @@
/*
* Copyright (c) Meta Platforms, Inc. and affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/
@file:Suppress("UNUSED_EXPRESSION", "ControlFlowWithEmptyBody", "UNUSED_PARAMETER")
package com.facebook.soloader
import android.content.Context
/**
* This class is a stub of SoLoader used ONLY by React Native OSS.
*
* This allows us to do not mutate the SoLoader.init and SoLoader.loadLibrary methods, which are
* used by the React Native, while also allowing us to implement custom JNI_OnLoad calling which
* enables merging of SOs.
*/
public object SoLoader {
private val loadedLibraries = mutableSetOf<String>()
private fun mapLibName(input: String) = MergedSoMapping.mapLibName(input)
private fun invokeJniOnload(libraryName: String) = MergedSoMapping.invokeJniOnload(libraryName)
@Deprecated("This method is a no-op and you should not be calling it")
@JvmStatic
public fun init(context: Context, exoPackage: Boolean) {
// Do nothing
}
@JvmStatic
public fun loadLibrary(libraryName: String): Boolean {
if (libraryName in loadedLibraries) {
return false
}
val mapLibraryName = mapLibName(libraryName)
System.loadLibrary(mapLibraryName)
loadedLibraries.add(libraryName)
if (libraryName != mapLibraryName) {
invokeJniOnload(libraryName)
}
return true
}
@JvmStatic
public fun setInTestMode() {
// Do nothing
}
}
@@ -1,28 +0,0 @@
/*
* Copyright (c) Meta Platforms, Inc. and affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/
package com.facebook.soloader.nativeloader
/**
* This class is a stub of NativeLoader used ONLY by React Native OSS.
*
* Fresco in OSS depends on NativeLoader, but we don't want to include the real
* NativeLoader/SoLoader in React Native OSS. This stub is used to make Fresco work properly for us.
*/
public object NativeLoader {
@JvmStatic
public fun loadLibrary(libraryName: String): Boolean {
System.loadLibrary(libraryName)
return true
}
@JvmStatic public fun isInitialized(): Boolean = true
@Suppress("UNUSED_PARAMETER")
public fun initIfUninitialized(systemDelegate: SystemDelegate): Unit = Unit
}
@@ -1,23 +0,0 @@
/*
* Copyright (c) Meta Platforms, Inc. and affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/
package com.facebook.soloader.nativeloader
/**
* This class is a stub of NativeLoaderDelegate used ONLY by React Native OSS.
*
* Fresco in OSS depends on NativeLoader, but we don't want to include the real
* NativeLoader/SoLoader in React Native OSS. This stub is used to make Fresco work properly for us.
*/
public interface NativeLoaderDelegate {
public fun loadLibrary(shortName: String?, flags: Int): Boolean
public fun getLibraryPath(libName: String?): String
public fun getSoSourcesVersion(): Int
}
@@ -1,10 +0,0 @@
/*
* Copyright (c) Meta Platforms, Inc. and affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/
package com.facebook.soloader.nativeloader
public class SystemDelegate {}
@@ -21,33 +21,34 @@ import Platform from '../../../Libraries/Utilities/Platform';
import AndroidHorizontalScrollContentViewNativeComponent from '../specs/components/AndroidHorizontalScrollContentViewNativeComponent';
import useSyncOnScroll from './useSyncOnScroll';
import * as React from 'react';
import {forwardRef} from 'react';
const HScrollViewNativeComponentForPlatform =
Platform.OS === 'android'
? AndroidHorizontalScrollViewNativeComponent
: ScrollViewNativeComponent;
// TODO: After upgrading to React 19, remove `forwardRef` from this component.
export const HScrollViewNativeComponent: React.AbstractComponent<
ScrollViewNativeProps,
TScrollViewNativeImperativeHandle,
// $FlowExpectedError[incompatible-type] - Flow cannot model imperative handles, yet.
> = function HScrollViewNativeComponent(props: {
...ScrollViewNativeProps,
ref?: React.RefSetter<TScrollViewNativeImperativeHandle | null>,
...
}): React.Node {
const [ref, enableSyncOnScroll] = useSyncOnScroll(props.ref);
> = forwardRef(function HScrollViewNativeComponent(
props: ScrollViewNativeProps,
ref: ?React.RefSetter<TScrollViewNativeImperativeHandle | null>,
): React.Node {
const [componentRef, enableSyncOnScroll] = useSyncOnScroll(ref);
// NOTE: When `useSyncOnScroll` triggers an update, `props` will not have
// changed. Notably, `props.children` will be the same, allowing React to
// bail out during reconciliation.
return (
<HScrollViewNativeComponentForPlatform
{...props}
ref={ref}
ref={componentRef}
enableSyncOnScroll={enableSyncOnScroll}
/>
);
};
});
export const HScrollContentViewNativeComponent: HostComponent<ViewProps> =
Platform.OS === 'android'
@@ -13,15 +13,17 @@ import type {ViewProps} from '../../../Libraries/Components/View/ViewPropTypes';
import Platform from '../../../Libraries/Utilities/Platform';
import View from '../../../Libraries/Components/View/View';
import * as React from 'react';
export * from '../../../src/private/specs/components/RCTSafeAreaViewNativeComponent';
import RCTSafeAreaViewNativeComponent from '../../../src/private/specs/components/RCTSafeAreaViewNativeComponent';
let exported: React.AbstractComponent<ViewProps, React.ElementRef<typeof View>>;
if (Platform.OS === 'android' || Platform.OS === 'ios') {
exported = RCTSafeAreaViewNativeComponent;
} else {
exported = View;
}
const exported: React.AbstractComponent<
ViewProps,
React.ElementRef<typeof View>,
> = Platform.select({
ios: require('../../../src/private/specs/components/RCTSafeAreaViewNativeComponent')
.default,
android:
require('../../../src/private/specs/components/RCTSafeAreaViewNativeComponent')
.default,
default: View,
});
export default exported;
@@ -20,28 +20,29 @@ import View from '../../../Libraries/Components/View/View';
import Platform from '../../../Libraries/Utilities/Platform';
import useSyncOnScroll from './useSyncOnScroll';
import * as React from 'react';
import {forwardRef} from 'react';
// TODO: After upgrading to React 19, remove `forwardRef` from this component.
export const VScrollViewNativeComponent: React.AbstractComponent<
ScrollViewNativeProps,
TScrollViewNativeImperativeHandle,
// $FlowExpectedError[incompatible-type] - Flow cannot model imperative handles, yet.
> = function VScrollViewNativeComponent(props: {
...ScrollViewNativeProps,
ref?: React.RefSetter<TScrollViewNativeImperativeHandle | null>,
...
}): React.Node {
const [ref, enableSyncOnScroll] = useSyncOnScroll(props.ref);
> = forwardRef(function VScrollViewNativeComponent(
props: ScrollViewNativeProps,
ref: ?React.RefSetter<TScrollViewNativeImperativeHandle | null>,
): React.Node {
const [componentRef, enableSyncOnScroll] = useSyncOnScroll(ref);
// NOTE: When `useSyncOnScroll` triggers an update, `props` will not have
// changed. Notably, `props.children` will be the same, allowing React to
// bail out during reconciliation.
return (
<ScrollViewNativeComponent
{...props}
ref={ref}
ref={componentRef}
enableSyncOnScroll={enableSyncOnScroll}
/>
);
};
});
export const VScrollContentViewNativeComponent: HostComponent<ViewProps> =
Platform.OS === 'android' ? View : ScrollContentViewNativeComponent;
-105
View File
@@ -35,111 +35,11 @@
import {
GradientValue,
BlendMode,
BoxShadowPrimitive,
DimensionValue,
FilterFunction,
} from 'react-native/Libraries/StyleSheet/StyleSheetTypes';
export {};
declare module '.' {
export interface FlexStyle {
/**
* Equivalent to `top`, `bottom`, `right` and `left`
*/
inset?: DimensionValue | undefined;
/**
* Equivalent to `top`, `bottom`
*/
insetBlock?: DimensionValue | undefined;
/**
* Equivalent to `bottom`
*/
insetBlockEnd?: DimensionValue | undefined;
/**
* Equivalent to `top`
*/
insetBlockStart?: DimensionValue | undefined;
/**
* Equivalent to `right` and `left`
*/
insetInline?: DimensionValue | undefined;
/**
* Equivalent to `right` or `left`
*/
insetInlineEnd?: DimensionValue | undefined;
/**
* Equivalent to `right` or `left`
*/
insetInlineStart?: DimensionValue | undefined;
/**
* Equivalent to `marginVertical`
*/
marginBlock?: DimensionValue | undefined;
/**
* Equivalent to `marginBottom`
*/
marginBlockEnd?: DimensionValue | undefined;
/**
* Equivalent to `marginTop`
*/
marginBlockStart?: DimensionValue | undefined;
/**
* Equivalent to `marginHorizontal`
*/
marginInline?: DimensionValue | undefined;
/**
* Equivalent to `marginEnd`
*/
marginInlineEnd?: DimensionValue | undefined;
/**
* Equivalent to `marginStart`
*/
marginInlineStart?: DimensionValue | undefined;
/**
* Equivalent to `paddingVertical`
*/
paddingBlock?: DimensionValue | undefined;
/**
* Equivalent to `paddingBottom`
*/
paddingBlockEnd?: DimensionValue | undefined;
/**
* Equivalent to `paddingTop`
*/
paddingBlockStart?: DimensionValue | undefined;
/**
* Equivalent to `paddingHorizontal`
*/
paddingInline?: DimensionValue | undefined;
/**
* Equivalent to `paddingEnd`
*/
paddingInlineEnd?: DimensionValue | undefined;
/**
* Equivalent to `paddingStart`
*/
paddingInlineStart?: DimensionValue | undefined;
}
export interface ViewProps {
/**
* Contols whether this view, and its transitive children, are laid in a way
@@ -150,11 +50,6 @@ declare module '.' {
}
export interface ViewStyle {
experimental_boxShadow?:
| ReadonlyArray<BoxShadowPrimitive>
| string
| undefined;
experimental_filter?: ReadonlyArray<FilterFunction> | string | undefined;
experimental_mixBlendMode?: BlendMode | undefined;
experimental_backgroundImage?:
| ReadonlyArray<GradientValue>
File diff suppressed because it is too large Load Diff

Some files were not shown because too many files have changed in this diff Show More