Compare commits

...
Author SHA1 Message Date
React Native Bot 4968798538 Release 0.75.3
#publish-packages-to-npm&latest
2024-09-11 16:12:13 +00:00
Riccardo Cipolleschi 16575babf8 [LOCAL] Revert commander to 9.4.1 to fix build issues 2024-09-11 12:20:51 +01:00
Riccardo Cipolleschi cf7b9b9486 [LOCAL] remove resolution and add commander as devDependency for the monorepo 2024-09-11 11:54:35 +01:00
Blake FriedmanandRiccardo Cipolleschi 8734cff95e [LOCAL] Add resolution in HelloWorld package to fix the build in CI 2024-09-11 11:17:53 +01:00
Riccardo Cipolleschi 33d12c1737 [LOCAL] Unify upload artifact action to 4.3.1 2024-09-11 10:47:38 +01:00
Riccardo Cipolleschi 6a08c38263 [LOCAL] Bump CLI to 14.1.0 2024-09-11 10:20:44 +01:00
Riccardo CipolleschiandGitHub 8c732ddf1b [RN][CI] Zip slices to preserve symlinks (#46301) 2024-09-11 10:15:58 +01:00
Riccardo CipolleschiandGitHub 4fb43c343f [LOCAL][CI] Fetch Github tags in the publish-release job (#46127) 2024-09-11 10:15:39 +01:00
Oskar KwaśniewskiandGitHub 61fdd51c50 (cherry-pick) fix: Hermes build for visionOS simulator (Release) (#45911) (#46169)
Summary:
Building for the visionOS simulator in the Release scheme requires an x86_64 slice to be included.

![CleanShot 2024-08-06 at 15 18 29@2x](https://github.com/user-attachments/assets/6fd962eb-ab71-4937-affe-964d8fa39f53)

## Changelog:

[IOS] [FIXED] - Include x86_64 slice when building for visionOS simulator

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

Test Plan: CI Green

Reviewed By: GijsWeterings

Differential Revision: D60828872

Pulled By: cipolleschi

fbshipit-source-id: 74444ac0b6661baf427837d242ba0ca295da0d16
2024-09-11 10:15:21 +01:00
Nicola CortiandGitHub 1067798a7e [0.75] RGNP - Remove unnecessary dependency on gradle-tooling-api-builders - serviceOf failure (#46367) 2024-09-11 10:15:06 +01:00
Blake FriedmanandRiccardo Cipolleschi 39222b41cb autolinked package scripts use absolute path (#46186)
Summary:
A previous attempt at fixing this issue used a relative path (https://github.com/facebook/react-native/issues/45208), this doesn't work if the user runs bundle install outside of the `ios/`
folder, using the `--project-directory=ios` argument.

## Changelog:
[iOS][Fixed] support bundle install from outside the ios folder using --project-directory

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

Test Plan:
Ran the command in a project with `react-native-firebase/app` using the
`--project-directory`, confirmed that it's fixed when using the absolute
path.

closes: reactwg/react-native-releases#341

Reviewed By: cipolleschi

Differential Revision: D61719821

Pulled By: blakef

fbshipit-source-id: d83429dd29c9e8cc066ab9843ad95fdfc0af8dea
2024-09-11 10:14:24 +01:00
Hampus SjöbergandRiccardo Cipolleschi 2a567cb546 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-11 10:13:46 +01:00
Tomasz ŻelawskiandRiccardo Cipolleschi bfb7e16aa3 fix(TypeScript): Allow readonly arrays in transform (#46310)
Summary:
Currently readonly arrays aren't allowed in components' style, but readonly objects are accepted. This becomes evident in such case:

```ts
import { View } from 'react-native';

interface AppProps {
  transform: readonly ({ translateX: number } | { translateY: number })[];
  shadowOffset: Readonly<{ width: number; height: number }>;
}

export default function App({ transform, shadowOffset }: AppProps) {
  return (
    <>
      {/* TypeScript error with transform */}
      <View style={{ transform }} />
      {/* No errors with shadowOffset */}
      <View style={{ shadowOffset }} />
    </>
  );
}
```

## Changelog:

[GENERAL] [FIXED] - Allow readonly array type for transform property

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

Test Plan:
`yarn test-typescript`

I added relevant tests cases.

Reviewed By: robhogan

Differential Revision: D62140462

Pulled By: NickGerleman

fbshipit-source-id: 87374b0901ebc40cab48d442b61fe7a65711bc89
2024-09-11 10:13:35 +01:00
Blake FriedmanandRiccardo Cipolleschi d4bb5820bd Add missing commander dependency (#46242)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/46242

This is transitively included, but should be explicitly included.

Changelog:
[Internal] commander is a dependency when bundling from Xcode

Reviewed By: cipolleschi

Differential Revision: D61916607

fbshipit-source-id: 1466d38d959970e5bd56576f8a7a22697d2eec4e
2024-09-11 10:13:26 +01:00
Andrew KnappandRiccardo Cipolleschi af5002b2e1 Fix GH-41226 by suppressing path adjustment when not actually drawing a border (#46239)
Summary:
When not drawing a border, the mGapBetweenPaths adjustment can create noticable pixelation when drawing curves through a low number of pixels.  This is noticable mostly on buttons and such on low-dpi devices.  This fix only applies the fix if clipping for the border radius is done.

When drawing small radius rounded backgrounds (e.g. to draw a circle or button) we see visible pixelation (see [GH-41226](https://github.com/facebook/react-native/issues/41226)) This is particularly noticable on low DPI devices.

## Changelog:

[ANDROID] [FIXED] - Don't use mGapBetweenPaths if not drawing a border

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

Test Plan:
Built an android app that directly uses CSSBackgroundDrawable to draw a background and verified repro of this issue.
![pre-fix](https://github.com/user-attachments/assets/e56a41b1-60f6-4953-9e91-b95a3380f2d7)
Then modified the code according to this PR and verified that anti-aliasing is appropriately applied
![fix](https://github.com/user-attachments/assets/b6b1aecf-a713-4e0a-9759-82c2dd862991)

Reviewed By: NickGerleman

Differential Revision: D61925281

Pulled By: jorge-cab

fbshipit-source-id: 93014629d031bd0d716cd3bb11e2c294dedad639
2024-09-11 10:13:16 +01:00
Blake FriedmanandRiccardo Cipolleschi 6eb2836f61 rebuild autolinking cache if empty or invalid (#46241)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/46241

Our test for rebuilding the `autolinking.json` file currently rebuilds everytime if the cached json file ISN'T empty.  This means users who have an empty entry get stuck there.

I've also added more validation that the contents of the cached config have at a minimum the `.project.android.packageName` entry in it, otherwise it rebuilds.

Changelog: [Internal]

Closes 46134

Reviewed By: cortinico

Differential Revision: D61911114

fbshipit-source-id: 188c7f975ce05802c8ea06eaa48345c2bc96f2b2
2024-09-11 10:13:00 +01:00
Dmitry RykunandRiccardo Cipolleschi 38d7549788 Start looking for codegen-enabled dependencies from the project root (#46229)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/46229

When running codegen from `pod install`, something affects `require.resolve`, and it starts looking for codegen-enabled dependencies from the workspace root, not the current RN project root.
This is bad if we have different versions of same dependency across multiple workspaces. One of them will be hoisted to the workspace root, and will be used for all the workspaces.

This issue is described in details here https://github.com/facebook/react-native/issues/46196

This diff is supposed to fix this by adding the project root path to the `require.resolve` call.

Changelog: [iOS][Fixed] - Codegen will start looking for codegen-enabled dependencies from the project root.

Reviewed By: cipolleschi

Differential Revision: D61850219

fbshipit-source-id: d60a0e72e9c60e862c0d64e227ea3652d1be5a90
2024-09-11 10:10:57 +01:00
shubhamguptadream11andRiccardo Cipolleschi 3c811d8465 fix(android): make getUri and isResource available for override (#46152)
Summary:
Fixes following issues:
- https://github.com/facebook/react-native/issues/46150
- https://github.com/facebook/react-native/issues/46155

## 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] - Make getUri and isResource open

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

Reviewed By: NickGerleman, rshest, blakef

Differential Revision: D61845164

Pulled By: cortinico

fbshipit-source-id: 88ccdad92423b5add9b2fad4c98f296b6cbfb27d
2024-09-11 10:10:46 +01:00
Alex HuntandRiccardo Cipolleschi 58008464c1 Replace usage of Java OptionalInt (#45862)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/45862

Fixes compatibility with Android API < 24, and removes our `JOptionalInt` wrapper implementation for now.

Changelog: [Internal]

Reviewed By: robhogan, motiz88

Differential Revision: D60581676

fbshipit-source-id: 7e79fc59a4199a967e62ac3aeafc5d5681c60077
2024-09-11 10:10:37 +01:00
szymonrybczakandRiccardo Cipolleschi 31a99388de fix(cli): replace querystring with URLSearchParam (#45125)
Summary:
[`querystring`](https://www.npmjs.com/package/querystring) package is deprecated. In this Pull Request I've replaced usage of `querystring` with `URLSearchParam` what is recommended by Node.js.

It's also causing a warning when installing dependencies inside a React Native app:
```
warning react-native > react-native/community-cli-plugin > querystring@0.2.1: The querystring API is considered Legacy. new code should use the URLSearchParams API instead.
```

## Changelog:

[INTERNAL] [FIXED] - Replace `querystring` package with `URLSearchParam`

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

Test Plan:
Params should be parsed in the same way and warning shouldn't be presented.

js1 jest xplat/js/tools/metro/packages/metro/src/cli/__tests__/parseKeyValueParamArray-test.js

Reviewed By: cipolleschi

Differential Revision: D58948498

Pulled By: GijsWeterings

fbshipit-source-id: 79b1f7b3feae230d2d3641205c513b98b3fda511
2024-09-11 10:10:25 +01:00
Riccardo Cipolleschi 44158de822 Revert "[RN][CI] Zip slices folders to preserve symlinks"
This reverts commit aa7296c008.
2024-09-02 14:55:12 +01:00
Riccardo Cipolleschi aa7296c008 [RN][CI] Zip slices folders to preserve symlinks 2024-09-02 14:54:15 +01:00
Blake Friedman a276df4d2a Update Podfile.lock
Changelog: [Internal]
2024-08-20 14:51:43 +01:00
React Native Bot 2e994fdddb Release 0.75.2
#publish-packages-to-npm&latest
2024-08-20 09:25:17 +00:00
shubhamguptadream11andBlake Friedman 1cea8e8027 feat(android): height issue fixed with keyboard avoiding component in new architecture (#45928)
Summary:
Fixes this issue: https://github.com/facebook/react-native/issues/45880

## Changelog:

<!-- Help reviewers and the release process by writing your own changelog entry.

Pick one each for the category and type tags:

[ANDROID] [CHANGED] - Message

For more details, see:
https://reactnative.dev/contributing/changelogs-in-pull-requests
-->

[ANDROID] [CHANGED] - Replaced `mLastHeight` with `mVisibleViewArea.height()` since mLastHeight value is not getting updated. For `width` we are already using `mVisibleViewArea.width()`

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

Test Plan: - Tested the fix in new and old architecture both

Reviewed By: christophpurrer

Differential Revision: D61023998

Pulled By: cortinico

fbshipit-source-id: df67616330effb7b9e6724d94b3be92c0dbd6190
2024-08-19 17:51:23 +01:00
Elene BotchoradzeandBlake Friedman 196399bb93 fix(ios): removed default value (#46020)
Summary:
Removed UIReturnKeyDefault as it caused bug when there wasn't any type.

## Changelog:

[IOS] [REMOVED]: UIReturnKeyDefault

<!-- Help reviewers and the release process by writing your own changelog entry.

Pick one each for the category and type tags:

[ANDROID|GENERAL|IOS|INTERNAL] [BREAKING|ADDED|CHANGED|DEPRECATED|REMOVED|FIXED|SECURITY] - Message

For more details, see:
https://reactnative.dev/contributing/changelogs-in-pull-requests

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

Reviewed By: christophpurrer

Differential Revision: D61277058

Pulled By: cipolleschi

fbshipit-source-id: 18349c49b05d492a2c2ed5713af3ceb6d3728e70
2024-08-19 14:22:29 +01:00
Riccardo CipolleschiandBlake Friedman 35daa07c39 Make sure we can create a .xcode.env.local (#46060)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/46060

Closures in ruby don't need the `return` statement. They exit from the calling function!

## Changelog
[Internal] - fix .xcode.env.local.generation

Reviewed By: cortinico

Differential Revision: D61343918

fbshipit-source-id: 39073ead7ad596f48403a5c2d4c066d410355698
2024-08-19 14:21:52 +01:00
Blake FriedmanandBlake Friedman c22803ac5f Fix publish template url for GHA action (#46040)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/46040

The URL to dispatch the workflow was not correct, see [0].

## Changelog: [Internal]

[0] https://docs.github.com/en/rest/actions/workflows?apiVersion=2022-11-28#create-a-workflow-dispatch-event

## Internal:

For S441191, see the job launched:
- https://github.com/react-native-community/template/actions/runs/10404141179/job/28811993693

 {F1806960111}

Reviewed By: cipolleschi

Differential Revision: D61333084

fbshipit-source-id: 62b20d792b9c667b3ee80d6d446423a6d24a67c2
2024-08-19 14:21:29 +01:00
Tommy NguyenandGitHub 0979921850 fix(react-native-codegen): scripts require yargs (#45995) 2024-08-19 14:21:18 +01:00
Nicola CortiandGitHub 02d9979c32 [0.75] Make Imagesource open for inheritance (#46093)
Fixes https://github.com/facebook/react-native/issues/46077
2024-08-19 14:19:49 +01:00
Nicola CortiandGitHub 45cd81706d [0.75] Add support for handling com.facebook.react.bridge.Dynamic as parameter for TurboModules (#46066) 2024-08-19 14:18:40 +01:00
React Native Bot b5b57731d3 Release 0.75.1
#publish-packages-to-npm&latest
2024-08-15 10:54:32 +00:00
Riccardo Cipolleschi c1cee11932 [LOCAL] Use fetch-depth to 0 to create a release 2024-08-15 11:52:12 +01:00
Riccardo Cipolleschi 077815358d [LOCAL][RN][CI] Make sure to fetch all tags 2024-08-15 11:47:48 +01:00
Riccardo CipolleschiandGitHub 8ab64afd3a [LOCAL][RN][CI] Use the right param to set the 'latest' tag (#46033) 2024-08-15 11:37:41 +01:00
Nicola Corti d94d447777 [LOCAL] Manual cherry-pick of 28597168aa 2024-08-15 10:31:39 +01:00
Nicola Corti 41b188b7e6 [LOCAL] Fix further compilation error introduced by cherry-pick conflicts 2024-08-15 10:29:13 +01:00
Nicola Corti a3187bb5d9 [LOCAL] Fix compilation error introduced by cherry-pick conflicts 2024-08-15 08:53:45 +01:00
Nicola Corti f202e80177 [LOCAL] Bump Hermes version 2024-08-15 08:20:44 +01:00
Nick GerlemanandNicola Corti 8c4f240c9b Gate off % border radii on Android Paper (#45945)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/45945

This code is forked on iOS, where we have been, as a policy, avoiding Paper-specific changes. This code is shared between renderers on Android, but it is confusing developer experience to have it work on Android Paper, to then fail on iOS unless it is on new arch.

This change disables support on Android Paper for consistency.

Changelog:
[Android][Removed] - Gate off % border radii on Android Paper

Reviewed By: cortinico

Differential Revision: D60967347

fbshipit-source-id: 1d26bc71aee677aa9a0dc9bb38f781a99c7762a8
2024-08-15 08:16:04 +01:00
Nick GerlemanandNicola Corti b64f5498f6 Gate off % translate on Android Paper (#45946)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/45946

This code is forked on iOS, where we have been, as a policy, avoiding Paper-specific changes. This code is shared between renderers on Android, but it is confusing developer experience to have it work on Android Paper, to then fail on iOS unless it is on new arch.

This change disables support on Android Paper for consistency.

Changelog:
[Android][Removed] - Gate off % translate on Android Paper

Reviewed By: joevilches

Differential Revision: D60970266

fbshipit-source-id: 5df73b948464f5093941528b0af2e694827a9460
2024-08-15 08:11:45 +01:00
Nicola Corti efe8a5e85a [LOCAL] Update Podfile.lock
Changelog: [Internal]
2024-08-15 08:09:22 +01:00
React Native Bot 89cdc14c8b Release 0.75.0
#publish-packages-to-npm&latest
2024-08-14 14:54:23 +00:00
Blake FriedmanandRiccardo Cipolleschi 9120cd30f2 Move init deprecation notice 30 Sept → 31 Dec (#45590)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/45590

This gives us more wiggle room with the release of 0.76.

Changelog: [General][Changed] Move init deprecation notice 30 Sept → 31 Dec

Reviewed By: cortinico

Differential Revision: D60105868

fbshipit-source-id: d03fcf5d4a97db9b21792eff6f993e2671b276ef
2024-08-14 14:30:23 +01:00
Gabriel DonadelandRiccardo Cipolleschi 34c91036e1 Add shared-testutil folder to NPM files to be published (#45936)
Summary:
React-native 0.75 RC7 gradle sync is currently broken due to the fact that the `shared-testutil` folder is missing from the `react-native/gradle-plugin` npm package

## Changelog:

[INTERNAL] [ADDED] - Add shared-testutil folder to NPM files to be published

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

Test Plan: N/A

Reviewed By: cipolleschi

Differential Revision: D60969631

Pulled By: cortinico

fbshipit-source-id: 850edfe0cf6b0e8174a1df9ea962d207d2ce0112
2024-08-14 14:29:29 +01:00
Nicola CortiandGitHub 82ddf5d532 [LOCAL] Bump Node on CircleCI to 18.18 to fix red signal (#45894) 2024-08-07 14:16:38 +01:00
React Native Bot 7244893b12 Release 0.75.0-rc.7
#publish-packages-to-npm&next
2024-08-06 11:16:54 +00:00
Nicola Corti b0662b3c33 [LOCAL] All librrc_textinput.so to NdkConfiguratorUtils.configureNewArchPackagingOptions 2024-08-06 11:44:06 +01:00
Riccardo Cipolleschi 6250409a62 [LOCAL] Bump Podfile.lock 2024-08-06 10:18:46 +01:00
szymonrybczakandRiccardo Cipolleschi b62bfcd561 feat: update CLI to 14.0.0 (#45540)
Summary:
Update to stable version of `react-native-community/cli`.

[GENERAL] [CHANGED] - Upgrade `react-native-community/cli` to `13.6.9`

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

Test Plan: n/a

Reviewed By: blakef

Differential Revision: D59960021

Pulled By: cortinico

fbshipit-source-id: 9d470699cdd2d20e08e844c92c7982056aec082c
2024-08-05 13:25:56 +01:00
React Native Bot 7e98cdba8a Release 0.75.0-rc.6
#publish-packages-to-npm&next
2024-07-29 16:54:09 +00:00
Nicola Corti 51156fd3b2 [LOCAL] Fix broken build of RNGP due to complex cherry-pick 2024-07-29 15:40:56 +01:00
Nicola CortiandGitHub c8cb3d4a59 [0.75] Fix core autolinking not working on Windows (#45796) 2024-07-29 14:43:00 +01:00
Riccardo CipolleschiandGitHub 011118fe13 [LOCAL][RN] Revert React from 19Rc to 18.3.1 (#45779)
* Revert ReacRevert React from 19 to 18.3.1 due to React 19 not being out as stable

\## Changelog
[General][Changed] - Revert from React 19 RC to React 18.3.1

* Revert from React 19 RC to React 18.3.1

\## Changelog
[General][Changed] - Revert from React 19RC to React 18.3.1

* Fix ruby tests
2024-07-29 14:36:44 +01:00
Gabriel DonadelandRiccardo Cipolleschi 88f2a24b5d RNGP - Filter out null dependencies from getGradleDependenciesToApply (#45749)
Summary:
`getGradleDependenciesToApply` tries to call `implementation:` in all libraries, including the ones that are not supported on Android.

## Changelog:

[INTERNAL] [FIXED] - Filter out platform-specific libraries from the auto-linking gradle plugin

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

Test Plan: CI should be green

Reviewed By: cipolleschi

Differential Revision: D60374769

Pulled By: cortinico

fbshipit-source-id: 33c83e9cc39d81b0e5c497570a936831ebb345f9
2024-07-29 14:25:38 +01:00
Jakub PiaseckiandGitHub ea8ad6457c [LOCAL] Make rrc_textinput on Android a shared library (#45592) 2024-07-29 14:24:49 +01:00
CHEN Xian-anandRiccardo Cipolleschi e39e9c4a60 Not all the targets have a defined symbol_type (#45591)
Summary:
Errors occurred on running `pod install`:

```
[!] An error occurred while processing the post-install hook of the Podfile.

undefined method `symbol_type' for #<Xcodeproj::Project::Object::PBXAggregateTarget:0x000000010f6ea568>

[redact]/node_modules/react-native/scripts/cocoapods/privacy_manifest_utils.rb:53:in `block in get_application_targets'
```

## Changelog:

[iOS] [Fixed] - Fix error on handling privacy manifest

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

Reviewed By: cipolleschi

Differential Revision: D60107607

Pulled By: dmytrorykun

fbshipit-source-id: 316220fe54174b18c9b61775f807d5d05d9f0240
2024-07-29 14:20:57 +01:00
Riccardo Cipolleschi 9fac7bdc43 Revert "Release 0.75.0-rc.6"
Changelog:
[Internal] - Revert release commit
2024-07-29 14:15:02 +01:00
React Native Bot a36476395a Release 0.75.0-rc.6
#publish-packages-to-npm&next
2024-07-22 16:55:20 +00:00
Riccardo Cipolleschi a91b9bff5d [LOCAL][RN][Release] Test Debug APK rather than Release APK 2024-07-22 14:41:11 +01:00
Riccardo CipolleschiandGitHub 9594d36d4a [LOCAL][RN][Release] Add logging to E2E test script (#45532) 2024-07-22 14:32:18 +01:00
szymonrybczakandRiccardo Cipolleschi 5189e457a4 feat: update CLI to 14.0.0 (#45540)
Summary:
Update to stable version of `react-native-community/cli`.

[GENERAL] [CHANGED] - Upgrade `react-native-community/cli` to `13.6.9`

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

Test Plan: n/a

Reviewed By: blakef

Differential Revision: D59960021

Pulled By: cortinico

fbshipit-source-id: 9d470699cdd2d20e08e844c92c7982056aec082c
2024-07-22 14:31:43 +01:00
Gabriel DonadelandRiccardo Cipolleschi 88276c51ad Restore CLI_PATH variable in react-native-xcode script (#45560)
Summary:
When changing the `react-native-xcode.sh` logic to use the helloworld cli on https://github.com/facebook/react-native/pull/44721, the `CLI_PATH` env var was removed along with `BUNDLE_COMMAND`. Both of these values were used by Expo to override the default CLI and use our custom bundling command.

https://github.com/expo/expo/blob/10e302ee13add0e24a08c7ee792c2da50ace95a6/templates/expo-template-bare-minimum/ios/HelloWorld.xcodeproj/project.pbxproj#L215C4-L215C15

This restores the `CLI_PATH` variable and set the default value as `"$REACT_NATIVE_DIR/scripts/bundle.js"`, along with the `BUNDLE_COMMAND` variable. With this Expo and other frameworks can keep the ability to easily replace the internal CLI

## Changelog:

[INTERNAL] [CHANGED] - Restore CLI_PATH variable in react-native-xcode script

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

Test Plan: Project compiles correctly on iOS

Reviewed By: robhogan

Differential Revision: D60035338

Pulled By: blakef

fbshipit-source-id: 26583d11d9f573f7cfa405b68e0cc3304c3601df
2024-07-22 14:28:35 +01:00
Douglas LowderandRiccardo Cipolleschi 72a38aace2 fix: Remove setting of process.exitCode that breaks Jest tests (#45562)
Summary:
In Node 20, the script to run unit tests in CI (`scripts/run-ci-javascript-tests.js`) will fail, even when all the Jest tests pass. This happens because one of the JS modules being tested is setting `process.exitCode` (see https://github.com/jestjs/jest/issues/9324#issuecomment-1808090455).

Changes:

- Modified the affected module to throw an exception when failing, instead of setting the exit code
- Adjusted the unit test for that module

## Changelog:

[General] [Fixed] - Remove setting of process.exitCode that breaks Jest tests

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

Test Plan:
Before this change, running `node scripts/run-ci-javascript-tests.js` would fail with Node 20.
After this change, it succeeds.

Reviewed By: blakef

Differential Revision: D60033582

Pulled By: cipolleschi

fbshipit-source-id: 71b7f4495d414e719a9bd2d892bd1bc3045ddd5d
2024-07-22 14:28:05 +01:00
nik910andRiccardo Cipolleschi d4b3fc9ed8 Adding space to $(inherited) string to avoid merging of inherited and… (#45520)
Summary:
Added space to $(inherited) string to avoid creation of wrong cpp flags in RCTAppDelegate podspec

<img width="1157" alt="Screenshot 2024-07-18 at 8 51 19 PM" src="https://github.com/user-attachments/assets/29d32d08-e81f-4c25-b8ee-5dccc0f620ea">

## Changelog:

[IOS] [FIXED] - Building of iOS project when RCTAppDelegate is used in the project

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

Test Plan: To test this you can simply change in your node modules and run pod install, the build will now work successfully

Reviewed By: cipolleschi

Differential Revision: D59950906

Pulled By: arushikesarwani94

fbshipit-source-id: 0d58620aa0be7ac4fcbcd309f06df0eef7844016
2024-07-22 14:27:38 +01:00
Riccardo Cipolleschi 9ec4af86a7 Fix path to node in .xcode.env.local (#43333)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/43333

This change fixes https://github.com/facebook/react-native/issues/43285.
Basically, when using a `yarn` alias to install pods, yarn creates a copy of the `node` and `yarn` executables and the `command -v node` command will return the path to that executable.

## Changelog
[iOS][Fixed] - Do not use temporary node when creating the .xcode.env.local

Reviewed By: dmytrorykun

Differential Revision: D54542774

fbshipit-source-id: 3ab0d0bb441988026feff9d5390dcfd10869a1b5
2024-07-22 14:27:09 +01:00
Nicola CortiandRiccardo Cipolleschi 648520be32 Add react-native.config.js to autolinking lockfiles (#45511)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/45511

This adds react-native.config.js to autolinking default lockfiles
so autolinking can account for changes in that file.

Changelog:
[Internal] [Changed] - Add react-native.config.js to autolinking lockfiles

Reviewed By: blakef

Differential Revision: D59907268

fbshipit-source-id: d5893a3f7b4d5d9f6c6c13042aa6866ad16b2ea4
2024-07-22 14:26:50 +01:00
Blake FriedmanandRiccardo Cipolleschi 53e62de9c7 always proxy to @react-native-community/cli (#45464)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/45464

Previous work would cause versions >= react-native 0.76 to exit if called through `npx react-native <cmd>`. This was intended to be full deprecated and removed.  The intention was to shift users to calling react-native-community/cli directly.

This change allows commands to be proxied to react-native-community/cli but with no guarantees of success.  It's up to each framework / project to explicitly create that dependency.

This also  provides warnings, which won't go away, suggesting the supported method of calling the community CLI directly.

The outcome is that we're not going to break existing workflows.

closes: #45461

Changelog: [General][Fixed] allow proxying commands from react-native to react-native-community/cli with explicit warning

Reviewed By: cortinico

Differential Revision: D59805357

fbshipit-source-id: 21e23b082a9c709effa050d8e7dd04a40f5ab0e6
2024-07-22 14:26:27 +01:00
Nicola CortiandRiccardo Cipolleschi c75ec15b48 Unbreak RNTester instacrashing on main (#45467)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/45467

This unbreaks RNTester instacrashing on main.

Changelog:
[Internal] [Changed] - Unbreak RNTester instacrashing on main

Reviewed By: javache

Differential Revision: D59806826

fbshipit-source-id: 6d5246cd02e2c364068d047b973b2954b459df1e
2024-07-22 14:25:53 +01:00
Blake FriedmanandRiccardo Cipolleschi 4f6f0a19cf publish template on publishing release (#45327)
Summary:
Call the react-native-community/template GHA to trigger a new release when we publish a react-native release. This then waits to confirm that the package is published.

See react-native-community/template#36 for the matching change

Changelog: [General][Added] trigger template publish

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

Test Plan: Not sure on the best way forward here.

Reviewed By: cipolleschi

Differential Revision: D59467829

Pulled By: blakef

fbshipit-source-id: 091269e7ecdae5801ac7c03a1ede54452ae99b24
2024-07-22 14:25:19 +01:00
Blake Friedman 7d0ec89498 Update Podfile.lock
Changelog: [Internal]
2024-07-16 15:12:22 +01:00
React Native Bot 46b269dd46 Release 0.75.0-rc.5
#publish-packages-to-npm&next
2024-07-15 17:06:25 +00:00
Riccardo Cipolleschi 0e56bce6ba [LOCAL] Fix React-perflogger.podspec conflict 2024-07-15 16:24:47 +02:00
Riccardo CipolleschiandBlake Friedman d0c94d6de1 Factor out the CXX language standard in a separate const (#45374)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/45374

This change factors out the language standard in a separate constant so we can easily control it from a single place.

There are only 2 exception to this:
1. hermes-engine: the podspec is used in CI and it has no access to the rct_cxx_language_standard variable
2. Yoga: it can be used as a separate pod, outside of React Native, so it makes sense to leave it alone.

This change also fixes a problem where, in some setup, the language was set to C++14

[Internal] - Refactor Cxx language standard in a single constant

Reviewed By: dmytrorykun, blakef

Differential Revision: D59629061

fbshipit-source-id: 41eac64e47c14e239d8ee78bd88ea30af244d695
2024-07-15 14:45:14 +01:00
Riccardo CipolleschiandBlake Friedman 28d171993e Make sure to pass the BridgeProxy to view managers in the interop layer (#45329)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/45329

Thanks to [#45232](https://github.com/facebook/react-native/issues/45232) we found a bug in the interop layer, where we were not passing the BridgeProxy in bridgeless mode to the view managers.

This Change should fix that issue.

## Changelog:
[iOS][Fixed] - Make sure to pass the RCTBridgeProxy to  ViewManagers

Reviewed By: dmytrorykun

Differential Revision: D59468292

fbshipit-source-id: 00666be21385a735878eb567c4b8a0986c609c5f
2024-07-15 14:43:48 +01:00
Nick GerlemanandBlake Friedman 7484e72210 Fix "Platform.constants.reactNativeVersion.prerelease" Flow and TypeScript types (#45256)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/45256

The actual stamped versions here are all strings.

Android interface for constants is untyped, and we always return a string here. iOS, we will try to parse the string into a double, which will fail for every prerelease version RN has ever published.

Platform on Windows seems to uniquely be doing the right thing.

Changelog:
[General][Fixed] - Fix Platform.constants.reactNativeVersion type

Reviewed By: robhogan, necolas

Differential Revision: D59141948

fbshipit-source-id: 9c758e5eb8796b03197258d87ec06b31018e211c
2024-07-15 14:43:12 +01:00
Wojciech LewickiandBlake Friedman 58bbbff4d7 feat: expose prefabs for newly added targets (#45386)
Summary:
In recent commits, some new targets have been added, and they are not exposed as prefabs, yet are used in e.g. `TextLayoutManager`. They are needed then for `react-native-live-markdown`: https://github.com/Expensify/react-native-live-markdown/pull/428/commits/c1611cd98ed5009fd66c871b9999b55941086af0

## 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] [ADDED] - expose prefabs for newly added targets

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

Test Plan: It cannot be tested inside the repo, but try to build the `example` app with new arch enabled on `Android` in the `react-native-live-markdown` repo to see that those are needed.

Reviewed By: NickGerleman

Differential Revision: D59638801

Pulled By: cortinico

fbshipit-source-id: 3d09507d72a0c4d3dbb3a2a81b753625230a04a3
2024-07-15 14:37:59 +01:00
Nicola CortiandBlake Friedman c45d450502 Upstream CLI autolinking changes to RNGP (#45314)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/45314

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

I'm ustreaming two changes that happened inside the CLI/Autolinking logic that are
missing inside core autolinking.

Changelog:
[Internal] [Changed] - Upstream CLI autolinking changes to RNGP

Reviewed By: blakef

Differential Revision: D59460504

fbshipit-source-id: a6e7ab6a46fec26620dc965e77b13fdeba84fae3
2024-07-15 14:37:29 +01:00
Miklós FazekasandBlake Friedman e1d97f4621 fix: android autolinkLibrariesFromCommand should handle timeout or non zero exit code (#45333)
Summary:
Fixes: https://github.com/facebook/react-native/issues/45307

## Changelog:

[Android] [Fixed] - if `npx react-native-community/cli config` fails or timeouts proper error is shown and built is aborted, instead of leaving and empty autolinking.json

During build `npx react-native-community/cli config` is generated into autolinking.json. When command fails, we should error and should not leave and empty `autolinking.json`

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

Test Plan:
Output of the reproducer in https://github.com/facebook/react-native/issues/45307 looks like this:

```log
android % ./gradlew assembleDebug
Starting a Gradle Daemon (subsequent builds will be faster)
ERROR: autolinkLibrariesFromCommand: Failed to create /Users/boga/Work/OSS/RNMBGL/rn-fabric-boolattribute/ReproducerApp/android/build/generated/autolinking/autolinking.json - process npx react-native-community/cli config  exited with error code: 126

FAILURE: Build failed with an exception.

* Where:
Settings file '/Users/boga/Work/OSS/RNMBGL/rn-fabric-boolattribute/ReproducerApp/android/settings.gradle' line: 3

* What went wrong:
A problem occurred evaluating settings 'android'.
> ERROR: autolinkLibrariesFromCommand: Failed to create /Users/boga/Work/OSS/RNMBGL/rn-fabric-boolattribute/ReproducerApp/android/build/generated/autolinking/autolinking.json - process npx react-native-community/cli config  exited with error code: 126

* Try:
> Run with --stacktrace option to get the stack trace.
> Run with --info or --debug option to get more log output.
> Run with --scan to get full insights.
> Get more help at https://help.gradle.org.

BUILD FAILED in 10s
8 actionable tasks: 4 executed, 4 up-to-date
```

Output if you modify the package.json to be invalid looks like this:

```log
android % ./gradlew assembleDebug
ERROR: autolinkLibrariesFromCommand: process npx react-native-community/cli config  exited with error code: 1
JSONError: JSON Error in /Users/boga/Work/OSS/RNMBGL/rn-fabric-boolattribute/ReproducerApp/package.json:

  35 |     "node": ">=18"
  36 |   },
> 37 |   SOMETHING_NON_JSON
     |   ^
  38 |   "packageManager": "yarn@3.6.4",
  39 |   "resolutions": {
  40 |     "rtn-centered-text": "portal:../RTNCenteredText"

Unexpected token "S" (0x53) in JSON at position 1019 while parsing near "...ode\": \">=18\"\n  },\n  SOMETHING_NON_JSON\n ..."

  35 |     "node": ">=18"
  36 |   },
> 37 |   SOMETHING_NON_JSON
     |   ^
  38 |   "packageManager": "yarn@3.6.4",
  39 |   "resolutions": {
  40 |     "rtn-centered-text": "portal:../RTNCenteredText"

    at parseJson (/Users/boga/Work/OSS/RNMBGL/rn-fabric-boolattribute/ReproducerApp/node_modules/parse-json/index.js:29:21)
    at loadJson (/Users/boga/Work/OSS/RNMBGL/rn-fabric-boolattribute/ReproducerApp/node_modules/react-native-community/cli-config/node_modules/cosmiconfig/dist/loaders.js:48:16)
    at #loadConfiguration (/Users/boga/Work/OSS/RNMBGL/rn-fabric-boolattribute/ReproducerApp/node_modules/react-native-community/cli-config/node_modules/cosmiconfig/dist/ExplorerSync.js:116:36)
    at #loadConfigFileWithImports (/Users/boga/Work/OSS/RNMBGL/rn-fabric-boolattribute/ReproducerApp/node_modules/react-native-community/cli-config/node_modules/cosmiconfig/dist/ExplorerSync.js:87:54)
    at #readConfiguration (/Users/boga/Work/OSS/RNMBGL/rn-fabric-boolattribute/ReproducerApp/node_modules/react-native-community/cli-config/node_modules/cosmiconfig/dist/ExplorerSync.js:84:82)
    at search (/Users/boga/Work/OSS/RNMBGL/rn-fabric-boolattribute/ReproducerApp/node_modules/react-native-community/cli-config/node_modules/cosmiconfig/dist/ExplorerSync.js:50:63)
    at emplace (/Users/boga/Work/OSS/RNMBGL/rn-fabric-boolattribute/ReproducerApp/node_modules/react-native-community/cli-config/node_modules/cosmiconfig/dist/util.js:36:20)
    at ExplorerSync.search (/Users/boga/Work/OSS/RNMBGL/rn-fabric-boolattribute/ReproducerApp/node_modules/react-native-community/cli-config/node_modules/cosmiconfig/dist/ExplorerSync.js:78:42)
    at getUserDefinedOptionsFromMetaConfig (/Users/boga/Work/OSS/RNMBGL/rn-fabric-boolattribute/ReproducerApp/node_modules/react-native-community/cli-config/node_modules/cosmiconfig/dist/index.js:32:37)
    at mergeOptionsBase (/Users/boga/Work/OSS/RNMBGL/rn-fabric-boolattribute/ReproducerApp/node_modules/react-native-community/cli-config/node_modules/cosmiconfig/dist/index.js:60:31)

FAILURE: Build failed with an exception.

* Where:
Settings file '/Users/boga/Work/OSS/RNMBGL/rn-fabric-boolattribute/ReproducerApp/android/settings.gradle' line: 3

* What went wrong:
A problem occurred evaluating settings 'android'.
> ERROR: autolinkLibrariesFromCommand: process npx react-native-community/cli config  exited with error code: 1

* Try:
> Run with --stacktrace option to get the stack trace.
> Run with --info or --debug option to get more log output.
> Run with --scan to get full insights.
> Get more help at https://help.gradle.org.

BUILD FAILED in 2s
8 actionable tasks: 4 executed, 4 up-to-date
```

Reviewed By: cipolleschi

Differential Revision: D59582430

Pulled By: cortinico

fbshipit-source-id: bedb9563175cc5c46f5af80cf309769e56b803cc
2024-07-15 14:36:58 +01:00
Blake Friedman f303bcaaa5 fix: ios Helloworld assumes community cli is present (#45221)
Summary:
Use the hard-coded config for Helloworld instead of assuming the community cli is there to generate a config, which we can no longer assume.

Changelog: [Internal]

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

Test Plan:
This works in my local environment:
```
bundle exec pod install
```
and
```
./gradlew generateAutolinkingPackageList
```
Changelog: [Internal]

Reviewed By: javache

Differential Revision: D59162715

Pulled By: blakef

fbshipit-source-id: 95ff2c3929f12ee0ecf468cb80d2df1281eb746e
2024-07-15 14:36:49 +01:00
Miklós FazekasandBlake Friedman 2e06efbf5d Allow library podspec to declare Swift Package Manager dependencies (#44627)
Summary:
React-Native uses Cocapods for native dependency management on iOS. While CocoaPods is flexible and popular, Apple's Swift Package Manager is the new standard. Currently consuming packages available only via Swift Package Manager is not possible. This change implements a single extension so .podspec files can declare Swift Package Manager dependencies via
```ruby
ReactNativePodsUtils.spm_dependency(s,
     url: 'https://github.com/apple/swift-atomics.git',
     requirement: {kind: 'upToNextMajorVersion', minimumVersion: '1.1.0'},
     products: ['Atomics']
   )
```

bypass-github-export-checks

## Changelog:

[IOS] [ADDED] - libraries can now declare Swift Package Manager dependencies in their .podspec with `ReactNativePodsUtils.spm_dependency`

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

Test Plan:
https://github.com/mfazekas/rn-spm-rfc-poc/

Is a simple demo for the feature:

1. Podspec declare dependency with:

   ```ruby
   if const_defined?(:ReactNativePodsUtils) && ReactNativePodsUtils.respond_to?(:spm_dependency)
     ReactNativePodsUtils.spm_dependency(s,
       url: 'https://github.com/apple/swift-atomics.git',
       requirement: {kind: 'upToNextMajorVersion', minimumVersion: '1.1.0'},
       products: ['Atomics']
     )
   else
     raise "Please upgrade React Native to >=0.75.0 to use SPM dependencies."
   end
   ```

2. [`import Atomics`](https://github.com/mfazekas/rn-spm-rfc-poc/blob/e4eb1034f7498dedee4cb673d327c34a6048bda2/ios/MultiplyInSwift.swift#L1C2-L1C15) and [`ManagedAtomic`](https://github.com/mfazekas/rn-spm-rfc-poc/blob/e4eb1034f7498dedee4cb673d327c34a6048bda2/ios/MultiplyInSwift.swift#L7-L13) is used in the code

3.) `spm_dependency` causes the dependency to be added via `post_install` hook in the workspace

<img width="261" alt="image" src="https://github.com/facebook/react-native/assets/52435/ad6aee1c-ac88-4c84-8aa3-50e148c4f5b2">

4.) `spm_dependecy` causes the library to be linked with `Atomics` library

<img width="817" alt="image" src="https://github.com/facebook/react-native/assets/52435/bfc8dfc0-aeb7-4c75-acbd-937eab1cbf80">

Limitations:
1.) only works `USE_FRAMEWORKS=dynamic pod install` otherwise the linker fails [with known Xcode issue - duplicate link issue](https://forums.swift.org/t/objc-flag-causes-duplicate-symbols-with-swift-packages/27926)
2.) .xcworkspace needs to be reopened after `pod install` - this could be worked around by not removing/readding spm dependencies

### See also:

https://github.com/react-native-community/discussions-and-proposals/issues/587#issuecomment-2117025448
https://github.com/react-native-community/discussions-and-proposals/pull/787

Reviewed By: cortinico

Differential Revision: D58947066

Pulled By: cipolleschi

fbshipit-source-id: ae3bf955cd36a02cc78472595fa003cc9e843dd5
2024-07-15 14:36:12 +01:00
IrfanwaniandBlake Friedman 4cec121a7b fix: post install error in iOS after running pod install, undefined method 'path' for nil:NilClass (#45095)
Summary:
After upgrading my project to the latest version of react native i.e, 0.74.2, i was getting an error when running `pod install` an the error was coming from the post install hook. Going deeper into the file tree, i found that some of the things are Nil and react native is trying to use some methods on them, so fixed those issues by using chaining operators to conditionally apply the path method on them.

## Changelog:

[Internal] - fixes the post install issue when running pod install with react native version, 0.74.2

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

Test Plan: Manually tested the fix. Works perfectly fine in both debug and production mode.

Reviewed By: cortinico

Differential Revision: D58863666

Pulled By: cipolleschi

fbshipit-source-id: 64459711dcf926b7544b99b542e9861c1c0f05ca
2024-07-15 14:35:49 +01:00
Rubén NorteandBlake Friedman 95fa0dcdc8 Fix broken CI due to missing dependencies
Summary:
https://github.com/facebook/react-native/pull/45409 broke CI because it didn't set up dependencies correctly. This should fix it.

Changelog: [internal]

Reviewed By: cipolleschi

Differential Revision: D59751194
2024-07-15 14:35:16 +01:00
Rubén NorteandBlake Friedman 58a525aa2f Replace BridgelessJSCallInvoker with RuntimeSchedulerCallInvoker everywhere (#45409)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/45409

Changelog: [internal]

This removes `BridgelessJSCallInvoker` in favor of `RuntimeSchedulerCallInvoker`. This change should be transparent when not invoking JS callbacks using priorities, as both of them would just go directly to the scheduler using `scheduleWork`, but when priorities are specified, they'd now be honored in `RuntimeSchedulerCallInvoker`.

I realized this wasn't being used when I saw that `PerformanceObserver` callbacks were always scheduled with the highest priority, instead of with idle priority as specified in code.

Reviewed By: sammy-SC

Differential Revision: D59679512

fbshipit-source-id: 51d36d56ef1ff0b34e5157ed7b5e08de0a3884d2
2024-07-15 14:34:06 +01:00
Rubén NorteandBlake Friedman 2373a0003a Fix incorrect application of idle priority in RuntimeScheduler (#45408)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/45408

Changelog: [General][Fixed] Fixed prioritization of idle priority tasks

We recently found out that idle priority tasks were never scheduled with the lowest priority possible. We didn't realize before because idle priority tasks weren't used, but now they are via `requestIdleCallback` and other mechanisms.

The problem was that the timeout for idle priority tasks was `std::chrono:milliseconds::max()`, and we compute the expiration time adding that to the current time. Doing that operation is always guaranteed to overflow, and the resulting expiration time was always in the past, resulting in the task having higher priority than any other tasks with any other priorities.

Instead of using `max()` we can just use a sensible value for idle priorities. In this case, 5 minutes should be more than enough.

Reviewed By: sammy-SC

Differential Revision: D59679513

fbshipit-source-id: 6c0f9e275818737ce804f05615c01f7ea6c126ab
2024-07-15 14:33:38 +01:00
Håkon KnutzenandBlake Friedman d4eb12f48a Fix data races in RCTImageLoader and RCTNetworkTask with shared atomic counters (#45114)
Summary:
In order to fix the data races described in https://github.com/facebook/react-native/issues/44715, I propose a simple solution by leveraging shared counter functions wherein `std::atomic` is the backing for the integer values.

## Changelog:

[iOS] [Fixed] - Implement shared atomic counters and replace static integers in `RCTImageLoader` and `RCTNetworkTask` that were accessed concurrently, which in some cases lead to data races.

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

Test Plan: Added unit tests for the counters in `RCTSharedCounterTests`.

Reviewed By: cipolleschi

Differential Revision: D59155076

Pulled By: javache

fbshipit-source-id: f73afce6a816ad3226ed8c123cb2ccf4183549a0
2024-07-15 14:31:53 +01:00
Nicola CortiandBlake Friedman 593ddc7109 Back out "Kotlinify NativeModule" (#45411)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/45411

Original commit changeset: 6e096552750e

Original Phabricator Diff: D55792976

Changelog:
[Android] [Fixed] - Reverted "[react-native] Kotlinify NativeModule"

Reviewed By: fabriziocucci

Differential Revision: D59680321

fbshipit-source-id: f118f436dc4086676d3ed98fa8d8b28033d9cd47
2024-07-15 14:29:40 +01:00
Nicola CortiandBlake Friedman 273df72301 Undo a breaking change with ResourceDrawableIdHelper.instance (#45389)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/45389

This undos a breaking change with ResourceDrawableIdHelper for Kotlin consumer.
I've re-added a `getInstance` method so that Kotlin libraries won't break.
The method is added as Deprecated as those libraries need to migrate to `.instance`
accessors as more idiomatic.

Changelog:
[Android] [Fixed] - Undo a breaking change with ResourceDrawableIdHelper.instance

Reviewed By: robhogan

Differential Revision: D59638043

fbshipit-source-id: ae2aab962e9a7676f0bfbae21f699e274502dc6a
2024-07-15 14:29:35 +01:00
Nicola CortiandBlake Friedman b8b9e9ee7d Undo a breaking change with I18nUtil.instance (#45390)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/45390

This undos a breaking change with I18nUtil for Kotlin consumer.
I've re-added a `getInstance` method so that Kotlin libraries won't break.
The method is added as Deprecated as those libraries need to migrate to `.instance`
accessors as more idiomatic.

Changelog:
[Android] [Fixed] - Undo a breaking change with I18nUtil.instance

Reviewed By: alanleedev

Differential Revision: D59638044

fbshipit-source-id: 1c93a98676b5b01e89be3b974961c5f3ae919511
2024-07-15 14:29:28 +01:00
Nicola CortiandBlake Friedman 50643a300c Undo breaking change for ReadableMap.entryIterator for Kotlin consumers. (#45388)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/45388

This undos a breaking change we're about to ship in 0.75, where Kotlin users
where forced to update this callsite to be `.getEntryIterator`.

This re-introduces a `entryIterator` val so both Kotlin and Java compatibility are retained.

Changelog:
[Android] [Fixed] - Undo breaking change for ReadableMap.entryIterator for Kotlin consumers

Reviewed By: alanleedev

Differential Revision: D59637925

fbshipit-source-id: b674df86e056f17791d9cabe28557529886f1c93
2024-07-15 14:29:22 +01:00
Nicola CortiandBlake Friedman b1b41470e0 Undo breaking change on Dynamic.type and Dynamic.isNull (#45378)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/45378

Kotlin consumers of those APIs are forced with this breaking change:

```
# Before thanks to Java property conversion
Dynamic.type
# After
Dynamic.getType()
```
This restores the old more idiomatic API by moving those 2 funcitons to be vals.

Changelog:
[Android] [Fixed] - Undo breaking change on Dynamic.type and Dynamic.isNull

Reviewed By: javache

Differential Revision: D59631783

fbshipit-source-id: 8d720af34e104ee0e4f3120302a4a84fc17a7b1c
2024-07-15 14:28:56 +01:00
Nicola CortiandBlake Friedman 65975fe37b Undo breaking change on getJsCallInvokerHolder (#45376)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/45376

This reduces one breaking change users are seeing on `CatalystInstance.getJsCallInvokerHolder`.
I had to specify:

```
Suppress("INAPPLICABLE_JVM_NAME")
get:JvmName("getJSCallInvokerHolder")
```

as the Kotlin compiler is unhappy with me setting a JvmName on a interface property.
More on this here: https://youtrack.jetbrains.com/issue/KT-31420

Changelog:
[Android] [Fixed] - Undo breaking change on `CatalystInstance.getJsCallInvokerHolder`

Reviewed By: javache

Differential Revision: D59631640

fbshipit-source-id: 4d5b3499e4e0e0bec1d380c4b7942ea28ae35465
2024-07-15 14:28:02 +01:00
Riccardo Cipolleschi 09152303d7 [LOCAL] Revert changes to project.pbxproj 2024-07-08 19:57:35 +02:00
Riccardo Cipolleschi af3402c019 [LOCAL] Bump podfile.lock 2024-07-08 19:56:25 +02:00
React Native Bot a2022aff95 Release 0.75.0-rc.4
#publish-packages-to-npm&next
2024-07-08 15:49:29 +00:00
Ruslan LesiutinandGitHub 2617ec5570 upgrade[react-devtools-core]: ^5.3.1 (#45288) 2024-07-08 15:17:02 +02:00
Tomek ZawadzkiandRiccardo Cipolleschi 625d330ed9 Fix dynamic_cast (RTTI) by adding key function to ShadowNodeWrapper again (#45290)
Summary:
This PR restores the virtual destructor for `ShadowNodeWrapper` which was added in https://github.com/facebook/react-native/pull/33500 and unfortunately removed in https://github.com/facebook/react-native/pull/40864.

The virtual destructor here serves as a key function. Without a key function, `obj.hasNativeState<ShadowNodeWrapper>(rt)` **does not** work correctly between shared library boundaries on Android and always returns false.

We need this pretty badly in third-party libraries like react-native-reanimated or react-native-gesture-handler.

## 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 dynamic_cast (RTTI) for ShadowNodeWrapper when accessed by third-party libraries again

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

Test Plan: This patch fixes an issue in Reanimated's fabric-example app.

Reviewed By: fabriziocucci

Differential Revision: D59375554

Pulled By: javache

fbshipit-source-id: 09f3eda89a67c26d6dacca3428e08d1b7138d350
2024-07-08 15:16:30 +02:00
Jakub PiaseckiandRiccardo Cipolleschi 2d42024d21 Update ignore file to include ReactBuildConfig in the npm package (#45279)
Summary:
Changes `.npmignore` file to only exclude the `ReactAndroid/build` directory instead of all `build` directories under `ReactAndroid` (which included the `ReactAndroid/src/main/java/com/facebook/react/common/build` package). This problem was caused by the newer version of NPM being used.

Closes https://github.com/facebook/react-native/issues/45204

## Changelog:

[ANDROID] [FIXED] - Fixed build from source failing due to a missing file

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

Test Plan:
Run `npm pack` or `npm publish -dry-run`.

Before this change it includes 3774 files in the package and `ReactBuildConfig` isn't included. After this change it includes 3775 files in the package and `ReactBuildConfig` is included.

Reviewed By: javache

Differential Revision: D59371555

Pulled By: cortinico

fbshipit-source-id: f54f1e88e30429d538b9e160e6ce20d994c5d1b8
2024-07-08 15:15:52 +02:00
Wojciech LewickiandRiccardo Cipolleschi 83a2086548 fix: add JvmStatic to all methods used in cpp (#45243)
Summary:
Following-up on https://github.com/facebook/react-native/pull/45230, I added all the needed `JvmStatic` annotations for methods used in cpp code here: https://github.com/facebook/hermes/blob/f5c867514c71b25212eb3039230e0c095518b532/lib/Platform/Unicode/PlatformUnicodeJava.cpp.

## Changelog:

<!-- Help reviewers and the release process by writing your own changelog entry.

Pick one each for the category and type tags:

[ANDROID] [FIXED] - Use `JvmStatic` annotations for all methods from `AndroidUnicodeUtils.kt`

For more details, see:
https://reactnative.dev/contributing/changelogs-in-pull-requests
-->

[ANDROID] [FIXED] - Use `JvmStatic` annotations for all methods from `AndroidUnicodeUtils.kt`

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

Test Plan: Try and use those methods to see that they don't crash on `cpp` side.

Reviewed By: cortinico

Differential Revision: D59264093

Pulled By: dmytrorykun

fbshipit-source-id: 07d683ee38ea1c7d9621ad2e37d04f3d484d3200
2024-07-08 15:15:30 +02:00
Riccardo CipolleschiandGitHub 1630b5c743 [RN][Testing] Update testing scripts to work with any version of React native (#45201) 2024-07-03 16:11:08 +01:00
Nicola Corti 7db3ebe2d1 Update Podfile.lock
Changelog: [Internal]
2024-07-02 10:55:27 +01:00
React Native Bot 15b55714eb Release 0.75.0-rc.3
#publish-packages-to-npm&next
2024-07-01 16:54:13 +00:00
Nicola Corti 2ab13798f9 [LOCAL] Bump hermes to hermes-2024-07-01-RNv0.75.0-1edbe36ce92fef2c4d427f5c4e104f2758f4b692 2024-07-01 14:38:19 +01:00
Bartłomiej BłoniarzandNicola Corti 07420ea5a2 Add missing WithRuntimeDecorator methods (#45042)
Summary:
This PR adds missing `WithRuntimeDecorator` methods related to `NativeState`. This pattern is used by reanimated to ensure no concurrent access to the runtime. Without this `override` the `RuntimeDecorator` implementation was used, bypassing our mutex.

Changelog:
[GENERAL] [FIXED] - Add missing `NativeState` methods to the `WithRuntimeDecorator` class.

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

Reviewed By: fbmal7

Differential Revision: D58744051

Pulled By: neildhar

fbshipit-source-id: 3f5c85d0bf7cd6445d0c434ac4ae7ed54df203ba
2024-07-01 14:34:00 +01:00
Alan LeeandNicola Corti 173587f5ec extract ParsedError handling to helper (#44922)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/44922

extract ParsedError handling code into `StackTraceHelperTest`.

Changelog: [Internal]

Reviewed By: cortinico

Differential Revision: D58512611

fbshipit-source-id: 959978d80907f2afba96ef249c2fddd351d099ff
2024-07-01 14:32:01 +01:00
Alan LeeandNicola Corti 75584641be add default early JS error handler (#44884)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/44884

Removing JavaScript error handler supplied to ReactHostImpl.java which is just a stub and creating a default handler in ReactInstance.java which uses NativeExceptionHandler TurboModule to handle error.

Changelog: [Android][BREAKING]  Removing `ReactJsExceptionHandler` param from ReactHostImpl() constructor and providing a default private implementation

Reviewed By: javache, cortinico

Differential Revision: D58385767

fbshipit-source-id: 46548677df936b7c2f584084a2c9769c27e6a963
2024-07-01 14:31:54 +01:00
Gabriel DonadelandNicola Corti f86bc9512f Fix Android autolink plugin for libraries that are platform specific (#45223)
Summary:
Fixes https://github.com/facebook/react-native/issues/45222

## Changelog:

[ANDROID] [FIXED] - Fix autolink plugin for libraries that are platform-specific

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

Test Plan: And a library that does not have Android native code such as react-native-segmented-control/segmented-control and sync gradle

Reviewed By: rshest

Differential Revision: D59221562

Pulled By: cortinico

fbshipit-source-id: 55739d63ded63e46897d0d770281f937668c1f50
2024-07-01 14:28:13 +01:00
Nicola Corti 3252855e1d Fix crash due to missing @JvmStatic to convertToCase
Summary:
Users are reporting that RN 0.75 is crashing due to us attempting to accessing a static method
on `AndroidUnicodeUtils.convertToCase` which is not static anymore due to Kotlin conversion.

Static access is inside Hermes codebase here:
https://github.com/facebook/hermes/blob/f5c867514c71b25212eb3039230e0c095518b532/lib/Platform/Unicode/PlatformUnicodeJava.cpp#L107-L109

Changelog:
[Android] [Fixed] - Fix crash due to missing JvmStatic to `convertToCase`

Reviewed By: javache

Differential Revision: D59218291

fbshipit-source-id: ac121a8bcd5fd917ee134d257f967c8e3e338ca5
2024-07-01 14:27:55 +01:00
imWildCatandNicola Corti 89073d46bd fix the path of the script phase (#45208)
Summary:
Since 0.75-rc.x, I cannot run pod install because of an linking issue of react native firebase.

https://github.com/reactwg/react-native-releases/issues/341#issuecomment-2194568204

## Changelog:

[IOS][FIXED] Auto linking script of script phase

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

Test Plan: Full demo of this fix: <https://github.com/imWildCat-archived/react-native-075-rc2-regression-ios-linking-script-phase>

Reviewed By: christophpurrer

Differential Revision: D59125585

Pulled By: blakef

fbshipit-source-id: be96d3b207eff67c5e0d777203e7fc0d10103fc0
2024-07-01 14:27:31 +01:00
Dmitry RykunandNicola Corti 6bd418b738 Fix output path for generated artifacts (#45165)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/45165

This is a fix for https://github.com/facebook/react-native/issues/45112
This diff changes the codegen so that the output path is computed relative to project root (or `path` if provided) instead of current working directory.

Changelog: [General][Fixed] - Codegen computes output path relative to project root instead of current working directory.

Reviewed By: fkgozali

Differential Revision: D59009821

fbshipit-source-id: 3a138a3508fc239c8600b8c9f242f1c665f8e3c0
2024-07-01 14:27:15 +01:00
Riccardo Cipolleschi 1f10d62700 [LOCAL][iOS] Bump Podfile.lock to RC.2 2024-06-26 14:50:06 +02:00
Riccardo Cipolleschi f938e3214c [LOCAL] Fix type import in testing scripts 2024-06-26 13:06:08 +02:00
React Native Bot 668358c47a Release 0.75.0-rc.2
#publish-packages-to-npm&next
2024-06-26 10:59:42 +00:00
zhongwuzwandNicola Corti 4783de7a40 Fixes js bundle failed (#45155)
Summary:
When I enabled `FORCE_BUNDLING`, it build errors like below. cc blakef
![image](https://github.com/facebook/react-native/assets/5061845/d23f6bad-ed60-4f1f-8111-2361c93e93a4)

## Changelog:

[INTERNAL] [FIXED] - Fixes js bundle failed

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

Test Plan: Enable FORCE_BUNDLING and build success.

Reviewed By: cipolleschi

Differential Revision: D59006962

Pulled By: blakef

fbshipit-source-id: 1142d1ddbae7346b67712fac0237950847211992
2024-06-26 11:57:50 +01:00
Riccardo Cipolleschi 865aaeda58 [LOCAL] Bump RC in testing script 2024-06-26 11:23:35 +02:00
Riccardo CipolleschiandGitHub 2a0c175135 [LOCAL][CI] Fix Helloworld ios jobs (#45158) 2024-06-26 10:22:02 +01:00
Nicola Corti 6a155dd1cf [LOCAL] Bump CLI to 14.0.0-alpha.11 2024-06-26 10:13:27 +01:00
Riccardo Cipolleschi 52db082576 [LOCAL][iOS] Bump Podfile.lock 2024-06-25 19:02:16 +02:00
React Native Bot 9120930288 Release 0.75.0-rc.1
#publish-packages-to-npm&next
2024-06-25 13:58:20 +00:00
Riccardo CipolleschiandGitHub c9f335a568 [LOCAL][Release-Testing] Update the testing script to use the new template (#45144)
* [LOCAL][Release-Testing] Update the testing script to use the new template

* Fix script
2024-06-25 13:55:02 +01:00
Riccardo CipolleschiandGitHub 38b1ddebd5 [LOCAL][RN][CI] Improve stability of the Hermes pipeline (#45142)
* [LOCAL][CI] Require cocoapods to hermes-engine podspec

* Refactor Hermes workspace (#45071)

Summary:
This change is the first step in refactoring GHA so that they can be reused more easily across jobs.
Its goal is also to be more reliable w.r.t. caches.

That this change do:
* moves `prepare_hermes_workspace` to a composite action
	* saves the `prepare_hermes_workspace` caches only on main
	* uploads the destination folder as an artifact so that we can use it later in the run
* makes the `test-all`, `nightly` and `publish-release` workflow use the new composite action
* updates the `setup-hermes-workspace` to download and use the artifact uploaded by `prepare_hermes_workspace`

[Internal] - Factor out the prepare_hermes_workspace action

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

Test Plan: GHA in CI

Reviewed By: cortinico

Differential Revision: D58808087

Pulled By: cipolleschi

fbshipit-source-id: 42c46bcf75fc73b2edfda9be62b5d0fe8a919a5d

* [LOCAL][RN][CI] Improve stability of the Hermes pipeline

* chore: align nighlties and releases to the test-all jobs which is green in GHA
2024-06-25 13:54:03 +01:00
Nicola Corti a300a2c057 [LOCAL] Bump CLI to 14.0.0-alpha.10 2024-06-25 13:52:18 +01:00
Riccardo CipolleschiandGitHub 1c0a4e72b1 [LOCAL][CI] Require cocoapods to hermes-engine podspec (#45134)
* [LOCAL][CI] Require cocoapods to hermes-engine podspec

* Refactor Hermes workspace (#45071)

Summary:
This change is the first step in refactoring GHA so that they can be reused more easily across jobs.
Its goal is also to be more reliable w.r.t. caches.

That this change do:
* moves `prepare_hermes_workspace` to a composite action
	* saves the `prepare_hermes_workspace` caches only on main
	* uploads the destination folder as an artifact so that we can use it later in the run
* makes the `test-all`, `nightly` and `publish-release` workflow use the new composite action
* updates the `setup-hermes-workspace` to download and use the artifact uploaded by `prepare_hermes_workspace`

[Internal] - Factor out the prepare_hermes_workspace action

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

Test Plan: GHA in CI

Reviewed By: cortinico

Differential Revision: D58808087

Pulled By: cipolleschi

fbshipit-source-id: 42c46bcf75fc73b2edfda9be62b5d0fe8a919a5d
2024-06-24 16:36:39 +01:00
Nicola Corti 50503b08f8 Back out "Add Float and Int type support for Android modules" (#45087)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/45087

Original commit changeset: 32b3bbdf5fd2

Fixes https://github.com/facebook/react-native/issues/44963
Closes https://github.com/facebook/react-native/pull/45024

Original Phabricator Diff: D52420921

Changelog:
[Internal] [Changed] - Back out "[RN][Codegen]Add Float and Int type support for Android  modules"

Reviewed By: dmytrorykun

Differential Revision: D58820544

fbshipit-source-id: 59cd0e7cc17a681785c57b5ce1a9d50d28a348af
2024-06-24 14:17:44 +01:00
Riccardo CipolleschiandGitHub 453e00a017 [RN][CI] Bump react-native CLI dependency to alpha.9 (#45123) 2024-06-24 13:02:41 +01:00
Riccardo CipolleschiandGitHub fafc71b5cb [LOCAL][RN][Tests] Fix JS tests for release (#45062) 2024-06-19 14:37:48 +01:00
React Native Bot 98b302e219 Release 0.75.0-rc.0
#publish-packages-to-npm&next
2024-06-19 10:03:08 +00:00
Nicola Corti 7aa3396f53 Revert "Release 0.75.0-rc.0"
This reverts commit 534fdc0005.
2024-06-19 11:01:46 +01:00
Nicola Corti fee2156642 [LOCAL] Fix build_android by setting git safe folders 2024-06-19 11:01:35 +01:00
React Native Bot 534fdc0005 Release 0.75.0-rc.0
#publish-packages-to-npm&next
2024-06-19 09:54:40 +00:00
Nicola Corti 609c7c05b1 [LOCAL] Fix handling of GITHUB_REF_NAME 2024-06-19 10:53:18 +01:00
Nicola Corti 5f11ed9e43 Revert "Release 0.75.0-rc.0"
This reverts commit 1d69fe9d23.
2024-06-19 10:51:17 +01:00
React Native Bot 1d69fe9d23 Release 0.75.0-rc.0
#publish-packages-to-npm&next
2024-06-19 09:42:02 +00:00
Nicola Corti 63d1a1e5eb [LOCAL] Add debugging info for GITHUB_REF 2024-06-19 10:39:53 +01:00
Riccardo Cipolleschi 6c1374e065 Revert "Release 0.75.0-rc.0"
This reverts commit abd96c21ec.
2024-06-19 10:37:38 +01:00
React Native Bot abd96c21ec Release 0.75.0-rc.0
#publish-packages-to-npm&next
2024-06-19 09:33:10 +00:00
Riccardo CipolleschiandGitHub 375c88478c [LOCAL][RN][CI] Fix release scripts to use GITHUB_REF and GITHUB_REF_NAME variables (#45057) 2024-06-19 10:32:04 +01:00
Nicola Corti daf9b29d05 Revert "Release 0.75.0-rc.0"
This reverts commit c2ebb30389.
2024-06-18 18:37:46 +01:00
React Native Bot c2ebb30389 Release 0.75.0-rc.0
#publish-packages-to-npm&next
2024-06-18 17:33:11 +00:00
Nicola Corti f4b1dd1fa1 [LOCAL] Configure git user before attempting to publish a release (#45039) 2024-06-18 18:31:53 +01:00
Nicola Corti a0c83803e8 Fix release regex for publish-release workflow (#45043)
Summary:
The existing regex is not workign. I've split it in two and tested it against a private repo.

## Changelog:

[INTERNAL] - Fix release regex for publish-release workflow

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

Test Plan: Tested on privare repo with GHA

Reviewed By: cipolleschi

Differential Revision: D58736292

Pulled By: cortinico

fbshipit-source-id: f07ef32dcb0059922100c555f7894bbf0c7dd8f6
2024-06-18 18:29:09 +01:00
Riccardo Cipolleschi 528097709a [LOCAL][RN][Release] Use github bot token to commit the tag 2024-06-18 18:27:47 +01:00
Riccardo Cipolleschi efa1e5375a Revert "Release 0.75.0-rc.0"
This reverts commit 1481140e68.
2024-06-18 17:14:43 +01:00
Riccardo Cipolleschi d524c151cd [CI][Release] remove publishing jobs from cci 2024-06-18 17:10:41 +01:00
React Native Bot 1481140e68 Release 0.75.0-rc.0
#publish-packages-to-npm&next
2024-06-18 16:01:33 +00:00
Nicola Corti 03591318fb [LOCAL] Fix double quotes for inputs.dry_run 2024-06-18 17:00:34 +01:00
Nicola Corti 56e1c8bfdd [LOCAL] Fix input types for create-release 2024-06-18 16:58:54 +01:00
Nicola CortiandGitHub 1b891357b2 [LOCAL] Configure git user before attempting to publish a release (#45039) 2024-06-18 16:51:54 +01:00
Riccardo CipolleschiandGitHub e36b46f0c9 [LOCAL][CI][Release] Forward inputs to Create Release composite action (#45038) 2024-06-18 16:46:49 +01:00
b236f9bd82 [LOCAL][RN][Release Testing] Update the testing script to run with the community template (#45033)
* [LOCAL][RN][Release Testing] Update the testing script to run with the community template

* fix prettier

---------

Co-authored-by: Nicola Corti <ncor@meta.com>
2024-06-18 16:23:08 +01:00
Nicola CortiandGitHub 44d4190581 [LOCAL] Disable test_js_e2e on the 0.75 release branch (#45022) 2024-06-18 11:16:56 +01:00
Riccardo CipolleschiandGitHub 88c136ed36 [LOCAL][RN][CI] Use bigger machines for Android Helloworld (#45020) 2024-06-18 10:53:46 +01:00
Blake FriedmanandRiccardo Cipolleschi e56d4f9528 remove the template from react-native package (#45008)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/45008

As part of RFC0759, we are moving the template into it's own repository.

- [Section in RFC0759](https://github.com/react-native-community/discussions-and-proposals/blob/main/proposals/0759-react-native-frameworks.md#evolving-the-react-native-community-template--cli)
- [Template's new home](https://github.com/react-native-community/template)
- [Versioning discussion](https://github.com/react-native-community/cli/issues/2345)

Changelog: [General][Breaking] removed the template from react-native into react-native-community/template

Reviewed By: cortinico

Differential Revision: D58184276

fbshipit-source-id: 5e52320af55495488587accbe144d11164cea4fd
2024-06-18 10:04:11 +01:00
Blake FriedmanandRiccardo Cipolleschi 20ca94b0d3 test_android_template → test_android_helloworld but disabled until template is removed (#44908)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/44908

Changelog: [General] [Changed] - CircleCI test to Helloworld, but disabled for now until we remove the template

Reviewed By: cipolleschi

Differential Revision: D58469912

fbshipit-source-id: 718a774946bd70347697f18bbfc470b2897d2f87
2024-06-18 10:02:48 +01:00
Nicola Corti 37e8fa113e Revert "Make the New Architecture the default (#43135)"
This reverts commit b9f3186ee6.
2024-06-17 14:32:59 +01:00
Nicola Corti 492a0c1292 Bump Hermes version 2024-06-17 14:27:43 +01:00
299 changed files with 68454 additions and 52212 deletions
+22 -21
View File
@@ -96,8 +96,6 @@ jobs:
- run:
name: "Run Tests: JavaScript Tests"
command: node ./scripts/run-ci-javascript-tests.js --maxWorkers 2
- run_e2e:
platform: js
# Optionally, run disabled tests
- when:
@@ -288,7 +286,10 @@ jobs:
- packages/react-native/ReactAndroid/hermes-engine/build/
- packages/react-native/ReactAndroid/src/main/jni/prebuilt/
- packages/react-native-gradle-plugin/.gradle/
- packages/react-native-gradle-plugin/build/
- packages/react-native-gradle-plugin/react-native-gradle-plugin/build/
- packages/react-native-gradle-plugin/settings-plugin/build/
- packages/react-native-gradle-plugin/shared/build/
- packages/react-native-gradle-plugin/shared-testutil/build/
- packages/react-native-codegen/lib/
# -------------------------
@@ -327,9 +328,9 @@ jobs:
destination: rntester-apk
# -------------------------
# JOBS: Test Android Template
# JOBS: Test Android HelloWorld
# -------------------------
test_android_template:
test_android_helloworld:
executor: reactnativeandroid-large
parameters:
flavor:
@@ -348,37 +349,37 @@ jobs:
type: enum
enum: ["Hermes", "JSC"]
environment:
- LC_ALL: C.UTF8
- PROJECT_NAME: "AndroidTemplateProject"
- YARN_ENABLE_IMMUTABLE_INSTALLS: false
- TARGET_ARCHITECTURE: "arm64-v8a"
steps:
- checkout_code_with_cache
- run_yarn
- attach_workspace:
at: .
- run:
name: Create Android template project
name: Build codegen js scripts from flow -> JS
command: |
REPO_ROOT=$(pwd)
node ./scripts/releases/update-template-package.js "{\"react-native\":\"file:$REPO_ROOT/build/$(cat build/react-native-package-version)\"}"
node ./scripts/e2e/init-template-e2e.js --projectName $PROJECT_NAME --templatePath "$REPO_ROOT/packages/react-native" --directory "/tmp/$PROJECT_NAME" --verbose
cd packages/react-native-codegen
yarn run build
- with_gradle_cache:
steps:
- run:
name: Build the template application for << parameters.flavor >> with Architecture set to << parameters.architecture >>, and using the << parameters.jsengine>> JS engine.
name: Build the Helloworld application for << parameters.flavor >> with Architecture set to << parameters.architecture >>, and using the << parameters.jsengine>> JS engine.
command: |
cd /tmp/$PROJECT_NAME/android/
if [[ << parameters.architecture >> == "NewArch" ]]; then
export ORG_GRADLE_PROJECT_newArchEnabled=true
else
export ORG_GRADLE_PROJECT_newArchEnabled=false
cd packages/helloworld/android
args=()
if [[ << parameters.architecture >> == "OldArch" ]]; then
args+=(--arch old)
fi
if [[ << parameters.jsengine >> == "Hermes" ]]; then
export ORG_GRADLE_PROJECT_hermesEnabled=true
else
export ORG_GRADLE_PROJECT_hermesEnabled=false
if [[ << parameters.jsengine >> == "JSC" ]]; then
args+=(--jsvm jsc)
fi
./gradlew assemble<< parameters.flavor >> -Preact.internal.mavenLocalRepo=/root/react-native/maven-local
if [[ << parameters.flavor >> == "Release" ]]; then
args+=(--prod)
fi
yarn build android "${args[@]}" -P reactNativeArchitectures="$TARGET_ARCHITECTURE"
- store_artifacts:
path: /tmp/AndroidTemplateProject/android/app/build/outputs/apk/
destination: template-apk
@@ -46,14 +46,16 @@
- test_android:
requires:
- build_android
- test_android_template:
requires:
- build_npm_package
matrix:
parameters:
architecture: ["NewArch", "OldArch"]
jsengine: ["Hermes", "JSC"]
flavor: ["Debug", "Release"]
## Disabled to land removing react-native/template. Re-enable once switched over
## to Helloworld.
# - test_android_template:
# requires:
# - build_npm_package
# matrix:
# parameters:
# architecture: ["NewArch", "OldArch"]
# jsengine: ["Hermes", "JSC"]
# flavor: ["Debug", "Release"]
- test_ios_helloworld:
requires:
- build_hermes_macos
@@ -43,15 +43,16 @@
- build_hermesc_linux
- build_hermes_macos
- build_hermesc_windows
- test_android:
requires:
- build_android
# - test_e2e_android
- test_android_template:
requires:
- build_npm_package
matrix:
parameters:
architecture: ["NewArch", "OldArch"]
jsengine: ["Hermes", "JSC"]
flavor: ["Debug", "Release"]
## Disabled to land removing react-native/template. Re-enable once switched over
## to Helloworld.
# - test_android:
# requires:
# - build_android
# - test_android_template:
# requires:
# - build_npm_package
# matrix:
# parameters:
# architecture: ["NewArch", "OldArch"]
# jsengine: ["Hermes", "JSC"]
# flavor: ["Debug", "Release"]
+1 -1
View File
@@ -61,7 +61,7 @@ references:
dependency_versions:
xcode_version: &xcode_version "15.2"
nodelts_image: &nodelts_image "cimg/node:20.2.0"
nodeprevlts_image: &nodeprevlts_image "cimg/node:18.12.1"
nodeprevlts_image: &nodeprevlts_image "cimg/node:18.18.2"
nodelts_browser_image: &nodelts_browser_image "cimg/node:20.2.0-browsers"
# -------------------------
-61
View File
@@ -15,67 +15,6 @@
workflows:
version: 2
# Release workflow, triggered by `yarn trigger-react-native-release`
create_release:
when: << pipeline.parameters.run_release_workflow >>
jobs:
- prepare_release:
name: prepare_release
version: << pipeline.parameters.release_version >>
monorepo_packages_version: << pipeline.parameters.release_monorepo_packages_version >>
tag: << pipeline.parameters.release_tag >>
dry_run: << pipeline.parameters.release_dry_run >>
# This job will run only when a tag is published due to all the jobs being filtered.
publish_release:
jobs:
- prepare_hermes_workspace:
filters: *only_release_tags
- build_android:
filters: *only_release_tags
name: build_android_for_release
release_type: "release"
- build_hermesc_linux:
filters: *only_release_tags
requires:
- prepare_hermes_workspace
- build_hermesc_apple:
filters: *only_release_tags
requires:
- prepare_hermes_workspace
- build_apple_slices_hermes:
filters: *only_release_tags
requires:
- build_hermesc_apple
matrix:
parameters:
flavor: ["Debug", "Release"]
slice: ["macosx", "iphoneos", "iphonesimulator", "catalyst"]
- build_hermesc_windows:
filters: *only_release_tags
requires:
- prepare_hermes_workspace
- build_hermes_macos:
filters: *only_release_tags
requires:
- build_apple_slices_hermes
matrix:
parameters:
flavor: ["Debug", "Release"]
# This job will trigger when a version tag is pushed (by package_release)
- build_npm_package:
name: build_and_publish_npm_package
release_type: "release"
filters: *only_release_tags
requires:
- build_android_for_release
- build_hermesc_linux
- build_hermes_macos
- build_hermesc_windows
- poll_maven:
requires:
- build_and_publish_npm_package
analysis:
when:
and:
+1 -1
View File
@@ -84,5 +84,5 @@ runs:
path: |
/tmp/hermes/download/
/tmp/hermes/hermes/
key: v1-hermes-${{ inputs.hermes-version }}-${{ github.run_number }}
key: v1-hermes-${{ inputs.hermes-version }}
enableCrossOsArchive: true
+18 -2
View File
@@ -1,11 +1,27 @@
name: create_release
description: Creates a new React Native release
inputs:
version:
description: "The version of React Native we want to release. For example 0.75.0-rc.0"
required: true
is_latest_on_npm:
description: "Whether we want to tag this release as latest on NPM"
required: true
default: "false"
dry_run:
description: "Whether the job should be executed in dry-run mode or not"
default: "false"
runs:
using: composite
steps:
- name: Yarn install
shell: bash
run: yarn install --non-interactive
- name: Configure Git
shell: bash
run: |
git config --local user.email "bot@reactnative.dev"
git config --local user.name "React Native Bot"
- name: Creating release commit
shell: bash
run: |
@@ -16,14 +32,14 @@ runs:
GIT_PAGER=cat git show HEAD
- name: Update "latest" tag if needed
shell: bash
if: ${{ inputs.tag == 'latest' }}
if: ${{ inputs.is_latest_on_npm == 'true' }}
run: |
git tag -d "latest"
git push origin :latest
git tag -a "latest" -m "latest"
- name: Pushing release commit
shell: bash
if: ${{ inputs.dry_run == false }}
if: ${{ inputs.dry_run == 'false' }}
run: |
CURR_BRANCH="$(git branch --show-current)"
git push origin "$CURR_BRANCH" --follow-tags
@@ -0,0 +1,104 @@
name: prepare-hermes-workspace
description: This action prepares the hermes workspace with the right hermes and react-native versions.
inputs:
HERMES_WS_DIR:
required: true
description: The hermes dir we need to use to setup the workspace
HERMES_VERSION_FILE:
required: true
description: the path to the file that will contain the hermes version
BUILD_FROM_SOURCE:
description: Whether we need to build from source or not
default: true
outputs:
hermes-version:
description: the version of Hermes tied to this run
value: ${{ steps.hermes-version.outputs.VERSION }}
react-native-version:
description: the version of React Native tied to this run
value: ${{ steps.react-native-version.outputs.VERSION }}
runs:
using: composite
steps:
- name: Setup node.js
uses: ./.github/actions/setup-node
- name: Setup hermes version
shell: bash
id: hermes-version
run: |
mkdir -p "/tmp/hermes" "/tmp/hermes/download" "/tmp/hermes/hermes"
if [ -f "$HERMES_VERSION_FILE" ]; then
echo "Hermes Version file found! Using this version for the build:"
echo "VERSION=$(cat $HERMES_VERSION_FILE)" >> "$GITHUB_OUTPUT"
else
echo "Hermes Version file not found!!!"
echo "Using the last commit from main for the build:"
HERMES_TAG_SHA=$(git ls-remote https://github.com/facebook/hermes main | cut -f 1 | tr -d '[:space:]')
echo "VERSION=$HERMES_TAG_SHA" >> "$GITHUB_OUTPUT"
fi
echo "Hermes commit is $HERMES_TAG_SHA"
- name: Get react-native version
shell: bash
id: react-native-version
run: |
VERSION=$(cat packages/react-native/package.json | jq -r '.version')
# Save the react native version we are building in an output variable so we can use that file as part of the cache key.
echo "VERSION=$VERSION" >> "$GITHUB_OUTPUT"
echo "React Native Version is $VERSION"
- name: Cache hermes workspace
id: restore-hermes
uses: actions/cache/restore@v4.0.0
with:
path: |
/tmp/hermes/download/
/tmp/hermes/hermes/
key: v1-hermes-${{ steps.hermes-version.outputs.version }}
enableCrossOsArchive: true
# It happened while testing that a cache was created from the right folders
# but those folders where empty. Thus, the next check ensures that we can work with those caches.
- name: Check if cache was meaningful
id: meaningful-cache
shell: bash
run: |
if [[ -d /tmp/hermes/hermes ]] && [[ -n "$(ls -A /tmp/hermes/hermes)" ]]; then
echo "Found a good hermes cache"
echo "HERMES_CACHED=true" >> "$GITHUB_OUTPUT"
fi
- name: Yarn- Install Dependencies
if: ${{ steps.meaningful-cache.outputs.HERMES_CACHED != 'true' }}
shell: bash
run: yarn install --non-interactive
- name: Download Hermes tarball
if: ${{ steps.meaningful-cache.outputs.HERMES_CACHED != 'true' }}
shell: bash
run: |
node packages/react-native/scripts/hermes/prepare-hermes-for-build ${{ github.event.pull_request.html_url }}
cp packages/react-native/sdks/download/* $HERMES_WS_DIR/download/.
cp -r packages/react-native/sdks/hermes/* $HERMES_WS_DIR/hermes/.
echo ${{ steps.hermes-version.outputs.version }}
- name: Upload Hermes artifact
uses: actions/upload-artifact@v4.3.1
with:
name: hermes-workspace
path: |
/tmp/hermes/download/
/tmp/hermes/hermes/
- name: Cache hermes workspace
uses: actions/cache/save@v4.0.0
if: ${{ github.ref == 'refs/heads/main' }} # To avoid that the cache explode.
with:
path: |
/tmp/hermes/download/
/tmp/hermes/hermes/
key: v1-hermes-${{ steps.hermes-version.outputs.version }}
enableCrossOsArchive: true
@@ -1,8 +1,13 @@
name: setup_hermes_workspace
description: "Setup hermes workspace"
name: restore-hermes-workspace
description: "Restore hermes workspace that has been created in Prepare Hermes Workspace"
runs:
using: composite
steps:
- name: Download Previous Artifacts
uses: actions/download-artifact@v4
with:
name: hermes-workspace
path: /tmp/hermes
- name: Set up workspace
shell: bash
run: |
+22 -7
View File
@@ -45,17 +45,20 @@ runs:
uses: ./.github/actions/setup-xcode
- name: Setup node.js
uses: ./.github/actions/setup-node
- name: Cache setup
id: cache_setup
uses: ./.github/actions/cache_setup
- name: Create Hermes folder
shell: bash
run: mkdir -p "$HERMES_WS_DIR"
- name: Download Hermes
uses: actions/download-artifact@v4
with:
hermes-version: ${{ inputs.hermes-version }}
react-native-version: ${{ inputs.react-native-version }}
name: hermes-darwin-bin-${{ inputs.flavor }}
path: /tmp/hermes/hermes-runtime-darwin/
- name: Print Downloaded hermes
shell: bash
run: ls -lR "$HERMES_WS_DIR"
- name: Run yarn
shell: bash
run: yarn install --non-interactive
- name: Setup Hermes workspace
uses: ./.github/actions/setup_hermes_workspace
- name: Setup ruby
uses: ruby/setup-ruby@v1.170.0
with:
@@ -78,6 +81,17 @@ runs:
args+=(--jsvm jsc)
yarn bootstrap ios "${args[@]}" | cat
else
# Tarball is restored with capital flavors suffix, but somehow the tarball name from JS at line 96 returns as lowercased.
# Let's ensure that the tarballs have the right names
if [[ -f "$HERMES_WS_DIR/hermes-runtime-darwin/hermes-ios-Debug.tar.gz" ]]; then
mv "$HERMES_WS_DIR/hermes-runtime-darwin/hermes-ios-Debug.tar.gz" "$HERMES_WS_DIR/hermes-runtime-darwin/hermes-ios-debug.tar.gz"
fi
if [[ -f "$HERMES_WS_DIR/hermes-runtime-darwin/hermes-ios-Release.tar.gz" ]]; then
mv "$HERMES_WS_DIR/hermes-runtime-darwin/hermes-ios-Release.tar.gz" "$HERMES_WS_DIR/hermes-runtime-darwin/hermes-ios-release.tar.gz"
fi
BUILD_TYPE="${{ inputs.flavor }}"
TARBALL_FILENAME=$(node ../react-native/scripts/hermes/get-tarball-name.js --buildType "$BUILD_TYPE")
HERMES_PATH="$HERMES_WS_DIR/hermes-runtime-darwin/$TARBALL_FILENAME"
@@ -87,6 +101,7 @@ runs:
shell: bash
run: |
cd packages/helloworld
args=()
if [[ ${{ inputs.flavor }} == "Release" ]]; then
args+=(--prod)
+7 -7
View File
@@ -38,12 +38,11 @@ runs:
- name: Run yarn
shell: bash
run: yarn install --non-interactive
- name: Cache setup
id: cache_setup
uses: ./.github/actions/cache_setup
- name: Download Hermes
uses: actions/download-artifact@v4
with:
hermes-version: ${{ inputs.hermes-version }}
react-native-version: ${{ inputs.react-native-version }}
name: hermes-darwin-bin-${{ inputs.flavor }}
path: ${{ inputs.hermes-tarball-artifacts-dir }}
- name: Setup ruby
uses: ruby/setup-ruby@v1.170.0
with:
@@ -82,6 +81,7 @@ runs:
if [[ -e $TARBALL_PATH ]]; then
tar -xf $TARBALL_PATH
echo 'print(HermesInternal?.getRuntimeProperties?.()["OSS Release Version"])' > test.js
chmod +x ./destroot/bin/hermes
./destroot/bin/hermes test.js
rm test.js
rm -rf destroot
@@ -134,7 +134,7 @@ runs:
XCRESULT_PATH=$(find . -name '*.xcresult')
tar -zcvf xcresults.tar.gz $XCRESULT_PATH
- name: Upload artifact
uses: actions/upload-artifact@v2.2.4
uses: actions/upload-artifact@v4.3.1
if: ${{ inputs.run-unit-tests == true }}
with:
name: xcresults
@@ -146,7 +146,7 @@ runs:
platform: ios
- name: Store test results
if: ${{ inputs.run-unit-tests == true }}
uses: actions/upload-artifact@v2.2.4
uses: actions/upload-artifact@v4.3.1
with:
name: test-results
path: ./reports/junit
+9 -1
View File
@@ -18,11 +18,15 @@ on:
default: false
jobs:
prepare_release:
create_release:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4.1.1
with:
token: ${{ secrets.REACT_NATIVE_BOT_GITHUB_TOKEN }}
fetch-tags: 'true'
fetch-depth: 0
- name: Check if on stable branch
id: check_stable_branch
run: |
@@ -46,3 +50,7 @@ jobs:
- name: Execute Prepare Release
if: ${{ steps.check_stable_branch.outputs.ON_STABLE_BRANCH && !steps.check_if_tag_exists.outputs.TAG_EXISTS }}
uses: ./.github/actions/create-release
with:
version: ${{ inputs.version }}
is_latest_on_npm: ${{ inputs.is_latest_on_npm }}
dry_run: ${{ inputs.dry_run }}
+156 -146
View File
@@ -28,54 +28,19 @@ jobs:
HERMES_WS_DIR: /tmp/hermes
HERMES_VERSION_FILE: packages/react-native/sdks/.hermesversion
BUILD_FROM_SOURCE: true
GRADLE_OPTS: '-Dorg.gradle.daemon=false'
outputs:
react-native-version: ${{ steps.react-native-version.outputs.version }}
hermes-version: ${{ steps.hermes-version.outputs.version }}
react-native-version: ${{ steps.prepare-hermes-workspace.outputs.react-native-version }}
hermes-version: ${{ steps.prepare-hermes-workspace.outputs.hermes-version }}
steps:
- name: Checkout
uses: actions/checkout@v4.1.1
- name: Setup node.js
uses: ./.github/actions/setup-node
- name: Setup hermes version
id: hermes-version
run: |
mkdir -p "/tmp/hermes" "/tmp/hermes/download" "/tmp/hermes/hermes"
if [ -f "$HERMES_VERSION_FILE" ]; then
echo "Hermes Version file found! Using this version for the build:"
echo "VERSION=$(cat $HERMES_VERSION_FILE)" >> "$GITHUB_OUTPUT"
else
echo "Hermes Version file not found!!!"
echo "Using the last commit from main for the build:"
HERMES_TAG_SHA=$(git ls-remote https://github.com/$GITHUB_REPOSITORY main | cut -f 1 | tr -d '[:space:]')
echo "VERSION=$HERMES_TAG_SHA" >> "$GITHUB_OUTPUT"
fi
echo "Hermes commit is $HERMES_TAG_SHA"
- name: Get react-native version
id: react-native-version
run: |
VERSION=$(cat packages/react-native/package.json | jq -r '.version')
# Save the react native version we are building in an output variable so we can use that file as part of the cache key.
echo "VERSION=$VERSION" >> "$GITHUB_OUTPUT"
echo "React Native Version is $VERSION"
- name: Cache hermes workspace
uses: actions/cache@v4.0.0
- name: Prepare Hermes Workspace
id: prepare-hermes-workspace
uses: ./.github/actions/prepare-hermes-workspace
with:
path: |
/tmp/hermes/download/
/tmp/hermes/hermes/
key: v1-hermes-${{ steps.hermes-version.outputs.version }}-${{ github.run_number }}
enableCrossOsArchive: true
- name: Yarn- Install Dependencies
run: yarn install --non-interactive
- name: Download Hermes tarball
run: |
node packages/react-native/scripts/hermes/prepare-hermes-for-build ${{ github.event.pull_request.html_url }}
cp packages/react-native/sdks/download/* $HERMES_WS_DIR/download/.
cp -r packages/react-native/sdks/hermes/* $HERMES_WS_DIR/hermes/.
echo ${{ steps.hermes-version.outputs.version }}
HERMES_WS_DIR: ${{ env.HERMES_WS_DIR }}
HERMES_VERSION_FILE: ${{ env.HERMES_VERSION_FILE }}
BUILD_FROM_SOURCE: ${{ env.BUILD_FROM_SOURCE }}
build_hermesc_apple:
runs-on: macos-13
@@ -86,18 +51,10 @@ jobs:
steps:
- name: Checkout
uses: actions/checkout@v4.1.1
- name: Cache hermes workspace
uses: actions/cache@v4.0.0
with:
path: |
/tmp/hermes/download/
/tmp/hermes/hermes/
key: v1-hermes-${{ needs.prepare_hermes_workspace.outputs.hermes-version }}-${{ github.run_number }}
enableCrossOsArchive: true
- name: Setup Hermes workspace
uses: ./.github/actions/setup_hermes_workspace
- name: Restore Hermes workspace
uses: ./.github/actions/restore-hermes-workspace
- name: Hermes apple cache
uses: actions/cache@v4.0.0
uses: actions/cache/restore@v4.0.0
with:
path: ./packages/react-native/sdks/hermes/build_host_hermesc
key: v2-hermesc-apple-${{ needs.prepare_hermes_workspace.outputs.hermes-version }}-${{ needs.prepare_hermes_workspace.outputs.react-native-version }}
@@ -106,6 +63,18 @@ jobs:
cd ./packages/react-native/sdks/hermes || exit 1
. ./utils/build-apple-framework.sh
build_host_hermesc_if_needed
- name: Upload HermesC Artifact
uses: actions/upload-artifact@v4.3.1
with:
name: hermesc-apple
path: ./packages/react-native/sdks/hermes/build_host_hermesc
- name: Cache hermesc apple
uses: actions/cache/save@v4.0.0
if: ${{ github.ref == 'refs/heads/main' || contains(github.ref, '-stable') }} # To avoid that the cache explode.
with:
path: ./packages/react-native/sdks/hermes/build_host_hermesc
key: v2-hermesc-apple-${{ needs.prepare_hermes_workspace.outputs.hermes-version }}-${{ needs.prepare_hermes_workspace.outputs.react-native-version }}
enableCrossOsArchive: true
build_apple_slices_hermes:
runs-on: macos-14
@@ -114,6 +83,9 @@ jobs:
HERMES_WS_DIR: /tmp/hermes
HERMES_TARBALL_ARTIFACTS_DIR: /tmp/hermes/hermes-runtime-darwin
HERMES_OSXBIN_ARTIFACTS_DIR: /tmp/hermes/osx-bin
IOS_DEPLOYMENT_TARGET: "13.4"
XROS_DEPLOYMENT_TARGET: "1.0"
MAC_DEPLOYMENT_TARGET: "10.15"
continue-on-error: true
strategy:
fail-fast: false
@@ -125,33 +97,20 @@ jobs:
uses: actions/checkout@v4.1.1
- name: Setup xcode
uses: ./.github/actions/setup-xcode
- name: Cache setup
id: cache_setup
uses: ./.github/actions/cache_setup
- name: Restore Hermes workspace
uses: ./.github/actions/restore-hermes-workspace
- name: Restore HermesC Artifact
uses: actions/download-artifact@v4.1.3
with:
hermes-version: ${{ needs.prepare_hermes_workspace.outputs.hermes-version }}
react-native-version: ${{ needs.prepare_hermes_workspace.outputs.react-native-version }}
- name: Setup Hermes workspace
uses: ./.github/actions/setup_hermes_workspace
- name: Check if the required artifacts already exist
id: check_if_apple_artifacts_are_there
run: |
FLAVOR="${{ matrix.flavor }}"
echo "Flavor is $FLAVOR"
OSX_BIN="/tmp/hermes/osx-bin/$FLAVOR"
DSYM="/tmp/hermes/dSYM/$FLAVOR"
HERMES="/tmp/hermes/hermes-runtime-darwin/hermes-ios-$FLAVOR.tar.gz"
if [[ -d "$OSX_BIN" ]] && \
[[ -d "$DSYM" ]] && \
[[ -f "$HERMES" ]]; then
echo "Artifacts are there!"
echo "ARTIFACTS_EXIST=true" >> $GITHUB_ENV
echo "ARTIFACTS_EXIST=true" >> $GITHUB_OUTPUT
fi
name: hermesc-apple
path: ./packages/react-native/sdks/hermes/build_host_hermesc
- name: Restore Slice From Cache
id: restore-slice-cache
uses: actions/cache/restore@v4.0.0
with:
path: ./packages/react-native/sdks/hermes/build_${{ matrix.slice }}_${{ matrix.flavor }}
key: v5-hermes-apple-${{ needs.prepare_hermes_workspace.outputs.hermes-version }}-${{ needs.prepare_hermes_workspace.outputs.react-native-version }}-${{ hashfiles('packages/react-native/sdks/hermes-engine/utils/build-apple-framework.sh') }}-${{ matrix.slice }}-${{ matrix.flavor }}
- name: Build the Hermes ${{ matrix.slice }} frameworks
if: ${{ steps.check_if_apple_artifacts_are_there.outputs.ARTIFACTS_EXIST != true }}
run: |
cd ./packages/react-native/sdks/hermes || exit 1
SLICE=${{ matrix.slice }}
@@ -169,11 +128,20 @@ jobs:
exit 0
fi
export RELEASE_VERSION=${{ needs.prepare_hermes_workspace.outputs.react-native-version }}
# HermesC is used to build hermes, so it has to be executable
chmod +x ./build_host_hermesc/bin/hermesc
if [[ "$SLICE" == "macosx" ]]; then
echo "[HERMES] Building Hermes for MacOS"
chmod +x ./utils/build-mac-framework.sh
BUILD_TYPE="${{ matrix.flavor }}" ./utils/build-mac-framework.sh
else
echo "[HERMES] Building Hermes for iOS: $SLICE"
chmod +x ./utils/build-ios-framework.sh
BUILD_TYPE="${{ matrix.flavor }}" ./utils/build-ios-framework.sh "$SLICE"
fi
@@ -195,12 +163,21 @@ jobs:
echo "Please try again"
exit 1
fi
- name: Compress slices to preserve Symlinks
run: |
cd ./packages/react-native/sdks/hermes
tar -czv -f build_${{ matrix.slice }}_${{ matrix.flavor }}.tar.gz build_${{ matrix.slice }}_${{ matrix.flavor }}
- name: Upload Artifact for Slice (${{ matrix.slice }}, ${{ matrix.flavor }}}
uses: actions/upload-artifact@v4.3.1
with:
name: slice-${{ matrix.slice }}-${{ matrix.flavor }}
path: ./packages/react-native/sdks/hermes/build_${{ matrix.slice }}_${{ matrix.flavor }}.tar.gz
- name: Save slice cache
if: ${{ steps.check_if_apple_artifacts_are_there.outputs.ARTIFACTS_EXIST != true }}
uses: actions/cache@v4.0.0
if: ${{ github.ref == 'refs/heads/main' || contains(github.ref, '-stable') }} # To avoid that the cache explode.
uses: actions/cache/save@v4.0.0
with:
path: ./packages/react-native/sdks/hermes/build_${{ matrix.slice }}_${{ matrix.flavor }}
key: v4-hermes-apple-${{ needs.prepare_hermes_workspace.outputs.hermes-version }}-${{ needs.prepare_hermes_workspace.outputs.react-native-version }}-${{ hashfiles('packages/react-native/sdks/hermes-engine/utils/build-apple-framework.sh') }}-${{ matrix.slice }}-${{ matrix.flavor }}
key: v5-hermes-apple-${{ needs.prepare_hermes_workspace.outputs.hermes-version }}-${{ needs.prepare_hermes_workspace.outputs.react-native-version }}-${{ hashfiles('packages/react-native/sdks/hermes-engine/utils/build-apple-framework.sh') }}-${{ matrix.slice }}-${{ matrix.flavor }}
build_hermes_macos:
runs-on: macos-13
@@ -220,14 +197,16 @@ jobs:
uses: ./.github/actions/setup-xcode
- name: Setup node.js
uses: ./.github/actions/setup-node
- name: Cache setup
id: cache_setup
uses: ./.github/actions/cache_setup
- name: Restore Hermes workspace
uses: ./.github/actions/restore-hermes-workspace
- name: Restore Cached Artifacts
uses: actions/cache/restore@v4.0.0
with:
hermes-version: ${{ needs.prepare_hermes_workspace.outputs.hermes-version }}
react-native-version: ${{ needs.prepare_hermes_workspace.outputs.react-native-version }}
- name: Setup Hermes workspace
uses: ./.github/actions/setup_hermes_workspace
key: v3-hermes-artifacts-${{ matrix.flavor }}-${{ needs.prepare_hermes_workspace.outputs.hermes-version }}-${{ needs.prepare_hermes_workspace.outputs.react-native-version }}
path: |
/tmp/hermes/osx-bin/${{ matrix.flavor }}
/tmp/hermes/dSYM/${{ matrix.flavor }}
/tmp/hermes/hermes-runtime-darwin/hermes-ios-${{ matrix.flavor }}.tar.gz
- name: Check if the required artifacts already exist
id: check_if_apple_artifacts_are_there
run: |
@@ -246,46 +225,57 @@ jobs:
echo "ARTIFACTS_EXIST=true" >> $GITHUB_OUTPUT
fi
- name: Yarn- Install Dependencies
if: ${{ ! contains(github.event.head_commit.message, 'Bump metro@') && steps.check_if_apple_artifacts_are_there.outputs.ARTIFACTS_EXIST != true }}
if: ${{ steps.check_if_apple_artifacts_are_there.outputs.ARTIFACTS_EXIST != 'true' }}
run: yarn install --non-interactive
- name: Slice cache macosx
if: ${{ steps.check_if_apple_artifacts_are_there.outputs.ARTIFACTS_EXIST != true }}
uses: actions/cache@v4.0.0
if: ${{ steps.check_if_apple_artifacts_are_there.outputs.ARTIFACTS_EXIST != 'true' }}
uses: actions/download-artifact@v4.1.3
with:
path: ./packages/react-native/sdks/hermes/build_macosx_${{ matrix.flavor }}
key: v4-hermes-apple-${{ needs.prepare_hermes_workspace.outputs.hermes-version }}-${{ needs.prepare_hermes_workspace.outputs.react-native-version }}-${{ hashfiles('packages/react-native/sdks/hermes-engine/utils/build-apple-framework.sh') }}-macosx-${{ matrix.flavor }}
path: ./packages/react-native/sdks/hermes/
name: slice-macosx-${{ matrix.flavor }}
- name: Slice cache iphoneos
if: ${{ steps.check_if_apple_artifacts_are_there.outputs.ARTIFACTS_EXIST != true }}
uses: actions/cache@v4.0.0
if: ${{ steps.check_if_apple_artifacts_are_there.outputs.ARTIFACTS_EXIST != 'true' }}
uses: actions/download-artifact@v4.1.3
with:
path: ./packages/react-native/sdks/hermes/build_iphoneos_${{ matrix.flavor }}
key: v4-hermes-apple-${{ needs.prepare_hermes_workspace.outputs.hermes-version }}-${{ needs.prepare_hermes_workspace.outputs.react-native-version }}-${{ hashfiles('packages/react-native/sdks/hermes-engine/utils/build-apple-framework.sh') }}-iphoneos-${{ matrix.flavor }}
path: ./packages/react-native/sdks/hermes/
name: slice-iphoneos-${{ matrix.flavor }}
- name: Slice cache iphonesimulator
if: ${{ steps.check_if_apple_artifacts_are_there.outputs.ARTIFACTS_EXIST != true }}
uses: actions/cache@v4.0.0
if: ${{ steps.check_if_apple_artifacts_are_there.outputs.ARTIFACTS_EXIST != 'true' }}
uses: actions/download-artifact@v4.1.3
with:
path: ./packages/react-native/sdks/hermes/build_iphonesimulator_${{ matrix.flavor }}
key: v4-hermes-apple-${{ needs.prepare_hermes_workspace.outputs.hermes-version }}-${{ needs.prepare_hermes_workspace.outputs.react-native-version }}-${{ hashfiles('packages/react-native/sdks/hermes-engine/utils/build-apple-framework.sh') }}-iphonesimulator-${{ matrix.flavor }}
path: ./packages/react-native/sdks/hermes/
name: slice-iphonesimulator-${{ matrix.flavor }}
- name: Slice cache catalyst
if: ${{ steps.check_if_apple_artifacts_are_there.outputs.ARTIFACTS_EXIST != true }}
uses: actions/cache@v4.0.0
if: ${{ steps.check_if_apple_artifacts_are_there.outputs.ARTIFACTS_EXIST != 'true' }}
uses: actions/download-artifact@v4.1.3
with:
path: ./packages/react-native/sdks/hermes/build_catalyst_${{ matrix.flavor }}
key: v4-hermes-apple-${{ needs.prepare_hermes_workspace.outputs.hermes-version }}-${{ needs.prepare_hermes_workspace.outputs.react-native-version }}-${{ hashfiles('packages/react-native/sdks/hermes-engine/utils/build-apple-framework.sh') }}-catalyst-${{ matrix.flavor }}
path: ./packages/react-native/sdks/hermes/
name: slice-catalyst-${{ matrix.flavor }}
- name: Slice cache xros
if: ${{ steps.check_if_apple_artifacts_are_there.outputs.ARTIFACTS_EXIST != true }}
uses: actions/cache@v4.0.0
if: ${{ steps.check_if_apple_artifacts_are_there.outputs.ARTIFACTS_EXIST != 'true' }}
uses: actions/download-artifact@v4.1.3
with:
path: ./packages/react-native/sdks/hermes/build_xros_${{ matrix.flavor }}
key: v4-hermes-apple-${{ needs.prepare_hermes_workspace.outputs.hermes-version }}-${{ needs.prepare_hermes_workspace.outputs.react-native-version }}-${{ hashfiles('packages/react-native/sdks/hermes-engine/utils/build-apple-framework.sh') }}-xros-${{ matrix.flavor }}
path: ./packages/react-native/sdks/hermes/
name: slice-xros-${{ matrix.flavor }}
- name: Slice cache xrsimulator
if: ${{ steps.check_if_apple_artifacts_are_there.outputs.ARTIFACTS_EXIST != true }}
uses: actions/cache@v4.0.0
if: ${{ steps.check_if_apple_artifacts_are_there.outputs.ARTIFACTS_EXIST != 'true' }}
uses: actions/download-artifact@v4.1.3
with:
path: ./packages/react-native/sdks/hermes/build_xrsimulator_${{ matrix.flavor }}
key: v4-hermes-apple-${{ needs.prepare_hermes_workspace.outputs.hermes-version }}-${{ needs.prepare_hermes_workspace.outputs.react-native-version }}-${{ hashfiles('packages/react-native/sdks/hermes-engine/utils/build-apple-framework.sh') }}-xrsimulator-${{ matrix.flavor }}
path: ./packages/react-native/sdks/hermes/
name: slice-xrsimulator-${{ matrix.flavor }}
- name: Unzip slices
if: ${{ steps.check_if_apple_artifacts_are_there.outputs.ARTIFACTS_EXIST != 'true' }}
run: |
cd ./packages/react-native/sdks/hermes
ls -l .
tar -xzv -f build_catalyst_${{ matrix.flavor }}.tar.gz
tar -xzv -f build_iphoneos_${{ matrix.flavor }}.tar.gz
tar -xzv -f build_iphonesimulator_${{ matrix.flavor }}.tar.gz
tar -xzv -f build_macosx_${{ matrix.flavor }}.tar.gz
tar -xzv -f build_xros_${{ matrix.flavor }}.tar.gz
tar -xzv -f build_xrsimulator_${{ matrix.flavor }}.tar.gz
- name: Move back build folders
if: ${{ steps.check_if_apple_artifacts_are_there.outputs.ARTIFACTS_EXIST != true }}
if: ${{ steps.check_if_apple_artifacts_are_there.outputs.ARTIFACTS_EXIST != 'true' }}
run: |
ls -l ./packages/react-native/sdks/hermes
cd ./packages/react-native/sdks/hermes || exit 1
@@ -296,19 +286,23 @@ jobs:
mv build_xros_${{ matrix.flavor }} build_xros
mv build_xrsimulator_${{ matrix.flavor }} build_xrsimulator
- name: Prepare destroot folder
if: ${{ steps.check_if_apple_artifacts_are_there.outputs.ARTIFACTS_EXIST != true }}
if: ${{ steps.check_if_apple_artifacts_are_there.outputs.ARTIFACTS_EXIST != 'true' }}
run: |
cd ./packages/react-native/sdks/hermes || exit 1
chmod +x ./utils/build-apple-framework.sh
. ./utils/build-apple-framework.sh
prepare_dest_root_for_ci
- name: Create fat framework for iOS
if: ${{ steps.check_if_apple_artifacts_are_there.outputs.ARTIFACTS_EXIST != true }}
if: ${{ steps.check_if_apple_artifacts_are_there.outputs.ARTIFACTS_EXIST != 'true' }}
run: |
cd ./packages/react-native/sdks/hermes || exit 1
echo "[HERMES] Creating the universal framework"
chmod +x ./utils/build-ios-framework.sh
./utils/build-ios-framework.sh build_framework
chmod +x ./destroot/bin/hermesc
- name: Package the Hermes Apple frameworks
if: ${{ steps.check_if_apple_artifacts_are_there.outputs.ARTIFACTS_EXIST != true }}
if: ${{ steps.check_if_apple_artifacts_are_there.outputs.ARTIFACTS_EXIST != 'true' }}
run: |
BUILD_TYPE="${{ matrix.flavor }}"
echo "Packaging Hermes Apple frameworks for $BUILD_TYPE build type"
@@ -332,18 +326,8 @@ jobs:
mkdir -p /tmp/hermes/osx-bin/${{ matrix.flavor }}
cp ./packages/react-native/sdks/hermes/build_macosx/bin/* /tmp/hermes/osx-bin/${{ matrix.flavor }}
ls -lR /tmp/hermes/osx-bin/
- name: Upload darwin artifacts
uses: actions/upload-artifact@v4.3.1
with:
name: hermes-darwin-bin-${{ matrix.flavor }}
path: /tmp/hermes/hermes-runtime-darwin
- name: Upload osx-bin
uses: actions/upload-artifact@v4.3.1
with:
name: hermes-osx-bin-${{ matrix.flavor }}
path: /tmp/hermes/osx-bin
- name: Create dSYM archive
if: ${{ steps.check_if_apple_artifacts_are_there.outputs.ARTIFACTS_EXIST != true }}
if: ${{ steps.check_if_apple_artifacts_are_there.outputs.ARTIFACTS_EXIST != 'true' }}
run: |
FLAVOR=${{ matrix.flavor }}
WORKING_DIR="/tmp/hermes_tmp/dSYM/$FLAVOR"
@@ -375,10 +359,32 @@ jobs:
with:
name: hermes-dSYM-${{ matrix.flavor }}
path: /tmp/hermes/dSYM/${{ matrix.flavor }}
- name: Upload hermes Runtime artifacts
uses: actions/upload-artifact@v4.3.1
with:
name: hermes-darwin-bin-${{ matrix.flavor }}
path: /tmp/hermes/hermes-runtime-darwin/hermes-ios-${{ matrix.flavor }}.tar.gz
- name: Upload hermes osx artifacts
uses: actions/upload-artifact@v4.3.1
with:
name: hermes-osx-bin-${{ matrix.flavor }}
path: /tmp/hermes/osx-bin/${{ matrix.flavor }}
- name: Upload Hermes Artifacts
uses: actions/cache/save@v4.0.0
if: ${{ github.ref == 'refs/heads/main' || contains(github.ref, '-stable') }} # To avoid that the cache explode.
with:
key: v3-hermes-artifacts-${{ matrix.flavor }}-${{ needs.prepare_hermes_workspace.outputs.hermes-version }}-${{ needs.prepare_hermes_workspace.outputs.react-native-version }}
path: |
/tmp/hermes/osx-bin/${{ matrix.flavor }}
/tmp/hermes/dSYM/${{ matrix.flavor }}
/tmp/hermes/hermes-runtime-darwin/hermes-ios-${{ matrix.flavor }}.tar.gz
build_hermesc_linux:
runs-on: ubuntu-latest
needs: prepare_hermes_workspace
env:
HERMES_WS_DIR: /tmp/hermes
HERMES_TARBALL_ARTIFACTS_DIR: /tmp/hermes/hermes-runtime-darwin
steps:
- name: Checkout
uses: actions/checkout@v4.1.1
@@ -387,12 +393,8 @@ jobs:
sudo apt update
sudo apt install -y git openssh-client cmake build-essential \
libreadline-dev libicu-dev jq zip python3
- name: Cache setup
id: cache_setup
uses: ./.github/actions/cache_setup
with:
hermes-version: ${{ needs.prepare_hermes_workspace.outputs.hermes-version }}
react-native-version: ${{ needs.prepare_hermes_workspace.outputs.react-native-version }}
- name: Restore Hermes workspace
uses: ./.github/actions/restore-hermes-workspace
- name: Linux cache
uses: actions/cache@v4.0.0
with:
@@ -416,7 +418,7 @@ jobs:
cp /tmp/hermes/build/bin/hermesc /tmp/hermes/linux64-bin/.
fi
- name: Upload linux artifacts
uses: actions/upload-artifact@v4.3.0
uses: actions/upload-artifact@v4.3.1
with:
name: hermes-linux-bin
path: /tmp/hermes/linux64-bin
@@ -426,18 +428,25 @@ jobs:
needs: prepare_hermes_workspace
env:
HERMES_WS_DIR: 'D:\tmp\hermes'
HERMES_TARBALL_ARTIFACTS_DIR: 'D:\tmp\hermes\hermes-runtime-darwin'
HERMES_OSXBIN_ARTIFACTS_DIR: 'D:\tmp\hermes\osx-bin'
ICU_URL: "https://github.com/unicode-org/icu/releases/download/release-64-2/icu4c-64_2-Win64-MSVC2017.zip"
MSBUILD_DIR: 'C:\Program Files (x86)\Microsoft Visual Studio\2019\BuildTools\MSBuild\Current\Bin'
CMAKE_DIR: 'C:\Program Files\CMake\bin'
steps:
- name: Checkout
uses: actions/checkout@v4.1.1
- name: Cache setup
id: cache_setup
uses: ./.github/actions/cache_setup
- name: Download Previous Artifacts
uses: actions/download-artifact@v4
with:
hermes-version: ${{ needs.prepare_hermes_workspace.outputs.hermes-version }}
react-native-version: ${{ needs.prepare_hermes_workspace.outputs.react-native-version }}
name: hermes-workspace
path: 'D:\tmp\hermes'
- name: Set up workspace
run: |
mkdir -p D:\tmp\hermes\osx-bin
mkdir -p .\packages\react-native\sdks\hermes
cp -r -Force D:\tmp\hermes\hermes\* .\packages\react-native\sdks\hermes\.
cp -r -Force .\packages\react-native\sdks\hermes-engine\utils\* .\packages\react-native\sdks\hermes\.
- name: Windows cache
uses: actions/cache@v4.0.0
with:
@@ -497,7 +506,7 @@ jobs:
Write-Host "Skipping; Clean c:\tmp\hermes\win64-bin to rebuild."
}
- name: Upload windows artifacts
uses: actions/upload-artifact@v4.3.0
uses: actions/upload-artifact@v4.3.1
with:
name: hermes-win64-bin
path: D:\tmp\hermes\win64-bin\
@@ -533,7 +542,7 @@ jobs:
shell: bash
- name: Upload test results
if: ${{ always() }}
uses: actions/upload-artifact@v4.3.0
uses: actions/upload-artifact@v4.3.1
with:
name: build-android-results
compression-level: 1
@@ -543,11 +552,12 @@ jobs:
packages/react-native/ReactAndroid/build/reports
- name: Upload RNTester APK
if: ${{ always() }}
uses: actions/upload-artifact@v4.3.0
uses: actions/upload-artifact@v4.3.1
with:
name: rntester-apk
path: packages/rn-tester/android/app/build/outputs/apk/
compression-level: 0
build_npm_package:
runs-on: 8-core-ubuntu
needs: [set_release_type, prepare_hermes_workspace, build_hermes_macos, build_hermesc_linux, build_hermesc_windows,build_android]
@@ -578,12 +588,12 @@ jobs:
uses: actions/download-artifact@v4.1.3
with:
name: hermes-osx-bin-Release
path: /tmp/hermes/osx-bin
path: /tmp/hermes/osx-bin/Release
- name: Download osx-bin debug artifacts
uses: actions/download-artifact@v4.1.3
with:
name: hermes-osx-bin-Debug
path: /tmp/hermes/osx-bin
path: /tmp/hermes/osx-bin/Debug
- name: Download darwin-bin release artifacts
uses: actions/download-artifact@v4.1.3
with:
+208 -150
View File
@@ -1,9 +1,9 @@
name: Publish release
name: Publish Release
on:
push:
tags:
- "v0.[0-9]+.[0-9]+(-*)?" # This should match v0.X.Y and v0.X.Y-RC.0
- "v0.*.*" # This should match v0.X.Y
- "v0.*.*-rc.*" # This should match v0.X.Y-RC.0
jobs:
set_release_type:
runs-on: ubuntu-latest
@@ -25,54 +25,19 @@ jobs:
HERMES_WS_DIR: /tmp/hermes
HERMES_VERSION_FILE: packages/react-native/sdks/.hermesversion
BUILD_FROM_SOURCE: true
GRADLE_OPTS: '-Dorg.gradle.daemon=false'
outputs:
react-native-version: ${{ steps.react-native-version.outputs.version }}
hermes-version: ${{ steps.hermes-version.outputs.version }}
react-native-version: ${{ steps.prepare-hermes-workspace.outputs.react-native-version }}
hermes-version: ${{ steps.prepare-hermes-workspace.outputs.hermes-version }}
steps:
- name: Checkout
uses: actions/checkout@v4.1.1
- name: Setup node.js
uses: ./.github/actions/setup-node
- name: Setup hermes version
id: hermes-version
run: |
mkdir -p "/tmp/hermes" "/tmp/hermes/download" "/tmp/hermes/hermes"
if [ -f "$HERMES_VERSION_FILE" ]; then
echo "Hermes Version file found! Using this version for the build:"
echo "VERSION=$(cat $HERMES_VERSION_FILE)" >> "$GITHUB_OUTPUT"
else
echo "Hermes Version file not found!!!"
echo "Using the last commit from main for the build:"
HERMES_TAG_SHA=$(git ls-remote https://github.com/$GITHUB_REPOSITORY main | cut -f 1 | tr -d '[:space:]')
echo "VERSION=$HERMES_TAG_SHA" >> "$GITHUB_OUTPUT"
fi
echo "Hermes commit is $HERMES_TAG_SHA"
- name: Get react-native version
id: react-native-version
run: |
VERSION=$(cat packages/react-native/package.json | jq -r '.version')
# Save the react native version we are building in an output variable so we can use that file as part of the cache key.
echo "VERSION=$VERSION" >> "$GITHUB_OUTPUT"
echo "React Native Version is $VERSION"
- name: Cache hermes workspace
uses: actions/cache@v4.0.0
- name: Prepare Hermes Workspace
id: prepare-hermes-workspace
uses: ./.github/actions/prepare-hermes-workspace
with:
path: |
/tmp/hermes/download/
/tmp/hermes/hermes/
key: v1-hermes-${{ steps.hermes-version.outputs.version }}-${{ github.run_number }}
enableCrossOsArchive: true
- name: Yarn- Install Dependencies
run: yarn install --non-interactive
- name: Download Hermes tarball
run: |
node packages/react-native/scripts/hermes/prepare-hermes-for-build ${{ github.event.pull_request.html_url }}
cp packages/react-native/sdks/download/* $HERMES_WS_DIR/download/.
cp -r packages/react-native/sdks/hermes/* $HERMES_WS_DIR/hermes/.
echo ${{ steps.hermes-version.outputs.version }}
HERMES_WS_DIR: ${{ env.HERMES_WS_DIR }}
HERMES_VERSION_FILE: ${{ env.HERMES_VERSION_FILE }}
BUILD_FROM_SOURCE: ${{ env.BUILD_FROM_SOURCE }}
build_hermesc_apple:
runs-on: macos-13
@@ -83,18 +48,10 @@ jobs:
steps:
- name: Checkout
uses: actions/checkout@v4.1.1
- name: Cache hermes workspace
uses: actions/cache@v4.0.0
with:
path: |
/tmp/hermes/download/
/tmp/hermes/hermes/
key: v1-hermes-${{ needs.prepare_hermes_workspace.outputs.hermes-version }}-${{ github.run_number }}
enableCrossOsArchive: true
- name: Setup Hermes workspace
uses: ./.github/actions/setup_hermes_workspace
- name: Restore Hermes workspace
uses: ./.github/actions/restore-hermes-workspace
- name: Hermes apple cache
uses: actions/cache@v4.0.0
uses: actions/cache/restore@v4.0.0
with:
path: ./packages/react-native/sdks/hermes/build_host_hermesc
key: v2-hermesc-apple-${{ needs.prepare_hermes_workspace.outputs.hermes-version }}-${{ needs.prepare_hermes_workspace.outputs.react-native-version }}
@@ -103,6 +60,18 @@ jobs:
cd ./packages/react-native/sdks/hermes || exit 1
. ./utils/build-apple-framework.sh
build_host_hermesc_if_needed
- name: Upload HermesC Artifact
uses: actions/upload-artifact@v4.3.1
with:
name: hermesc-apple
path: ./packages/react-native/sdks/hermes/build_host_hermesc
- name: Cache hermesc apple
uses: actions/cache/save@v4.0.0
if: ${{ github.ref == 'refs/heads/main' || contains(github.ref, '-stable') }} # To avoid that the cache explode.
with:
path: ./packages/react-native/sdks/hermes/build_host_hermesc
key: v2-hermesc-apple-${{ needs.prepare_hermes_workspace.outputs.hermes-version }}-${{ needs.prepare_hermes_workspace.outputs.react-native-version }}
enableCrossOsArchive: true
build_apple_slices_hermes:
runs-on: macos-14
@@ -111,6 +80,9 @@ jobs:
HERMES_WS_DIR: /tmp/hermes
HERMES_TARBALL_ARTIFACTS_DIR: /tmp/hermes/hermes-runtime-darwin
HERMES_OSXBIN_ARTIFACTS_DIR: /tmp/hermes/osx-bin
IOS_DEPLOYMENT_TARGET: "13.4"
XROS_DEPLOYMENT_TARGET: "1.0"
MAC_DEPLOYMENT_TARGET: "10.15"
continue-on-error: true
strategy:
fail-fast: false
@@ -122,33 +94,20 @@ jobs:
uses: actions/checkout@v4.1.1
- name: Setup xcode
uses: ./.github/actions/setup-xcode
- name: Cache setup
id: cache_setup
uses: ./.github/actions/cache_setup
- name: Restore Hermes workspace
uses: ./.github/actions/restore-hermes-workspace
- name: Restore HermesC Artifact
uses: actions/download-artifact@v4.1.3
with:
hermes-version: ${{ needs.prepare_hermes_workspace.outputs.hermes-version }}
react-native-version: ${{ needs.prepare_hermes_workspace.outputs.react-native-version }}
- name: Setup Hermes workspace
uses: ./.github/actions/setup_hermes_workspace
- name: Check if the required artifacts already exist
id: check_if_apple_artifacts_are_there
run: |
FLAVOR="${{ matrix.flavor }}"
echo "Flavor is $FLAVOR"
OSX_BIN="/tmp/hermes/osx-bin/$FLAVOR"
DSYM="/tmp/hermes/dSYM/$FLAVOR"
HERMES="/tmp/hermes/hermes-runtime-darwin/hermes-ios-$FLAVOR.tar.gz"
if [[ -d "$OSX_BIN" ]] && \
[[ -d "$DSYM" ]] && \
[[ -f "$HERMES" ]]; then
echo "Artifacts are there!"
echo "ARTIFACTS_EXIST=true" >> $GITHUB_ENV
echo "ARTIFACTS_EXIST=true" >> $GITHUB_OUTPUT
fi
name: hermesc-apple
path: ./packages/react-native/sdks/hermes/build_host_hermesc
- name: Restore Slice From Cache
id: restore-slice-cache
uses: actions/cache/restore@v4.0.0
with:
path: ./packages/react-native/sdks/hermes/build_${{ matrix.slice }}_${{ matrix.flavor }}
key: v5-hermes-apple-${{ needs.prepare_hermes_workspace.outputs.hermes-version }}-${{ needs.prepare_hermes_workspace.outputs.react-native-version }}-${{ hashfiles('packages/react-native/sdks/hermes-engine/utils/build-apple-framework.sh') }}-${{ matrix.slice }}-${{ matrix.flavor }}
- name: Build the Hermes ${{ matrix.slice }} frameworks
if: ${{ steps.check_if_apple_artifacts_are_there.outputs.ARTIFACTS_EXIST != true }}
run: |
cd ./packages/react-native/sdks/hermes || exit 1
SLICE=${{ matrix.slice }}
@@ -166,11 +125,20 @@ jobs:
exit 0
fi
export RELEASE_VERSION=${{ needs.prepare_hermes_workspace.outputs.react-native-version }}
# HermesC is used to build hermes, so it has to be executable
chmod +x ./build_host_hermesc/bin/hermesc
if [[ "$SLICE" == "macosx" ]]; then
echo "[HERMES] Building Hermes for MacOS"
chmod +x ./utils/build-mac-framework.sh
BUILD_TYPE="${{ matrix.flavor }}" ./utils/build-mac-framework.sh
else
echo "[HERMES] Building Hermes for iOS: $SLICE"
chmod +x ./utils/build-ios-framework.sh
BUILD_TYPE="${{ matrix.flavor }}" ./utils/build-ios-framework.sh "$SLICE"
fi
@@ -192,12 +160,21 @@ jobs:
echo "Please try again"
exit 1
fi
- name: Compress slices to preserve Symlinks
run: |
cd ./packages/react-native/sdks/hermes
tar -czv -f build_${{ matrix.slice }}_${{ matrix.flavor }}.tar.gz build_${{ matrix.slice }}_${{ matrix.flavor }}
- name: Upload Artifact for Slice (${{ matrix.slice }}, ${{ matrix.flavor }}}
uses: actions/upload-artifact@v4.3.1
with:
name: slice-${{ matrix.slice }}-${{ matrix.flavor }}
path: ./packages/react-native/sdks/hermes/build_${{ matrix.slice }}_${{ matrix.flavor }}.tar.gz
- name: Save slice cache
if: ${{ steps.check_if_apple_artifacts_are_there.outputs.ARTIFACTS_EXIST != true }}
uses: actions/cache@v4.0.0
if: ${{ github.ref == 'refs/heads/main' || contains(github.ref, '-stable') }} # To avoid that the cache explode.
uses: actions/cache/save@v4.0.0
with:
path: ./packages/react-native/sdks/hermes/build_${{ matrix.slice }}_${{ matrix.flavor }}
key: v4-hermes-apple-${{ needs.prepare_hermes_workspace.outputs.hermes-version }}-${{ needs.prepare_hermes_workspace.outputs.react-native-version }}-${{ hashfiles('packages/react-native/sdks/hermes-engine/utils/build-apple-framework.sh') }}-${{ matrix.slice }}-${{ matrix.flavor }}
key: v5-hermes-apple-${{ needs.prepare_hermes_workspace.outputs.hermes-version }}-${{ needs.prepare_hermes_workspace.outputs.react-native-version }}-${{ hashfiles('packages/react-native/sdks/hermes-engine/utils/build-apple-framework.sh') }}-${{ matrix.slice }}-${{ matrix.flavor }}
build_hermes_macos:
runs-on: macos-13
@@ -217,14 +194,16 @@ jobs:
uses: ./.github/actions/setup-xcode
- name: Setup node.js
uses: ./.github/actions/setup-node
- name: Cache setup
id: cache_setup
uses: ./.github/actions/cache_setup
- name: Restore Hermes workspace
uses: ./.github/actions/restore-hermes-workspace
- name: Restore Cached Artifacts
uses: actions/cache/restore@v4.0.0
with:
hermes-version: ${{ needs.prepare_hermes_workspace.outputs.hermes-version }}
react-native-version: ${{ needs.prepare_hermes_workspace.outputs.react-native-version }}
- name: Setup Hermes workspace
uses: ./.github/actions/setup_hermes_workspace
key: v3-hermes-artifacts-${{ matrix.flavor }}-${{ needs.prepare_hermes_workspace.outputs.hermes-version }}-${{ needs.prepare_hermes_workspace.outputs.react-native-version }}
path: |
/tmp/hermes/osx-bin/${{ matrix.flavor }}
/tmp/hermes/dSYM/${{ matrix.flavor }}
/tmp/hermes/hermes-runtime-darwin/hermes-ios-${{ matrix.flavor }}.tar.gz
- name: Check if the required artifacts already exist
id: check_if_apple_artifacts_are_there
run: |
@@ -243,46 +222,57 @@ jobs:
echo "ARTIFACTS_EXIST=true" >> $GITHUB_OUTPUT
fi
- name: Yarn- Install Dependencies
if: ${{ ! contains(github.event.head_commit.message, 'Bump metro@') && steps.check_if_apple_artifacts_are_there.outputs.ARTIFACTS_EXIST != true }}
if: ${{ steps.check_if_apple_artifacts_are_there.outputs.ARTIFACTS_EXIST != 'true' }}
run: yarn install --non-interactive
- name: Slice cache macosx
if: ${{ steps.check_if_apple_artifacts_are_there.outputs.ARTIFACTS_EXIST != true }}
uses: actions/cache@v4.0.0
if: ${{ steps.check_if_apple_artifacts_are_there.outputs.ARTIFACTS_EXIST != 'true' }}
uses: actions/download-artifact@v4.1.3
with:
path: ./packages/react-native/sdks/hermes/build_macosx_${{ matrix.flavor }}
key: v4-hermes-apple-${{ needs.prepare_hermes_workspace.outputs.hermes-version }}-${{ needs.prepare_hermes_workspace.outputs.react-native-version }}-${{ hashfiles('packages/react-native/sdks/hermes-engine/utils/build-apple-framework.sh') }}-macosx-${{ matrix.flavor }}
path: ./packages/react-native/sdks/hermes/
name: slice-macosx-${{ matrix.flavor }}
- name: Slice cache iphoneos
if: ${{ steps.check_if_apple_artifacts_are_there.outputs.ARTIFACTS_EXIST != true }}
uses: actions/cache@v4.0.0
if: ${{ steps.check_if_apple_artifacts_are_there.outputs.ARTIFACTS_EXIST != 'true' }}
uses: actions/download-artifact@v4.1.3
with:
path: ./packages/react-native/sdks/hermes/build_iphoneos_${{ matrix.flavor }}
key: v4-hermes-apple-${{ needs.prepare_hermes_workspace.outputs.hermes-version }}-${{ needs.prepare_hermes_workspace.outputs.react-native-version }}-${{ hashfiles('packages/react-native/sdks/hermes-engine/utils/build-apple-framework.sh') }}-iphoneos-${{ matrix.flavor }}
path: ./packages/react-native/sdks/hermes/
name: slice-iphoneos-${{ matrix.flavor }}
- name: Slice cache iphonesimulator
if: ${{ steps.check_if_apple_artifacts_are_there.outputs.ARTIFACTS_EXIST != true }}
uses: actions/cache@v4.0.0
if: ${{ steps.check_if_apple_artifacts_are_there.outputs.ARTIFACTS_EXIST != 'true' }}
uses: actions/download-artifact@v4.1.3
with:
path: ./packages/react-native/sdks/hermes/build_iphonesimulator_${{ matrix.flavor }}
key: v4-hermes-apple-${{ needs.prepare_hermes_workspace.outputs.hermes-version }}-${{ needs.prepare_hermes_workspace.outputs.react-native-version }}-${{ hashfiles('packages/react-native/sdks/hermes-engine/utils/build-apple-framework.sh') }}-iphonesimulator-${{ matrix.flavor }}
path: ./packages/react-native/sdks/hermes/
name: slice-iphonesimulator-${{ matrix.flavor }}
- name: Slice cache catalyst
if: ${{ steps.check_if_apple_artifacts_are_there.outputs.ARTIFACTS_EXIST != true }}
uses: actions/cache@v4.0.0
if: ${{ steps.check_if_apple_artifacts_are_there.outputs.ARTIFACTS_EXIST != 'true' }}
uses: actions/download-artifact@v4.1.3
with:
path: ./packages/react-native/sdks/hermes/build_catalyst_${{ matrix.flavor }}
key: v4-hermes-apple-${{ needs.prepare_hermes_workspace.outputs.hermes-version }}-${{ needs.prepare_hermes_workspace.outputs.react-native-version }}-${{ hashfiles('packages/react-native/sdks/hermes-engine/utils/build-apple-framework.sh') }}-catalyst-${{ matrix.flavor }}
path: ./packages/react-native/sdks/hermes/
name: slice-catalyst-${{ matrix.flavor }}
- name: Slice cache xros
if: ${{ steps.check_if_apple_artifacts_are_there.outputs.ARTIFACTS_EXIST != true }}
uses: actions/cache@v4.0.0
if: ${{ steps.check_if_apple_artifacts_are_there.outputs.ARTIFACTS_EXIST != 'true' }}
uses: actions/download-artifact@v4.1.3
with:
path: ./packages/react-native/sdks/hermes/build_xros_${{ matrix.flavor }}
key: v4-hermes-apple-${{ needs.prepare_hermes_workspace.outputs.hermes-version }}-${{ needs.prepare_hermes_workspace.outputs.react-native-version }}-${{ hashfiles('packages/react-native/sdks/hermes-engine/utils/build-apple-framework.sh') }}-xros-${{ matrix.flavor }}
path: ./packages/react-native/sdks/hermes/
name: slice-xros-${{ matrix.flavor }}
- name: Slice cache xrsimulator
if: ${{ steps.check_if_apple_artifacts_are_there.outputs.ARTIFACTS_EXIST != true }}
uses: actions/cache@v4.0.0
if: ${{ steps.check_if_apple_artifacts_are_there.outputs.ARTIFACTS_EXIST != 'true' }}
uses: actions/download-artifact@v4.1.3
with:
path: ./packages/react-native/sdks/hermes/build_xrsimulator_${{ matrix.flavor }}
key: v4-hermes-apple-${{ needs.prepare_hermes_workspace.outputs.hermes-version }}-${{ needs.prepare_hermes_workspace.outputs.react-native-version }}-${{ hashfiles('packages/react-native/sdks/hermes-engine/utils/build-apple-framework.sh') }}-xrsimulator-${{ matrix.flavor }}
path: ./packages/react-native/sdks/hermes/
name: slice-xrsimulator-${{ matrix.flavor }}
- name: Unzip slices
if: ${{ steps.check_if_apple_artifacts_are_there.outputs.ARTIFACTS_EXIST != 'true' }}
run: |
cd ./packages/react-native/sdks/hermes
ls -l .
tar -xzv -f build_catalyst_${{ matrix.flavor }}.tar.gz
tar -xzv -f build_iphoneos_${{ matrix.flavor }}.tar.gz
tar -xzv -f build_iphonesimulator_${{ matrix.flavor }}.tar.gz
tar -xzv -f build_macosx_${{ matrix.flavor }}.tar.gz
tar -xzv -f build_xros_${{ matrix.flavor }}.tar.gz
tar -xzv -f build_xrsimulator_${{ matrix.flavor }}.tar.gz
- name: Move back build folders
if: ${{ steps.check_if_apple_artifacts_are_there.outputs.ARTIFACTS_EXIST != true }}
if: ${{ steps.check_if_apple_artifacts_are_there.outputs.ARTIFACTS_EXIST != 'true' }}
run: |
ls -l ./packages/react-native/sdks/hermes
cd ./packages/react-native/sdks/hermes || exit 1
@@ -293,19 +283,23 @@ jobs:
mv build_xros_${{ matrix.flavor }} build_xros
mv build_xrsimulator_${{ matrix.flavor }} build_xrsimulator
- name: Prepare destroot folder
if: ${{ steps.check_if_apple_artifacts_are_there.outputs.ARTIFACTS_EXIST != true }}
if: ${{ steps.check_if_apple_artifacts_are_there.outputs.ARTIFACTS_EXIST != 'true' }}
run: |
cd ./packages/react-native/sdks/hermes || exit 1
chmod +x ./utils/build-apple-framework.sh
. ./utils/build-apple-framework.sh
prepare_dest_root_for_ci
- name: Create fat framework for iOS
if: ${{ steps.check_if_apple_artifacts_are_there.outputs.ARTIFACTS_EXIST != true }}
if: ${{ steps.check_if_apple_artifacts_are_there.outputs.ARTIFACTS_EXIST != 'true' }}
run: |
cd ./packages/react-native/sdks/hermes || exit 1
echo "[HERMES] Creating the universal framework"
chmod +x ./utils/build-ios-framework.sh
./utils/build-ios-framework.sh build_framework
chmod +x ./destroot/bin/hermesc
- name: Package the Hermes Apple frameworks
if: ${{ steps.check_if_apple_artifacts_are_there.outputs.ARTIFACTS_EXIST != true }}
if: ${{ steps.check_if_apple_artifacts_are_there.outputs.ARTIFACTS_EXIST != 'true' }}
run: |
BUILD_TYPE="${{ matrix.flavor }}"
echo "Packaging Hermes Apple frameworks for $BUILD_TYPE build type"
@@ -329,18 +323,8 @@ jobs:
mkdir -p /tmp/hermes/osx-bin/${{ matrix.flavor }}
cp ./packages/react-native/sdks/hermes/build_macosx/bin/* /tmp/hermes/osx-bin/${{ matrix.flavor }}
ls -lR /tmp/hermes/osx-bin/
- name: Upload darwin artifacts
uses: actions/upload-artifact@v4.3.1
with:
name: hermes-darwin-bin-${{ matrix.flavor }}
path: /tmp/hermes/hermes-runtime-darwin
- name: Upload osx-bin
uses: actions/upload-artifact@v4.3.1
with:
name: hermes-osx-bin-${{ matrix.flavor }}
path: /tmp/hermes/osx-bin
- name: Create dSYM archive
if: ${{ steps.check_if_apple_artifacts_are_there.outputs.ARTIFACTS_EXIST != true }}
if: ${{ steps.check_if_apple_artifacts_are_there.outputs.ARTIFACTS_EXIST != 'true' }}
run: |
FLAVOR=${{ matrix.flavor }}
WORKING_DIR="/tmp/hermes_tmp/dSYM/$FLAVOR"
@@ -372,10 +356,32 @@ jobs:
with:
name: hermes-dSYM-${{ matrix.flavor }}
path: /tmp/hermes/dSYM/${{ matrix.flavor }}
- name: Upload hermes Runtime artifacts
uses: actions/upload-artifact@v4.3.1
with:
name: hermes-darwin-bin-${{ matrix.flavor }}
path: /tmp/hermes/hermes-runtime-darwin/hermes-ios-${{ matrix.flavor }}.tar.gz
- name: Upload hermes osx artifacts
uses: actions/upload-artifact@v4.3.1
with:
name: hermes-osx-bin-${{ matrix.flavor }}
path: /tmp/hermes/osx-bin/${{ matrix.flavor }}
- name: Upload Hermes Artifacts
uses: actions/cache/save@v4.0.0
if: ${{ github.ref == 'refs/heads/main' || contains(github.ref, '-stable') }} # To avoid that the cache explode.
with:
key: v3-hermes-artifacts-${{ matrix.flavor }}-${{ needs.prepare_hermes_workspace.outputs.hermes-version }}-${{ needs.prepare_hermes_workspace.outputs.react-native-version }}
path: |
/tmp/hermes/osx-bin/${{ matrix.flavor }}
/tmp/hermes/dSYM/${{ matrix.flavor }}
/tmp/hermes/hermes-runtime-darwin/hermes-ios-${{ matrix.flavor }}.tar.gz
build_hermesc_linux:
runs-on: ubuntu-latest
needs: prepare_hermes_workspace
env:
HERMES_WS_DIR: /tmp/hermes
HERMES_TARBALL_ARTIFACTS_DIR: /tmp/hermes/hermes-runtime-darwin
steps:
- name: Checkout
uses: actions/checkout@v4.1.1
@@ -384,12 +390,8 @@ jobs:
sudo apt update
sudo apt install -y git openssh-client cmake build-essential \
libreadline-dev libicu-dev jq zip python3
- name: Cache setup
id: cache_setup
uses: ./.github/actions/cache_setup
with:
hermes-version: ${{ needs.prepare_hermes_workspace.outputs.hermes-version }}
react-native-version: ${{ needs.prepare_hermes_workspace.outputs.react-native-version }}
- name: Restore Hermes workspace
uses: ./.github/actions/restore-hermes-workspace
- name: Linux cache
uses: actions/cache@v4.0.0
with:
@@ -413,7 +415,7 @@ jobs:
cp /tmp/hermes/build/bin/hermesc /tmp/hermes/linux64-bin/.
fi
- name: Upload linux artifacts
uses: actions/upload-artifact@v4.3.0
uses: actions/upload-artifact@v4.3.1
with:
name: hermes-linux-bin
path: /tmp/hermes/linux64-bin
@@ -423,18 +425,25 @@ jobs:
needs: prepare_hermes_workspace
env:
HERMES_WS_DIR: 'D:\tmp\hermes'
HERMES_TARBALL_ARTIFACTS_DIR: 'D:\tmp\hermes\hermes-runtime-darwin'
HERMES_OSXBIN_ARTIFACTS_DIR: 'D:\tmp\hermes\osx-bin'
ICU_URL: "https://github.com/unicode-org/icu/releases/download/release-64-2/icu4c-64_2-Win64-MSVC2017.zip"
MSBUILD_DIR: 'C:\Program Files (x86)\Microsoft Visual Studio\2019\BuildTools\MSBuild\Current\Bin'
CMAKE_DIR: 'C:\Program Files\CMake\bin'
steps:
- name: Checkout
uses: actions/checkout@v4.1.1
- name: Cache setup
id: cache_setup
uses: ./.github/actions/cache_setup
- name: Download Previous Artifacts
uses: actions/download-artifact@v4
with:
hermes-version: ${{ needs.prepare_hermes_workspace.outputs.hermes-version }}
react-native-version: ${{ needs.prepare_hermes_workspace.outputs.react-native-version }}
name: hermes-workspace
path: 'D:\tmp\hermes'
- name: Set up workspace
run: |
mkdir -p D:\tmp\hermes\osx-bin
mkdir -p .\packages\react-native\sdks\hermes
cp -r -Force D:\tmp\hermes\hermes\* .\packages\react-native\sdks\hermes\.
cp -r -Force .\packages\react-native\sdks\hermes-engine\utils\* .\packages\react-native\sdks\hermes\.
- name: Windows cache
uses: actions/cache@v4.0.0
with:
@@ -494,7 +503,7 @@ jobs:
Write-Host "Skipping; Clean c:\tmp\hermes\win64-bin to rebuild."
}
- name: Upload windows artifacts
uses: actions/upload-artifact@v4.3.0
uses: actions/upload-artifact@v4.3.1
with:
name: hermes-win64-bin
path: D:\tmp\hermes\win64-bin\
@@ -515,7 +524,9 @@ jobs:
- name: Install dependencies
run: yarn install --non-interactive
- name: Set React Native Version
run: node ./scripts/releases/set-rn-version.js --build-type ${{ needs.set_release_type.outputs.RELEASE_TYPE }}
run: |
git config --global --add safe.directory /__w/react-native/react-native
node ./scripts/releases/set-rn-version.js --build-type ${{ needs.set_release_type.outputs.RELEASE_TYPE }}
- name: Setup gradle
uses: ./.github/actions/setup-gradle
- name: Build and publish all the Android Artifacts to /tmp/maven-local
@@ -530,7 +541,7 @@ jobs:
shell: bash
- name: Upload test results
if: ${{ always() }}
uses: actions/upload-artifact@v4.3.0
uses: actions/upload-artifact@v4.3.1
with:
name: build-android-results
compression-level: 1
@@ -540,7 +551,7 @@ jobs:
packages/react-native/ReactAndroid/build/reports
- name: Upload RNTester APK
if: ${{ always() }}
uses: actions/upload-artifact@v4.3.0
uses: actions/upload-artifact@v4.3.1
with:
name: rntester-apk
path: packages/rn-tester/android/app/build/outputs/apk/
@@ -570,18 +581,21 @@ jobs:
steps:
- name: Checkout
uses: actions/checkout@v4.1.1
with:
fetch-depth: 0
fetch-tags: true
- name: Create /tmp/hermes/osx-bin directory
run: mkdir -p /tmp/hermes/osx-bin
- name: Download osx-bin release artifacts
uses: actions/download-artifact@v4.1.3
with:
name: hermes-osx-bin-Release
path: /tmp/hermes/osx-bin
path: /tmp/hermes/osx-bin/Release
- name: Download osx-bin debug artifacts
uses: actions/download-artifact@v4.1.3
with:
name: hermes-osx-bin-Debug
path: /tmp/hermes/osx-bin
path: /tmp/hermes/osx-bin/Debug
- name: Download darwin-bin release artifacts
uses: actions/download-artifact@v4.1.3
with:
@@ -698,6 +712,50 @@ jobs:
with:
name: react-native-package
path: build
- name: Publish @react-native-community/template
if: needs.set_release_type.outputs.RELEASE_TYPE == 'release'
shell: bash
id: publish-to-npm
run: |
COMMIT_MSG=$(git log -n1 --pretty=%B);
if grep -q '#publish-packages-to-npm&latest' <<< "$COMMIT_MSG"; then
echo "TAG=latest" >> $GITHUB_OUTPUT
IS_LATEST=true
else
IS_LATEST=false
fi
# Go from v0.75.0-rc.4 -> 0.75-stable, which is the template's branching scheme
VERSION=$(grep -oE '\d+\.\d+' <<< "${{ github.ref_name }}" | { read version; echo "$version-stable"; })
echo "VERSION=$VERSION" >> $GITHUB_OUTPUT
curl -L https://api.github.com/repos/react-native-community/template/actions/workflows/release.yaml/dispatches
-H "Accept: application/vnd.github.v3+json" \
-H "Authorization: Bearer $REACT_NATIVE_BOT_GITHUB_TOKEN" \
-d "{\"ref\":\"$VERSION\",\"inputs\":{\"version\":\"${{ github.ref_name }}\",\"is_latest_on_npm\":\"$IS_LATEST\"}}"
- name: Wait for template to be published
if: needs.set_release_type.outputs.RELEASE_TYPE == 'release'
timeout-minutes: 3
shell: bash
env:
VERSION: ${{ steps.publish-to-npm.outputs.VERSION }}
TAG: ${{ steps.publish-to-npm.outputs.TAG }}
run: |
echo "Waiting until @react-native-community/template is published to npm"
while true; do
if curl -o /dev/null -s -f "https://registry.npmjs.org/@react-native-community/template/$VERSION"; then
echo "Confirm that @react-native-community/template@$VERSION is published on npm"
break
fi
sleep 10
done
while [ "$TAG" == "latest" ]; do
CURRENT=$(curl -s "https://registry.npmjs.org/react-native/latest" | jq -r '.version');
if [ "$CURRENT" == "$VERSION" ]; then
echo "Confirm that @react-native-community/template@latest == $VERSION on npm"
break
fi
sleep 10
done
- name: Update rn-diff-purge to generate upgrade-support diff
if: needs.set_release_type.outputs.RELEASE_TYPE == 'release'
run: |
+158 -148
View File
@@ -2,6 +2,7 @@ name: Test All
on:
workflow_dispatch:
pull_request:
push:
branches:
- main
@@ -36,52 +37,18 @@ jobs:
HERMES_VERSION_FILE: packages/react-native/sdks/.hermesversion
BUILD_FROM_SOURCE: true
outputs:
react-native-version: ${{ steps.react-native-version.outputs.version }}
hermes-version: ${{ steps.hermes-version.outputs.version }}
react-native-version: ${{ steps.prepare-hermes-workspace.outputs.react-native-version }}
hermes-version: ${{ steps.prepare-hermes-workspace.outputs.hermes-version }}
steps:
- name: Checkout
uses: actions/checkout@v4.1.1
- name: Setup node.js
uses: ./.github/actions/setup-node
- name: Setup hermes version
id: hermes-version
run: |
mkdir -p "/tmp/hermes" "/tmp/hermes/download" "/tmp/hermes/hermes"
if [ -f "$HERMES_VERSION_FILE" ]; then
echo "Hermes Version file found! Using this version for the build:"
echo "VERSION=$(cat $HERMES_VERSION_FILE)" >> "$GITHUB_OUTPUT"
else
echo "Hermes Version file not found!!!"
echo "Using the last commit from main for the build:"
HERMES_TAG_SHA=$(git ls-remote https://github.com/$GITHUB_REPOSITORY main | cut -f 1 | tr -d '[:space:]')
echo "VERSION=$HERMES_TAG_SHA" >> "$GITHUB_OUTPUT"
fi
echo "Hermes commit is $HERMES_TAG_SHA"
- name: Get react-native version
id: react-native-version
run: |
VERSION=$(cat packages/react-native/package.json | jq -r '.version')
# Save the react native version we are building in an output variable so we can use that file as part of the cache key.
echo "VERSION=$VERSION" >> "$GITHUB_OUTPUT"
echo "React Native Version is $VERSION"
- name: Cache hermes workspace
uses: actions/cache@v4.0.0
- name: Prepare Hermes Workspace
id: prepare-hermes-workspace
uses: ./.github/actions/prepare-hermes-workspace
with:
path: |
/tmp/hermes/download/
/tmp/hermes/hermes/
key: v1-hermes-${{ steps.hermes-version.outputs.version }}-${{ github.run_number }}
enableCrossOsArchive: true
- name: Yarn- Install Dependencies
run: yarn install --non-interactive
- name: Download Hermes tarball
run: |
node packages/react-native/scripts/hermes/prepare-hermes-for-build ${{ github.event.pull_request.html_url }}
cp packages/react-native/sdks/download/* $HERMES_WS_DIR/download/.
cp -r packages/react-native/sdks/hermes/* $HERMES_WS_DIR/hermes/.
echo ${{ steps.hermes-version.outputs.version }}
HERMES_WS_DIR: ${{ env.HERMES_WS_DIR }}
HERMES_VERSION_FILE: ${{ env.HERMES_VERSION_FILE }}
BUILD_FROM_SOURCE: ${{ env.BUILD_FROM_SOURCE }}
build_hermesc_apple:
runs-on: macos-13
@@ -92,18 +59,10 @@ jobs:
steps:
- name: Checkout
uses: actions/checkout@v4.1.1
- name: Cache hermes workspace
uses: actions/cache@v4.0.0
with:
path: |
/tmp/hermes/download/
/tmp/hermes/hermes/
key: v1-hermes-${{ needs.prepare_hermes_workspace.outputs.hermes-version }}-${{ github.run_number }}
enableCrossOsArchive: true
- name: Setup Hermes workspace
uses: ./.github/actions/setup_hermes_workspace
- name: Restore Hermes workspace
uses: ./.github/actions/restore-hermes-workspace
- name: Hermes apple cache
uses: actions/cache@v4.0.0
uses: actions/cache/restore@v4.0.0
with:
path: ./packages/react-native/sdks/hermes/build_host_hermesc
key: v2-hermesc-apple-${{ needs.prepare_hermes_workspace.outputs.hermes-version }}-${{ needs.prepare_hermes_workspace.outputs.react-native-version }}
@@ -112,6 +71,18 @@ jobs:
cd ./packages/react-native/sdks/hermes || exit 1
. ./utils/build-apple-framework.sh
build_host_hermesc_if_needed
- name: Upload HermesC Artifact
uses: actions/upload-artifact@v4.3.1
with:
name: hermesc-apple
path: ./packages/react-native/sdks/hermes/build_host_hermesc
- name: Cache hermesc apple
uses: actions/cache/save@v4.0.0
if: ${{ github.ref == 'refs/heads/main' || contains(github.ref, '-stable') }} # To avoid that the cache explode.
with:
path: ./packages/react-native/sdks/hermes/build_host_hermesc
key: v2-hermesc-apple-${{ needs.prepare_hermes_workspace.outputs.hermes-version }}-${{ needs.prepare_hermes_workspace.outputs.react-native-version }}
enableCrossOsArchive: true
build_apple_slices_hermes:
runs-on: macos-14
@@ -120,6 +91,9 @@ jobs:
HERMES_WS_DIR: /tmp/hermes
HERMES_TARBALL_ARTIFACTS_DIR: /tmp/hermes/hermes-runtime-darwin
HERMES_OSXBIN_ARTIFACTS_DIR: /tmp/hermes/osx-bin
IOS_DEPLOYMENT_TARGET: "13.4"
XROS_DEPLOYMENT_TARGET: "1.0"
MAC_DEPLOYMENT_TARGET: "10.15"
continue-on-error: true
strategy:
fail-fast: false
@@ -131,30 +105,19 @@ jobs:
uses: actions/checkout@v4.1.1
- name: Setup xcode
uses: ./.github/actions/setup-xcode
- name: Cache setup
id: cache_setup
uses: ./.github/actions/cache_setup
- name: Restore Hermes workspace
uses: ./.github/actions/restore-hermes-workspace
- name: Restore HermesC Artifact
uses: actions/download-artifact@v4.1.3
with:
hermes-version: ${{ needs.prepare_hermes_workspace.outputs.hermes-version }}
react-native-version: ${{ needs.prepare_hermes_workspace.outputs.react-native-version }}
- name: Setup Hermes workspace
uses: ./.github/actions/setup_hermes_workspace
- name: Check if the required artifacts already exist
id: check_if_apple_artifacts_are_there
run: |
FLAVOR="${{ matrix.flavor }}"
echo "Flavor is $FLAVOR"
OSX_BIN="/tmp/hermes/osx-bin/$FLAVOR"
DSYM="/tmp/hermes/dSYM/$FLAVOR"
HERMES="/tmp/hermes/hermes-runtime-darwin/hermes-ios-$FLAVOR.tar.gz"
if [[ -d "$OSX_BIN" ]] && \
[[ -d "$DSYM" ]] && \
[[ -f "$HERMES" ]]; then
echo "Artifacts are there!"
echo "ARTIFACTS_EXIST=true" >> $GITHUB_ENV
fi
name: hermesc-apple
path: ./packages/react-native/sdks/hermes/build_host_hermesc
- name: Restore Slice From Cache
id: restore-slice-cache
uses: actions/cache/restore@v4.0.0
with:
path: ./packages/react-native/sdks/hermes/build_${{ matrix.slice }}_${{ matrix.flavor }}
key: v5-hermes-apple-${{ needs.prepare_hermes_workspace.outputs.hermes-version }}-${{ needs.prepare_hermes_workspace.outputs.react-native-version }}-${{ hashfiles('packages/react-native/sdks/hermes-engine/utils/build-apple-framework.sh') }}-${{ matrix.slice }}-${{ matrix.flavor }}
- name: Build the Hermes ${{ matrix.slice }} frameworks
run: |
cd ./packages/react-native/sdks/hermes || exit 1
@@ -173,11 +136,20 @@ jobs:
exit 0
fi
export RELEASE_VERSION=${{ needs.prepare_hermes_workspace.outputs.react-native-version }}
# HermesC is used to build hermes, so it has to be executable
chmod +x ./build_host_hermesc/bin/hermesc
if [[ "$SLICE" == "macosx" ]]; then
echo "[HERMES] Building Hermes for MacOS"
chmod +x ./utils/build-mac-framework.sh
BUILD_TYPE="${{ matrix.flavor }}" ./utils/build-mac-framework.sh
else
echo "[HERMES] Building Hermes for iOS: $SLICE"
chmod +x ./utils/build-ios-framework.sh
BUILD_TYPE="${{ matrix.flavor }}" ./utils/build-ios-framework.sh "$SLICE"
fi
@@ -199,11 +171,21 @@ jobs:
echo "Please try again"
exit 1
fi
- name: Compress slices to preserve Symlinks
run: |
cd ./packages/react-native/sdks/hermes
tar -czv -f build_${{ matrix.slice }}_${{ matrix.flavor }}.tar.gz build_${{ matrix.slice }}_${{ matrix.flavor }}
- name: Upload Artifact for Slice (${{ matrix.slice }}, ${{ matrix.flavor }}}
uses: actions/upload-artifact@v4.3.1
with:
name: slice-${{ matrix.slice }}-${{ matrix.flavor }}
path: ./packages/react-native/sdks/hermes/build_${{ matrix.slice }}_${{ matrix.flavor }}.tar.gz
- name: Save slice cache
uses: actions/cache@v4.0.0
if: ${{ github.ref == 'refs/heads/main' || contains(github.ref, '-stable') }} # To avoid that the cache explode.
uses: actions/cache/save@v4.0.0
with:
path: ./packages/react-native/sdks/hermes/build_${{ matrix.slice }}_${{ matrix.flavor }}
key: v4-hermes-apple-${{ needs.prepare_hermes_workspace.outputs.hermes-version }}-${{ needs.prepare_hermes_workspace.outputs.react-native-version }}-${{ hashfiles('packages/react-native/sdks/hermes-engine/utils/build-apple-framework.sh') }}-${{ matrix.slice }}-${{ matrix.flavor }}
key: v5-hermes-apple-${{ needs.prepare_hermes_workspace.outputs.hermes-version }}-${{ needs.prepare_hermes_workspace.outputs.react-native-version }}-${{ hashfiles('packages/react-native/sdks/hermes-engine/utils/build-apple-framework.sh') }}-${{ matrix.slice }}-${{ matrix.flavor }}
build_hermes_macos:
runs-on: macos-13
@@ -223,14 +205,16 @@ jobs:
uses: ./.github/actions/setup-xcode
- name: Setup node.js
uses: ./.github/actions/setup-node
- name: Cache setup
id: cache_setup
uses: ./.github/actions/cache_setup
- name: Restore Hermes workspace
uses: ./.github/actions/restore-hermes-workspace
- name: Restore Cached Artifacts
uses: actions/cache/restore@v4.0.0
with:
hermes-version: ${{ needs.prepare_hermes_workspace.outputs.hermes-version }}
react-native-version: ${{ needs.prepare_hermes_workspace.outputs.react-native-version }}
- name: Setup Hermes workspace
uses: ./.github/actions/setup_hermes_workspace
key: v4-hermes-artifacts-${{ matrix.flavor }}-${{ needs.prepare_hermes_workspace.outputs.hermes-version }}-${{ needs.prepare_hermes_workspace.outputs.react-native-version }}
path: |
/tmp/hermes/osx-bin/${{ matrix.flavor }}
/tmp/hermes/dSYM/${{ matrix.flavor }}
/tmp/hermes/hermes-runtime-darwin/hermes-ios-${{ matrix.flavor }}.tar.gz
- name: Check if the required artifacts already exist
id: check_if_apple_artifacts_are_there
run: |
@@ -249,45 +233,58 @@ jobs:
echo "ARTIFACTS_EXIST=true" >> $GITHUB_OUTPUT
fi
- name: Yarn- Install Dependencies
if: ${{ steps.check_if_apple_artifacts_are_there.outputs.ARTIFACTS_EXIST != 'true' }}
run: yarn install --non-interactive
- name: Slice cache macosx
if: ${{ steps.check_if_apple_artifacts_are_there.outputs.ARTIFACTS_EXIST != true }}
uses: actions/cache@v4.0.0
if: ${{ steps.check_if_apple_artifacts_are_there.outputs.ARTIFACTS_EXIST != 'true' }}
uses: actions/download-artifact@v4.1.3
with:
path: ./packages/react-native/sdks/hermes/build_macosx_${{ matrix.flavor }}
key: v4-hermes-apple-${{ needs.prepare_hermes_workspace.outputs.hermes-version }}-${{ needs.prepare_hermes_workspace.outputs.react-native-version }}-${{ hashfiles('packages/react-native/sdks/hermes-engine/utils/build-apple-framework.sh') }}-macosx-${{ matrix.flavor }}
path: ./packages/react-native/sdks/hermes/
name: slice-macosx-${{ matrix.flavor }}
- name: Slice cache iphoneos
if: ${{ steps.check_if_apple_artifacts_are_there.outputs.ARTIFACTS_EXIST != true }}
uses: actions/cache@v4.0.0
if: ${{ steps.check_if_apple_artifacts_are_there.outputs.ARTIFACTS_EXIST != 'true' }}
uses: actions/download-artifact@v4.1.3
with:
path: ./packages/react-native/sdks/hermes/build_iphoneos_${{ matrix.flavor }}
key: v4-hermes-apple-${{ needs.prepare_hermes_workspace.outputs.hermes-version }}-${{ needs.prepare_hermes_workspace.outputs.react-native-version }}-${{ hashfiles('packages/react-native/sdks/hermes-engine/utils/build-apple-framework.sh') }}-iphoneos-${{ matrix.flavor }}
path: ./packages/react-native/sdks/hermes/
name: slice-iphoneos-${{ matrix.flavor }}
- name: Slice cache iphonesimulator
if: ${{ steps.check_if_apple_artifacts_are_there.outputs.ARTIFACTS_EXIST != true }}
uses: actions/cache@v4.0.0
if: ${{ steps.check_if_apple_artifacts_are_there.outputs.ARTIFACTS_EXIST != 'true' }}
uses: actions/download-artifact@v4.1.3
with:
path: ./packages/react-native/sdks/hermes/build_iphonesimulator_${{ matrix.flavor }}
key: v4-hermes-apple-${{ needs.prepare_hermes_workspace.outputs.hermes-version }}-${{ needs.prepare_hermes_workspace.outputs.react-native-version }}-${{ hashfiles('packages/react-native/sdks/hermes-engine/utils/build-apple-framework.sh') }}-iphonesimulator-${{ matrix.flavor }}
path: ./packages/react-native/sdks/hermes/
name: slice-iphonesimulator-${{ matrix.flavor }}
- name: Slice cache catalyst
if: ${{ steps.check_if_apple_artifacts_are_there.outputs.ARTIFACTS_EXIST != true }}
uses: actions/cache@v4.0.0
if: ${{ steps.check_if_apple_artifacts_are_there.outputs.ARTIFACTS_EXIST != 'true' }}
uses: actions/download-artifact@v4.1.3
with:
path: ./packages/react-native/sdks/hermes/build_catalyst_${{ matrix.flavor }}
key: v4-hermes-apple-${{ needs.prepare_hermes_workspace.outputs.hermes-version }}-${{ needs.prepare_hermes_workspace.outputs.react-native-version }}-${{ hashfiles('packages/react-native/sdks/hermes-engine/utils/build-apple-framework.sh') }}-catalyst-${{ matrix.flavor }}
path: ./packages/react-native/sdks/hermes/
name: slice-catalyst-${{ matrix.flavor }}
- name: Slice cache xros
if: ${{ steps.check_if_apple_artifacts_are_there.outputs.ARTIFACTS_EXIST != true }}
uses: actions/cache@v4.0.0
if: ${{ steps.check_if_apple_artifacts_are_there.outputs.ARTIFACTS_EXIST != 'true' }}
uses: actions/download-artifact@v4.1.3
with:
path: ./packages/react-native/sdks/hermes/build_xros_${{ matrix.flavor }}
key: v4-hermes-apple-${{ needs.prepare_hermes_workspace.outputs.hermes-version }}-${{ needs.prepare_hermes_workspace.outputs.react-native-version }}-${{ hashfiles('packages/react-native/sdks/hermes-engine/utils/build-apple-framework.sh') }}-xros-${{ matrix.flavor }}
path: ./packages/react-native/sdks/hermes/
name: slice-xros-${{ matrix.flavor }}
- name: Slice cache xrsimulator
if: ${{ steps.check_if_apple_artifacts_are_there.outputs.ARTIFACTS_EXIST != true }}
uses: actions/cache@v4.0.0
if: ${{ steps.check_if_apple_artifacts_are_there.outputs.ARTIFACTS_EXIST != 'true' }}
uses: actions/download-artifact@v4.1.3
with:
path: ./packages/react-native/sdks/hermes/build_xrsimulator_${{ matrix.flavor }}
key: v4-hermes-apple-${{ needs.prepare_hermes_workspace.outputs.hermes-version }}-${{ needs.prepare_hermes_workspace.outputs.react-native-version }}-${{ hashfiles('packages/react-native/sdks/hermes-engine/utils/build-apple-framework.sh') }}-xrsimulator-${{ matrix.flavor }}
path: ./packages/react-native/sdks/hermes/
name: slice-xrsimulator-${{ matrix.flavor }}
- name: Unzip slices
if: ${{ steps.check_if_apple_artifacts_are_there.outputs.ARTIFACTS_EXIST != 'true' }}
run: |
cd ./packages/react-native/sdks/hermes
ls -l .
tar -xzv -f build_catalyst_${{ matrix.flavor }}.tar.gz
tar -xzv -f build_iphoneos_${{ matrix.flavor }}.tar.gz
tar -xzv -f build_iphonesimulator_${{ matrix.flavor }}.tar.gz
tar -xzv -f build_macosx_${{ matrix.flavor }}.tar.gz
tar -xzv -f build_xros_${{ matrix.flavor }}.tar.gz
tar -xzv -f build_xrsimulator_${{ matrix.flavor }}.tar.gz
- name: Move back build folders
if: ${{ steps.check_if_apple_artifacts_are_there.outputs.ARTIFACTS_EXIST != true }}
if: ${{ steps.check_if_apple_artifacts_are_there.outputs.ARTIFACTS_EXIST != 'true' }}
run: |
ls -l ./packages/react-native/sdks/hermes
cd ./packages/react-native/sdks/hermes || exit 1
@@ -298,19 +295,23 @@ jobs:
mv build_xros_${{ matrix.flavor }} build_xros
mv build_xrsimulator_${{ matrix.flavor }} build_xrsimulator
- name: Prepare destroot folder
if: ${{ steps.check_if_apple_artifacts_are_there.outputs.ARTIFACTS_EXIST != true }}
if: ${{ steps.check_if_apple_artifacts_are_there.outputs.ARTIFACTS_EXIST != 'true' }}
run: |
cd ./packages/react-native/sdks/hermes || exit 1
chmod +x ./utils/build-apple-framework.sh
. ./utils/build-apple-framework.sh
prepare_dest_root_for_ci
- name: Create fat framework for iOS
if: ${{ steps.check_if_apple_artifacts_are_there.outputs.ARTIFACTS_EXIST != true }}
if: ${{ steps.check_if_apple_artifacts_are_there.outputs.ARTIFACTS_EXIST != 'true' }}
run: |
cd ./packages/react-native/sdks/hermes || exit 1
echo "[HERMES] Creating the universal framework"
chmod +x ./utils/build-ios-framework.sh
./utils/build-ios-framework.sh build_framework
chmod +x ./destroot/bin/hermesc
- name: Package the Hermes Apple frameworks
if: ${{ steps.check_if_apple_artifacts_are_there.outputs.ARTIFACTS_EXIST != true }}
if: ${{ steps.check_if_apple_artifacts_are_there.outputs.ARTIFACTS_EXIST != 'true' }}
run: |
BUILD_TYPE="${{ matrix.flavor }}"
echo "Packaging Hermes Apple frameworks for $BUILD_TYPE build type"
@@ -334,18 +335,8 @@ jobs:
mkdir -p /tmp/hermes/osx-bin/${{ matrix.flavor }}
cp ./packages/react-native/sdks/hermes/build_macosx/bin/* /tmp/hermes/osx-bin/${{ matrix.flavor }}
ls -lR /tmp/hermes/osx-bin/
- name: Upload darwin artifacts
uses: actions/upload-artifact@v4.3.1
with:
name: hermes-darwin-bin-${{ matrix.flavor }}
path: /tmp/hermes/hermes-runtime-darwin
- name: Upload osx-bin
uses: actions/upload-artifact@v4.3.1
with:
name: hermes-osx-bin-${{ matrix.flavor }}
path: /tmp/hermes/osx-bin
- name: Create dSYM archive
if: ${{ steps.check_if_apple_artifacts_are_there.outputs.ARTIFACTS_EXIST != true }}
if: ${{ steps.check_if_apple_artifacts_are_there.outputs.ARTIFACTS_EXIST != 'true' }}
run: |
FLAVOR=${{ matrix.flavor }}
WORKING_DIR="/tmp/hermes_tmp/dSYM/$FLAVOR"
@@ -377,6 +368,25 @@ jobs:
with:
name: hermes-dSYM-${{ matrix.flavor }}
path: /tmp/hermes/dSYM/${{ matrix.flavor }}
- name: Upload hermes Runtime artifacts
uses: actions/upload-artifact@v4.3.1
with:
name: hermes-darwin-bin-${{ matrix.flavor }}
path: /tmp/hermes/hermes-runtime-darwin/hermes-ios-${{ matrix.flavor }}.tar.gz
- name: Upload hermes osx artifacts
uses: actions/upload-artifact@v4.3.1
with:
name: hermes-osx-bin-${{ matrix.flavor }}
path: /tmp/hermes/osx-bin/${{ matrix.flavor }}
- name: Upload Hermes Artifacts
uses: actions/cache/save@v4.0.0
if: ${{ github.ref == 'refs/heads/main' || contains(github.ref, '-stable') }} # To avoid that the cache explode.
with:
key: v4-hermes-artifacts-${{ matrix.flavor }}-${{ needs.prepare_hermes_workspace.outputs.hermes-version }}-${{ needs.prepare_hermes_workspace.outputs.react-native-version }}
path: |
/tmp/hermes/osx-bin/${{ matrix.flavor }}
/tmp/hermes/dSYM/${{ matrix.flavor }}
/tmp/hermes/hermes-runtime-darwin/hermes-ios-${{ matrix.flavor }}.tar.gz
test_ios_rntester_ruby_3_2_0:
runs-on: macos-13
@@ -446,6 +456,9 @@ jobs:
build_hermesc_linux:
runs-on: ubuntu-latest
needs: prepare_hermes_workspace
env:
HERMES_WS_DIR: /tmp/hermes
HERMES_TARBALL_ARTIFACTS_DIR: /tmp/hermes/hermes-runtime-darwin
steps:
- name: Checkout
uses: actions/checkout@v4.1.1
@@ -454,12 +467,8 @@ jobs:
sudo apt update
sudo apt install -y git openssh-client cmake build-essential \
libreadline-dev libicu-dev jq zip python3
- name: Cache setup
id: cache_setup
uses: ./.github/actions/cache_setup
with:
hermes-version: ${{ needs.prepare_hermes_workspace.outputs.hermes-version }}
react-native-version: ${{ needs.prepare_hermes_workspace.outputs.react-native-version }}
- name: Restore Hermes workspace
uses: ./.github/actions/restore-hermes-workspace
- name: Linux cache
uses: actions/cache@v4.0.0
with:
@@ -483,7 +492,7 @@ jobs:
cp /tmp/hermes/build/bin/hermesc /tmp/hermes/linux64-bin/.
fi
- name: Upload linux artifacts
uses: actions/upload-artifact@v4.3.0
uses: actions/upload-artifact@v4.3.1
with:
name: hermes-linux-bin
path: /tmp/hermes/linux64-bin
@@ -493,18 +502,25 @@ jobs:
needs: prepare_hermes_workspace
env:
HERMES_WS_DIR: 'D:\tmp\hermes'
HERMES_TARBALL_ARTIFACTS_DIR: 'D:\tmp\hermes\hermes-runtime-darwin'
HERMES_OSXBIN_ARTIFACTS_DIR: 'D:\tmp\hermes\osx-bin'
ICU_URL: "https://github.com/unicode-org/icu/releases/download/release-64-2/icu4c-64_2-Win64-MSVC2017.zip"
MSBUILD_DIR: 'C:\Program Files (x86)\Microsoft Visual Studio\2019\BuildTools\MSBuild\Current\Bin'
CMAKE_DIR: 'C:\Program Files\CMake\bin'
steps:
- name: Checkout
uses: actions/checkout@v4.1.1
- name: Cache setup
id: cache_setup
uses: ./.github/actions/cache_setup
- name: Download Previous Artifacts
uses: actions/download-artifact@v4
with:
hermes-version: ${{ needs.prepare_hermes_workspace.outputs.hermes-version }}
react-native-version: ${{ needs.prepare_hermes_workspace.outputs.react-native-version }}
name: hermes-workspace
path: 'D:\tmp\hermes'
- name: Set up workspace
run: |
mkdir -p D:\tmp\hermes\osx-bin
mkdir -p .\packages\react-native\sdks\hermes
cp -r -Force D:\tmp\hermes\hermes\* .\packages\react-native\sdks\hermes\.
cp -r -Force .\packages\react-native\sdks\hermes-engine\utils\* .\packages\react-native\sdks\hermes\.
- name: Windows cache
uses: actions/cache@v4.0.0
with:
@@ -564,7 +580,7 @@ jobs:
Write-Host "Skipping; Clean c:\tmp\hermes\win64-bin to rebuild."
}
- name: Upload windows artifacts
uses: actions/upload-artifact@v4.3.0
uses: actions/upload-artifact@v4.3.1
with:
name: hermes-win64-bin
path: D:\tmp\hermes\win64-bin\
@@ -600,7 +616,7 @@ jobs:
shell: bash
- name: Upload test results
if: ${{ always() }}
uses: actions/upload-artifact@v4.3.0
uses: actions/upload-artifact@v4.3.1
with:
name: build-android-results
compression-level: 1
@@ -610,7 +626,7 @@ jobs:
packages/react-native/ReactAndroid/build/reports
- name: Upload RNTester APK
if: ${{ always() }}
uses: actions/upload-artifact@v4.3.0
uses: actions/upload-artifact@v4.3.1
with:
name: rntester-apk
path: packages/rn-tester/android/app/build/outputs/apk/
@@ -651,12 +667,12 @@ jobs:
uses: actions/download-artifact@v4.1.3
with:
name: hermes-osx-bin-Release
path: /tmp/hermes/osx-bin
path: /tmp/hermes/osx-bin/Release
- name: Download osx-bin debug artifacts
uses: actions/download-artifact@v4.1.3
with:
name: hermes-osx-bin-Debug
path: /tmp/hermes/osx-bin
path: /tmp/hermes/osx-bin/Debug
- name: Download darwin-bin release artifacts
uses: actions/download-artifact@v4.1.3
with:
@@ -689,12 +705,6 @@ jobs:
path: /tmp/hermes/linux64-bin
- name: Show /tmp/hermes directory
run: ls -lR /tmp/hermes
- name: Cache setup
id: cache_setup
uses: ./.github/actions/cache_setup
with:
hermes-version: ${{ needs.prepare_hermes_workspace.outputs.hermes-version }}
react-native-version: ${{ needs.prepare_hermes_workspace.outputs.react-native-version }}
- name: Copy Hermes binaries
shell: bash
run: |
@@ -798,7 +808,7 @@ jobs:
-d "{\"event_type\": \"publish\", \"client_payload\": { \"version\": \"${{ github.ref_name }}\" }}"
test_android_helloworld:
runs-on: ubuntu-latest
runs-on: 4-core-ubuntu
needs: prepare_hermes_workspace
container:
image: reactnativecommunity/react-native-android:latest
+5 -7
View File
@@ -48,8 +48,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.75.0-main",
"@react-native/metro-config": "0.75.0-main",
"@react-native/metro-babel-transformer": "0.75.3",
"@react-native/metro-config": "0.75.3",
"@tsconfig/node18": "1.0.1",
"@types/react": "^18.2.6",
"@typescript-eslint/parser": "^7.1.1",
@@ -60,6 +60,7 @@
"babel-preset-fbjs": "^3.4.0",
"chalk": "^4.0.0",
"clang-format": "^1.8.0",
"commander": "^9.4.1",
"connect": "^3.6.5",
"eslint": "^8.57.0",
"eslint-config-prettier": "^8.5.0",
@@ -92,16 +93,13 @@
"nullthrows": "^1.1.1",
"prettier": "2.8.8",
"prettier-plugin-hermes-parser": "0.22.0",
"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.2"
},
"resolutions": {
"react-is": "19.0.0-rc-fb9a90fa48-20240614"
}
}
+1 -1
View File
@@ -1,6 +1,6 @@
{
"name": "@react-native/assets-registry",
"version": "0.75.0-main",
"version": "0.75.3",
"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.75.0-main",
"version": "0.75.3",
"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.75.0-main"
"@react-native/codegen": "0.75.3"
},
"devDependencies": {
"@babel/core": "^7.20.0"
+5 -6
View File
@@ -1,6 +1,6 @@
{
"name": "@react-native/community-cli-plugin",
"version": "0.75.0-main",
"version": "0.75.3",
"description": "Core CLI commands for React Native",
"keywords": [
"react-native",
@@ -22,17 +22,16 @@
"dist"
],
"dependencies": {
"@react-native-community/cli-server-api": "14.0.0-alpha.2",
"@react-native-community/cli-tools": "14.0.0-alpha.2",
"@react-native/dev-middleware": "0.75.0-main",
"@react-native/metro-babel-transformer": "0.75.0-main",
"@react-native-community/cli-server-api": "14.1.0",
"@react-native-community/cli-tools": "14.1.0",
"@react-native/dev-middleware": "0.75.3",
"@react-native/metro-babel-transformer": "0.75.3",
"chalk": "^4.0.0",
"execa": "^5.1.1",
"metro": "^0.80.3",
"metro-config": "^0.80.3",
"metro-core": "^0.80.3",
"node-fetch": "^2.2.0",
"querystring": "^0.2.1",
"readline": "^1.3.0"
},
"devDependencies": {
@@ -9,8 +9,6 @@
* @oncall react_native
*/
import querystring from 'querystring';
export default function parseKeyValueParamArray(
keyValueArray: $ReadOnlyArray<string>,
): Record<string, string> {
@@ -23,8 +21,11 @@ export default function parseKeyValueParamArray(
if (item.indexOf('&') !== -1) {
throw new Error('Parameter cannot include "&" but found: ' + item);
}
Object.assign(result, querystring.parse(item));
const params = new URLSearchParams(item);
params.forEach((value, key) => {
// $FlowExpectedError[prop-missing]
result[key] = value;
});
}
return result;
}
+1 -1
View File
@@ -1,6 +1,6 @@
{
"name": "@react-native/core-cli-utils",
"version": "0.75.0-main",
"version": "0.75.3",
"description": "React Native CLI library for Frameworks to build on",
"license": "MIT",
"main": "./src/index.flow.js",
+1 -1
View File
@@ -1,6 +1,6 @@
{
"name": "@react-native/debugger-frontend",
"version": "0.75.0-main",
"version": "0.75.3",
"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.75.0-main",
"version": "0.75.3",
"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.75.0-main",
"@react-native/debugger-frontend": "0.75.3",
"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.75.0-main",
"version": "0.75.3",
"description": "ESLint config for React Native",
"license": "MIT",
"repository": {
@@ -22,7 +22,7 @@
"dependencies": {
"@babel/core": "^7.20.0",
"@babel/eslint-parser": "^7.20.0",
"@react-native/eslint-plugin": "0.75.0-main",
"@react-native/eslint-plugin": "0.75.3",
"@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.75.0-main",
"version": "0.75.3",
"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.75.0-main",
"version": "0.75.3",
"description": "ESLint rules to validate NativeModule and Component Specs",
"license": "MIT",
"repository": {
@@ -31,7 +31,7 @@
"@babel/eslint-parser": "^7.20.0",
"@babel/plugin-transform-flow-strip-types": "^7.20.0",
"@babel/preset-flow": "^7.20.0",
"@react-native/codegen": "0.75.0-main",
"@react-native/codegen": "0.75.3",
"make-dir": "^2.1.0",
"pirates": "^4.0.1",
"source-map-support": "0.5.0"
+1
View File
@@ -2,6 +2,7 @@
"reactNativePath": "REACT_NATIVE_PATH",
"reactNativeVersion": "1000.0.0",
"root": "HELLOWORLD_PATH",
"dependencies": {},
"platforms": {
"ios": {},
"android": {}
+2 -1
View File
@@ -5,10 +5,11 @@
* LICENSE file in the root directory of this source tree.
*/
// Autolinking has now moved into the React Native Gradle Plugin
pluginManagement { includeBuild("../../react-native-gradle-plugin") }
plugins { id("com.facebook.react.settings") }
extensions.configure(com.facebook.react.ReactSettingsExtension){ ex -> ex.autolinkLibrariesFromCommand() }
extensions.configure(com.facebook.react.ReactSettingsExtension){ ex -> ex.autolinkLibrariesFromCommand(["/bin/sh", "./scripts/config.sh"]) }
rootProject.name = 'HelloWorld'
include ':app'
+1 -1
View File
@@ -10,7 +10,7 @@ if linkage != nil
end
target 'HelloWorld' do
config = use_native_modules!
config = use_native_modules!(['sh', '../scripts/config.sh'])
use_react_native!(
:path => "../../react-native",
+9 -9
View File
@@ -1,6 +1,6 @@
{
"name": "helloworld",
"version": "0.75.0-main",
"version": "0.75.3",
"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.75.3"
},
"devDependencies": {
"@babel/core": "^7.20.0",
"@babel/preset-env": "^7.20.0",
"@babel/runtime": "^7.20.0",
"@react-native/babel-preset": "0.75.0-main",
"@react-native/core-cli-utils": "0.75.0-main",
"@react-native/eslint-config": "0.75.0-main",
"@react-native/metro-config": "0.75.0-main",
"@react-native/babel-preset": "0.75.3",
"@react-native/core-cli-utils": "0.75.3",
"@react-native/eslint-config": "0.75.3",
"@react-native/metro-config": "0.75.3",
"babel-jest": "^29.6.3",
"chalk": "^4.1.2",
"commander": "^12.0.0",
"commander": "^9.4.1",
"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": {
+14
View File
@@ -0,0 +1,14 @@
#!/bin/bash
# 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.
set -e
script_dir=$(dirname "$(readlink -f "$0")")
HELLOWORLD_PATH=$(realpath ../)
REACT_NATIVE_PATH=$(realpath ../../react-native)
sed -e "s|HELLOWORLD_PATH|$HELLOWORLD_PATH|g" -e "s|REACT_NATIVE_PATH|$REACT_NATIVE_PATH|g" "$script_dir/../.react-native.config"
@@ -1,6 +1,6 @@
{
"name": "@react-native/hermes-inspector-msggen",
"version": "0.75.0-main",
"version": "0.75.3",
"private": true,
"description": "Hermes Inspector Message Generator for React Native",
"license": "MIT",
+3 -3
View File
@@ -1,6 +1,6 @@
{
"name": "@react-native/metro-config",
"version": "0.75.0-main",
"version": "0.75.3",
"description": "Metro configuration for React Native.",
"license": "MIT",
"repository": {
@@ -26,8 +26,8 @@
"dist"
],
"dependencies": {
"@react-native/js-polyfills": "0.75.0-main",
"@react-native/metro-babel-transformer": "0.75.0-main",
"@react-native/js-polyfills": "0.75.3",
"@react-native/metro-babel-transformer": "0.75.3",
"metro-config": "^0.80.3",
"metro-runtime": "^0.80.3"
}
+1 -1
View File
@@ -1,6 +1,6 @@
{
"name": "@react-native/normalize-colors",
"version": "0.75.0-main",
"version": "0.75.3",
"description": "Color normalization for React Native.",
"license": "MIT",
"repository": {
+1 -1
View File
@@ -1,6 +1,6 @@
{
"name": "@react-native/js-polyfills",
"version": "0.75.0-main",
"version": "0.75.3",
"description": "Polyfills for React Native.",
"license": "MIT",
"repository": {
@@ -1,6 +1,6 @@
{
"name": "@react-native/babel-preset",
"version": "0.75.0-main",
"version": "0.75.3",
"description": "Babel preset for React Native applications",
"main": "src/index.js",
"repository": {
@@ -56,7 +56,7 @@
"@babel/plugin-transform-typescript": "^7.5.0",
"@babel/plugin-transform-unicode-regex": "^7.0.0",
"@babel/template": "^7.0.0",
"@react-native/babel-plugin-codegen": "0.75.0-main",
"@react-native/babel-plugin-codegen": "0.75.3",
"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.75.0-main",
"version": "0.75.3",
"description": "Babel transformer for React Native applications.",
"main": "src/index.js",
"repository": {
@@ -16,7 +16,7 @@
"license": "MIT",
"dependencies": {
"@babel/core": "^7.20.0",
"@react-native/babel-preset": "0.75.0-main",
"@react-native/babel-preset": "0.75.3",
"hermes-parser": "0.22.0",
"nullthrows": "^1.1.1"
},
+1 -1
View File
@@ -1,7 +1,7 @@
{
"name": "@react-native/bots",
"description": "React Native Bots",
"version": "0.75.0-main",
"version": "0.75.3",
"private": true,
"license": "MIT",
"repository": {
@@ -1,6 +1,6 @@
{
"name": "@react-native/codegen-typescript-test",
"version": "0.75.0-main",
"version": "0.75.3",
"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.75.0-main"
"@react-native/codegen": "0.75.3"
},
"devDependencies": {
"@babel/core": "^7.20.0",
+4 -4
View File
@@ -1,6 +1,6 @@
{
"name": "@react-native/codegen",
"version": "0.75.0-main",
"version": "0.75.3",
"description": "Code generation tools for React Native",
"license": "MIT",
"repository": {
@@ -35,7 +35,8 @@
"invariant": "^2.2.4",
"jscodeshift": "^0.14.0",
"mkdirp": "^0.5.1",
"nullthrows": "^1.1.1"
"nullthrows": "^1.1.1",
"yargs": "^17.6.2"
},
"devDependencies": {
"@babel/core": "^7.20.0",
@@ -52,8 +53,7 @@
"hermes-estree": "0.22.0",
"micromatch": "^4.0.4",
"prettier": "2.8.8",
"rimraf": "^3.0.2",
"yargs": "^17.6.2"
"rimraf": "^3.0.2"
},
"peerDependencies": {
"@babel/preset-env": "^7.1.6"
@@ -136,11 +136,11 @@ function translateFunctionParamToJavaType(
case 'NumberTypeAnnotation':
return wrapOptional('double', isRequired);
case 'FloatTypeAnnotation':
return wrapOptional('float', isRequired);
return wrapOptional('double', isRequired);
case 'DoubleTypeAnnotation':
return wrapOptional('double', isRequired);
case 'Int32TypeAnnotation':
return wrapOptional('int', isRequired);
return wrapOptional('double', isRequired);
case 'BooleanTypeAnnotation':
return wrapOptional('boolean', isRequired);
case 'EnumDeclaration':
@@ -334,9 +334,9 @@ function translateReturnTypeToJniType(
case 'DoubleTypeAnnotation':
return nullable ? 'Ljava/lang/Double;' : 'D';
case 'FloatTypeAnnotation':
return nullable ? 'Ljava/lang/Float;' : 'F';
return nullable ? 'Ljava/lang/Double;' : 'D';
case 'Int32TypeAnnotation':
return nullable ? 'Ljava/lang/Integer;' : 'I';
return nullable ? 'Ljava/lang/Double;' : 'D';
case 'PromiseTypeAnnotation':
return 'Lcom/facebook/react/bridge/Promise;';
case 'GenericObjectTypeAnnotation':
@@ -2,3 +2,4 @@ build/
app-plugin/build/
settings-plugin/build/
shared/build/
shared-testutil/build/
@@ -5,6 +5,7 @@ guava = "31.0.1-jre"
javapoet = "1.13.0"
junit = "4.13.2"
kotlin = "1.9.24"
assertj = "3.25.1"
[libraries]
kotlin-gradle-plugin = { module = "org.jetbrains.kotlin:kotlin-gradle-plugin", version.ref = "kotlin" }
@@ -13,6 +14,7 @@ gson = { module = "com.google.code.gson:gson", version.ref = "gson" }
guava = { module = "com.google.guava:guava", version.ref = "guava" }
javapoet = { module = "com.squareup:javapoet", version.ref = "javapoet" }
junit = {module = "junit:junit", version.ref = "junit" }
assertj = { module = "org.assertj:assertj-core", version.ref = "assertj" }
[plugins]
kotlin-jvm = { id = "org.jetbrains.kotlin.jvm", version.ref = "kotlin" }
@@ -1,6 +1,6 @@
{
"name": "@react-native/gradle-plugin",
"version": "0.75.0-main",
"version": "0.75.3",
"description": "Gradle Plugin for React Native",
"license": "MIT",
"repository": {
@@ -32,6 +32,7 @@
"README.md",
"react-native-gradle-plugin",
"settings-plugin",
"shared"
"shared",
"shared-testutil"
]
}
@@ -7,7 +7,6 @@
import org.gradle.api.internal.classpath.ModuleRegistry
import org.gradle.api.tasks.testing.logging.TestExceptionFormat
import org.gradle.configurationcache.extensions.serviceOf
import org.jetbrains.kotlin.gradle.tasks.KotlinCompile
plugins {
@@ -50,14 +49,8 @@ dependencies {
implementation(libs.javapoet)
testImplementation(libs.junit)
testRuntimeOnly(
files(
serviceOf<ModuleRegistry>()
.getModule("gradle-tooling-api-builders")
.classpath
.asFiles
.first()))
testImplementation(libs.assertj)
testImplementation(project(":shared-testutil"))
}
// We intentionally don't build for Java 17 as users will see a cryptic bytecode version
@@ -184,19 +184,24 @@ abstract class ReactExtension @Inject constructor(val project: Project) {
internal fun getGradleDependenciesToApply(inputFile: File): MutableList<Pair<String, String>> {
val model = JsonUtils.fromAutolinkingConfigJson(inputFile)
val result = mutableListOf<Pair<String, String>>()
model?.dependencies?.values?.forEach { deps ->
val nameCleansed = deps.nameCleansed
val dependencyConfiguration = deps.platforms?.android?.dependencyConfiguration
val buildTypes = deps.platforms?.android?.buildTypes ?: emptyList()
if (buildTypes.isEmpty()) {
result.add((dependencyConfiguration ?: "implementation") to ":$nameCleansed")
} else {
buildTypes.forEach { buildType ->
result.add(
(dependencyConfiguration ?: "${buildType}Implementation") to ":$nameCleansed")
model
?.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
val buildTypes = deps.platforms?.android?.buildTypes ?: emptyList()
if (buildTypes.isEmpty()) {
result.add((dependencyConfiguration ?: "implementation") to ":$nameCleansed")
} else {
buildTypes.forEach { buildType ->
result.add(
(dependencyConfiguration ?: "${buildType}Implementation") to ":$nameCleansed")
}
}
}
}
}
return result
}
}
@@ -85,6 +85,8 @@ abstract class GeneratePackageListTask : DefaultTask() {
val packages = model?.dependencies?.values ?: emptyList()
return packages
.filter { it.platforms?.android != null }
// The pure C++ dependencies won't have a .java/.kt file to import
.filterNot { it.platforms?.android?.isPureCxxDependency == true }
.associate { it.name to checkNotNull(it.platforms?.android) }
}
@@ -113,6 +113,7 @@ internal object NdkConfiguratorUtils {
"**/libreact_utils.so",
"**/librrc_image.so",
"**/librrc_legacyviewmanagerinterop.so",
"**/librrc_textinput.so",
"**/librrc_view.so",
"**/libruntimeexecutor.so",
"**/libturbomodulejsijni.so",
@@ -8,8 +8,8 @@
package com.facebook.react
import com.facebook.react.ReactExtension.Companion.getGradleDependenciesToApply
import org.assertj.core.api.Assertions.assertThat
import org.intellij.lang.annotations.Language
import org.junit.Assert.*
import org.junit.Rule
import org.junit.Test
import org.junit.rules.TemporaryFolder
@@ -30,7 +30,7 @@ class ReactExtensionTest {
.trimIndent())
val deps = getGradleDependenciesToApply(validJsonFile)
assertEquals(0, deps.size)
assertThat(deps).isEmpty()
}
@Test
@@ -57,8 +57,7 @@ class ReactExtensionTest {
.trimIndent())
val deps = getGradleDependenciesToApply(validJsonFile)
assertEquals(1, deps.size)
assertTrue("implementation" to ":react-native_oss-library-example" in deps)
assertThat(deps).containsExactly("implementation" to ":react-native_oss-library-example")
}
@Test
@@ -86,8 +85,7 @@ class ReactExtensionTest {
.trimIndent())
val deps = getGradleDependenciesToApply(validJsonFile)
assertEquals(1, deps.size)
assertTrue("compileOnly" to ":react-native_oss-library-example" in deps)
assertThat(deps).containsExactly("compileOnly" to ":react-native_oss-library-example")
}
@Test
@@ -115,9 +113,10 @@ class ReactExtensionTest {
.trimIndent())
val deps = getGradleDependenciesToApply(validJsonFile)
assertEquals(2, deps.size)
assertTrue("debugImplementation" to ":react-native_oss-library-example" in deps)
assertTrue("releaseImplementation" to ":react-native_oss-library-example" in deps)
assertThat(deps)
.containsExactly(
"debugImplementation" to ":react-native_oss-library-example",
"releaseImplementation" to ":react-native_oss-library-example")
}
@Test
@@ -154,9 +153,78 @@ class ReactExtensionTest {
.trimIndent())
val deps = getGradleDependenciesToApply(validJsonFile)
assertEquals(2, deps.size)
assertTrue("implementation" to ":react-native_oss-library-example" in deps)
assertTrue("implementation" to ":react-native_another-library-for-testing" in deps)
assertThat(deps)
.containsExactly(
"implementation" to ":react-native_oss-library-example",
"implementation" to ":react-native_another-library-for-testing")
}
@Test
fun getGradleDependenciesToApply_withiOSOnlyLibrary_returnsEmptyDepsMap() {
val validJsonFile =
createJsonFile(
"""
{
"reactNativeVersion": "1000.0.0",
"dependencies": {
"@react-native/oss-library-example": {
"root": "./node_modules/@react-native/oss-library-example",
"name": "@react-native/oss-library-example",
"platforms": {
"ios": {
"podspecPath": "./node_modules/@react-native/oss-library-example/oss-library-example.podspec",
"version": "0.0.0",
"configurations": [],
"scriptPhases": []
},
"android": null
}
}
}
}
"""
.trimIndent())
val deps = getGradleDependenciesToApply(validJsonFile)
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) =
@@ -177,6 +177,33 @@ class GeneratePackageListTaskTest {
assertEquals(android, result["a-dependency"])
}
@Test
fun filterAndroidPackages_withIsPureCxxDependencyObject_returnsIt() {
val task = createTestTask<GeneratePackageListTask>()
val android =
ModelAutolinkingDependenciesPlatformAndroidJson(
sourceDir = "./a/directory/android",
packageImportPath = "import com.facebook.react.aPackage;",
packageInstance = "new APackage()",
buildTypes = emptyList(),
isPureCxxDependency = true)
val result =
task.filterAndroidPackages(
ModelAutolinkingConfigJson(
reactNativeVersion = "1000.0.0",
dependencies =
mapOf(
"a-pure-cxx-dependency" to
ModelAutolinkingDependenciesJson(
root = "./a/directory",
name = "a-pure-cxx-dependency",
platforms =
ModelAutolinkingDependenciesPlatformJson(android = android))),
project = null))
assertEquals(emptyMap<String, ModelAutolinkingDependenciesPlatformAndroidJson>(), result)
}
@Test
fun composeFileContent_withNoPackages_returnsValidFile() {
val task = createTestTask<GeneratePackageListTask>()
@@ -7,7 +7,6 @@
import org.gradle.api.internal.classpath.ModuleRegistry
import org.gradle.api.tasks.testing.logging.TestExceptionFormat
import org.gradle.configurationcache.extensions.serviceOf
import org.jetbrains.kotlin.gradle.tasks.KotlinCompile
plugins {
@@ -40,14 +39,7 @@ dependencies {
implementation(libs.javapoet)
testImplementation(libs.junit)
testRuntimeOnly(
files(
serviceOf<ModuleRegistry>()
.getModule("gradle-tooling-api-builders")
.classpath
.asFiles
.first()))
testImplementation(project(":shared-testutil"))
}
// We intentionally don't build for Java 17 as users will see a cryptic bytecode version
@@ -7,14 +7,18 @@
package com.facebook.react
import com.facebook.react.model.ModelAutolinkingConfigJson
import com.facebook.react.utils.JsonUtils
import com.facebook.react.utils.windowsAwareCommandLine
import java.io.File
import java.math.BigInteger
import java.security.MessageDigest
import java.util.concurrent.TimeUnit
import javax.inject.Inject
import org.gradle.api.GradleException
import org.gradle.api.file.FileCollection
import org.gradle.api.initialization.Settings
import org.gradle.api.logging.Logging
abstract class ReactSettingsExtension @Inject constructor(val settings: Settings) {
@@ -23,6 +27,11 @@ abstract class ReactSettingsExtension @Inject constructor(val settings: Settings
private val outputFolder =
settings.layout.rootDirectory.file("build/generated/autolinking/").asFile
private val defaultConfigCommand: List<String> =
windowsAwareCommandLine(listOf("npx", "@react-native-community/cli", "config")).map {
it.toString()
}
/**
* Utility function to autolink libraries using an external command as source of truth.
*
@@ -37,23 +46,30 @@ abstract class ReactSettingsExtension @Inject constructor(val settings: Settings
*/
@JvmOverloads
public fun autolinkLibrariesFromCommand(
command: List<String> = listOf("npx", "@react-native-community/cli", "config"),
command: List<String> = defaultConfigCommand,
workingDirectory: File? = settings.layout.rootDirectory.dir("../").asFile,
lockFiles: FileCollection =
settings.layout.rootDirectory
.dir("../")
.files("yarn.lock", "package-lock.json", "package.json")
.files("yarn.lock", "package-lock.json", "package.json", "react-native.config.js")
) {
outputFile.parentFile.mkdirs()
val lockFilesChanged = checkAndUpdateLockfiles(lockFiles, outputFolder)
if (lockFilesChanged || outputFile.exists().not()) {
ProcessBuilder(command)
.directory(workingDirectory)
.redirectOutput(ProcessBuilder.Redirect.to(outputFile))
.redirectError(ProcessBuilder.Redirect.INHERIT)
.start()
.waitFor(5, TimeUnit.MINUTES)
}
val updateConfig =
object : GenerateConfig {
private val pb =
ProcessBuilder(command)
.directory(workingDirectory)
.redirectOutput(ProcessBuilder.Redirect.to(outputFile))
.redirectError(ProcessBuilder.Redirect.INHERIT)
override fun command(): List<String> = pb.command()
override fun start(): Process = pb.start()
}
checkAndUpdateCache(updateConfig, outputFile, outputFolder, lockFiles)
linkLibraries(getLibrariesToAutolink(outputFile))
}
@@ -84,9 +100,73 @@ abstract class ReactSettingsExtension @Inject constructor(val settings: Settings
}
}
internal interface GenerateConfig {
fun command(): List<String>
fun start(): Process
}
companion object {
private val md = MessageDigest.getInstance("SHA-256")
/**
* Determine if our cache is out-of-date
*
* @param cacheJsonConfig Our current cached autolinking.json config, which may exist
* @param cacheFolder The folder we store our cached SHAs and config
* @param lockFiles The [FileCollection] of the lockfiles to check.
* @return `true` if the cache needs to be rebuilt, `false` otherwise
*/
internal fun isCacheDirty(
cacheJsonConfig: File,
cacheFolder: File,
lockFiles: FileCollection,
): Boolean {
if (cacheJsonConfig.exists().not() || cacheJsonConfig.length() == 0L) {
return true
}
val lockFilesChanged = checkAndUpdateLockfiles(lockFiles, cacheFolder)
if (lockFilesChanged) {
return true
}
return isConfigModelInvalid(JsonUtils.fromAutolinkingConfigJson(cacheJsonConfig))
}
/**
* Utility function to update the settings cache only if it's entries are dirty
*
* @param updateJsonConfig A [GenerateConfig] to update the project's autolinking config
* @param cacheJsonConfig Our current cached autolinking.json config, which may exist
* @param cacheFolder The folder we store our cached SHAs and config
* @param lockFiles The [FileCollection] of the lockfiles to check.
*/
internal fun checkAndUpdateCache(
updateJsonConfig: GenerateConfig,
cacheJsonConfig: File,
cacheFolder: File,
lockFiles: FileCollection,
) {
if (isCacheDirty(cacheJsonConfig, cacheFolder, lockFiles)) {
val process = updateJsonConfig.start()
val finished = process.waitFor(5, TimeUnit.MINUTES)
if (!finished || (process.exitValue() != 0)) {
val command = updateJsonConfig.command().joinToString(" ")
val prefixCommand = "ERROR: autolinkLibrariesFromCommand: process $command"
val message =
if (!finished) "$prefixCommand timed out"
else "$prefixCommand exited with error code: ${process.exitValue()}"
val logger = Logging.getLogger("ReactSettingsExtension")
logger.error(message)
if (cacheJsonConfig.length() != 0L) {
logger.error(cacheJsonConfig.readText().substring(0, 1024))
}
cacheJsonConfig.delete()
throw GradleException(message)
}
}
}
/**
* Utility function to check if the provided lockfiles have been updated or not. This function
* will both check and update the lockfiles hashes if necessary.
@@ -112,12 +192,23 @@ abstract class ReactSettingsExtension @Inject constructor(val settings: Settings
internal fun getLibrariesToAutolink(buildFile: File): Map<String, File> {
val model = JsonUtils.fromAutolinkingConfigJson(buildFile)
return model?.dependencies?.values?.associate { deps ->
":${deps.nameCleansed}" to File(deps.platforms?.android?.sourceDir)
} ?: emptyMap()
return model
?.dependencies
?.values
// We handle scenarios where there are deps that are
// iOS-only or missing the Android configs.
?.filter { it.platforms?.android?.sourceDir != null }
// We want to skip dependencies that are pure C++ as they won't contain a .gradle file.
?.filterNot { it.platforms?.android?.isPureCxxDependency == true }
?.associate { deps ->
":${deps.nameCleansed}" to File(deps.platforms?.android?.sourceDir)
} ?: emptyMap()
}
internal fun computeSha256(lockFile: File) =
String.format("%032x", BigInteger(1, md.digest(lockFile.readBytes())))
internal fun isConfigModelInvalid(model: ModelAutolinkingConfigJson?) =
model?.project?.android?.packageName == null
}
}
@@ -7,10 +7,12 @@
package com.facebook.react
import com.facebook.react.ReactSettingsExtension.Companion.checkAndUpdateCache
import com.facebook.react.ReactSettingsExtension.Companion.checkAndUpdateLockfiles
import com.facebook.react.ReactSettingsExtension.Companion.computeSha256
import com.facebook.react.ReactSettingsExtension.Companion.getLibrariesToAutolink
import groovy.test.GroovyTestCase.assertEquals
import com.facebook.react.ReactSettingsExtension.GenerateConfig
import java.io.File
import org.gradle.testfixtures.ProjectBuilder
import org.intellij.lang.annotations.Language
@@ -86,7 +88,8 @@ class ReactSettingsExtensionTest {
"cxxModuleCMakeListsModuleName": null,
"cxxModuleCMakeListsPath": null,
"cxxModuleHeaderName": null,
"dependencyConfiguration": "implementation"
"dependencyConfiguration": "implementation",
"isPureCxxDependency": false
}
}
}
@@ -103,6 +106,35 @@ class ReactSettingsExtensionTest {
map[":react-native_oss-library-example"])
}
@Test
fun getLibrariesToAutolink_withiOSOnlyLibrary_returnsEmptyMap() {
val validJsonFile =
createJsonFile(
"""
{
"reactNativeVersion": "1000.0.0",
"dependencies": {
"@react-native/oss-library-example": {
"root": "./node_modules/@react-native/oss-library-example",
"name": "@react-native/oss-library-example",
"platforms": {
"ios": {
"podspecPath": "./node_modules/@react-native/oss-library-example/OSSLibraryExample.podspec",
"version": "0.0.1",
"configurations": [],
"scriptPhases": []
}
}
}
}
}
"""
.trimIndent())
val map = getLibrariesToAutolink(validJsonFile)
assertEquals(0, map.keys.size)
}
@Test
fun checkAndUpdateLockfiles_withNothingToCheck_returnsFalse() {
val project = ProjectBuilder.builder().build()
@@ -206,6 +238,241 @@ class ReactSettingsExtensionTest {
File(buildFolder, "package-lock.json.sha").readText())
}
@Test
fun skipUpdateIfConfigInCacheIsValid() {
val project = ProjectBuilder.builder().withProjectDir(tempFolder.root).build()
val buildFolder = tempFolder.newFolder("build")
val generatedFolder = tempFolder.newFolder("build", "generated")
val outputFile =
File(generatedFolder, "autolinking.json").apply {
writeText(
"""
{
"root": "/",
"reactNativePath": "/node_modules/react-native",
"reactNativeVersion": "0.75",
"dependencies": {},
"healthChecks": [],
"platforms": {
"ios": {},
"android": {}
},
"assets": [],
"project": {
"ios": {},
"android": {
"sourceDir": "/",
"appName": "app",
"packageName": "com.TestApp",
"applicationId": "com.TestApp",
"mainActivity": ".MainActivity",
"assets": []
}
}
}
"""
.trimIndent())
}
tempFolder.newFile("yarn.lock").apply { writeText("I'm a lockfile") }
val lockfileCollection = project.files("yarn.lock")
// Prebuild the shas with the invalid empty autolinking.json
checkAndUpdateLockfiles(lockfileCollection, buildFolder)
val monitoredUpdateConfig = createMonitoredUpdateConfig()
checkAndUpdateCache(monitoredUpdateConfig, outputFile, buildFolder, lockfileCollection)
// The autolinking.json file is valid, SHA's are untouched therefore config should NOT be
// refreshed
assertThat(monitoredUpdateConfig.run).isFalse()
}
@Test
fun checkAndUpdateConfigIfEmpty() {
val project = ProjectBuilder.builder().withProjectDir(tempFolder.root).build()
val buildFolder = tempFolder.newFolder("build")
val generatedFolder = tempFolder.newFolder("build", "generated")
val outputFile = File(generatedFolder, "autolinking.json").apply { writeText("") }
tempFolder.newFile("yarn.lock").apply { writeText("I'm a lockfile") }
val lockfileCollection = project.files("yarn.lock")
// Prebuild the shas with the invalid empty autolinking.json
checkAndUpdateLockfiles(lockfileCollection, buildFolder)
val monitoredUpdateConfig = createMonitoredUpdateConfig()
checkAndUpdateCache(monitoredUpdateConfig, outputFile, buildFolder, lockfileCollection)
// The autolinking.json file is invalid and should be refreshed
assertThat(monitoredUpdateConfig.run).isTrue()
}
@Test
fun checkAndUpdateConfigIfCachedConfigInvalid() {
val project = ProjectBuilder.builder().withProjectDir(tempFolder.root).build()
val buildFolder = tempFolder.newFolder("build")
val generatedFolder = tempFolder.newFolder("build", "generated")
val outputFile =
File(generatedFolder, "autolinking.json").apply {
writeText(
"""
{
"project": {
"ios": {},
"android": {}
}
}
"""
.trimIndent())
}
tempFolder.newFile("yarn.lock").apply { writeText("I'm a lockfile") }
val lockfileCollection = project.files("yarn.lock")
// Prebuild the shas with the invalid empty autolinking.json
checkAndUpdateLockfiles(lockfileCollection, buildFolder)
val monitoredUpdateConfig = createMonitoredUpdateConfig()
checkAndUpdateCache(monitoredUpdateConfig, outputFile, buildFolder, lockfileCollection)
// The autolinking.json file is invalid and should be refreshed
assertThat(monitoredUpdateConfig.run).isTrue()
}
@Test
fun isCacheDirty_withMissingAutolinkingFile_returnsTrue() {
val project = ProjectBuilder.builder().withProjectDir(tempFolder.root).build()
val buildFolder =
tempFolder.newFolder("build").apply {
File(this, "yarn.lock.sha")
.writeText("76046b72442ee7eb130627e56c3db7c9907eef4913b17ad130335edc0eb702a8")
}
tempFolder.newFile("yarn.lock").apply { writeText("I'm a lockfile") }
val lockfiles = project.files("yarn.lock")
val emptyConfigFile = File(tempFolder.newFolder("build", "autolinking"), "autolinking.json")
assertThat(ReactSettingsExtension.isCacheDirty(emptyConfigFile, buildFolder, lockfiles))
.isTrue()
}
@Test
fun isCacheDirty_withInvalidAutolinkingFile_returnsTrue() {
val project = ProjectBuilder.builder().withProjectDir(tempFolder.root).build()
val buildFolder =
tempFolder.newFolder("build").apply {
File(this, "yarn.lock.sha")
.writeText("76046b72442ee7eb130627e56c3db7c9907eef4913b17ad130335edc0eb702a8")
}
tempFolder.newFile("yarn.lock").apply { writeText("I'm a lockfile") }
val lockfiles = project.files("yarn.lock")
val invalidConfigFile =
createJsonFile(
"""
{}
"""
.trimIndent())
assertThat(ReactSettingsExtension.isCacheDirty(invalidConfigFile, buildFolder, lockfiles))
.isTrue()
}
@Test
fun isCacheDirty_withMissingDependenciesInJson_returnsFalse() {
val project = ProjectBuilder.builder().withProjectDir(tempFolder.root).build()
val buildFolder =
tempFolder.newFolder("build").apply {
File(this, "yarn.lock.sha")
.writeText("76046b72442ee7eb130627e56c3db7c9907eef4913b17ad130335edc0eb702a8")
}
tempFolder.newFile("yarn.lock").apply { writeText("I'm a lockfile") }
val lockfiles = project.files("yarn.lock")
val invalidConfigFile =
createJsonFile(
"""
{
"reactNativeVersion": "1000.0.0"
}
"""
.trimIndent())
assertThat(ReactSettingsExtension.isCacheDirty(invalidConfigFile, buildFolder, lockfiles))
.isTrue()
}
@Test
fun isCacheDirty_withExistingEmptyDependenciesInJson_returnsTrue() {
val project = ProjectBuilder.builder().withProjectDir(tempFolder.root).build()
val buildFolder =
tempFolder.newFolder("build").apply {
File(this, "yarn.lock.sha")
.writeText("76046b72442ee7eb130627e56c3db7c9907eef4913b17ad130335edc0eb702a8")
}
tempFolder.newFile("yarn.lock").apply { writeText("I'm a lockfile") }
val lockfiles = project.files("yarn.lock")
val invalidConfigFile =
createJsonFile(
"""
{
"reactNativeVersion": "1000.0.0",
"dependencies": {}
}
"""
.trimIndent())
assertThat(ReactSettingsExtension.isCacheDirty(invalidConfigFile, buildFolder, lockfiles))
.isTrue()
}
@Test
fun isCacheDirty_withExistingDependenciesInJson_returnsTrue() {
val project = ProjectBuilder.builder().withProjectDir(tempFolder.root).build()
val buildFolder =
tempFolder.newFolder("build").apply {
File(this, "yarn.lock.sha")
.writeText("76046b72442ee7eb130627e56c3db7c9907eef4913b17ad130335edc0eb702a8")
}
tempFolder.newFile("yarn.lock").apply { writeText("I'm a lockfile") }
val lockfiles = project.files("yarn.lock")
val invalidConfigFile =
createJsonFile(
"""
{
"reactNativeVersion": "1000.0.0",
"dependencies": {
"@react-native/oss-library-example": {
"root": "./node_modules/@react-native/oss-library-example",
"name": "@react-native/oss-library-example",
"platforms": {
"ios": {
"podspecPath": "./node_modules/@react-native/oss-library-example/OSSLibraryExample.podspec",
"version": "0.0.1",
"configurations": [],
"scriptPhases": []
}
}
}
}
}
"""
.trimIndent())
assertThat(ReactSettingsExtension.isCacheDirty(invalidConfigFile, buildFolder, lockfiles))
.isTrue()
}
private fun createJsonFile(@Language("JSON") input: String) =
tempFolder.newFile().apply { writeText(input) }
private fun createMonitoredUpdateConfig() =
object : GenerateConfig {
var run = false
override fun start(): Process {
run = true
return ProcessBuilder("true").start()
}
override fun command(): List<String> = listOf("true")
}
}
@@ -19,6 +19,7 @@ include(
":react-native-gradle-plugin",
":settings-plugin",
":shared",
":shared-testutil",
)
rootProject.name = "gradle-plugins-root"
@@ -0,0 +1,38 @@
/*
* 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.
*/
import org.gradle.api.tasks.testing.logging.TestExceptionFormat
import org.jetbrains.kotlin.gradle.tasks.KotlinCompile
plugins { alias(libs.plugins.kotlin.jvm) }
repositories { mavenCentral() }
group = "com.facebook.react"
dependencies { implementation(libs.junit) }
java { targetCompatibility = JavaVersion.VERSION_11 }
kotlin { jvmToolchain(17) }
tasks.withType<KotlinCompile>().configureEach {
kotlinOptions {
apiVersion = "1.6"
jvmTarget = "11"
allWarningsAsErrors = true
}
}
tasks.withType<Test>().configureEach {
testLogging {
exceptionFormat = TestExceptionFormat.FULL
showExceptions = true
showCauses = true
showStackTraces = true
}
}
@@ -18,6 +18,7 @@ dependencies {
implementation(libs.gson)
implementation(libs.guava)
testImplementation(libs.junit)
testImplementation(project(":shared-testutil"))
}
java { targetCompatibility = JavaVersion.VERSION_11 }
@@ -18,5 +18,6 @@ data class ModelAutolinkingDependenciesPlatformAndroidJson(
val cxxModuleCMakeListsModuleName: String? = null,
val cxxModuleCMakeListsPath: String? = null,
val cxxModuleHeaderName: String? = null,
val dependencyConfiguration: String? = null
val dependencyConfiguration: String? = null,
val isPureCxxDependency: Boolean? = null
)
@@ -10,7 +10,7 @@ package com.facebook.react.utils
import com.facebook.react.utils.KotlinStdlibCompatUtils.lowercaseCompat
import java.io.File
internal object Os {
object Os {
fun isWindows(): Boolean =
System.getProperty("os.name")?.lowercaseCompat()?.contains("windows") ?: false
@@ -7,17 +7,17 @@
package com.facebook.react.utils
internal fun windowsAwareCommandLine(vararg args: Any): List<Any> =
fun windowsAwareCommandLine(vararg args: Any): List<Any> =
windowsAwareCommandLine(args.toList())
internal fun windowsAwareCommandLine(args: List<Any>): List<Any> =
fun windowsAwareCommandLine(args: List<Any>): List<Any> =
if (Os.isWindows()) {
listOf("cmd", "/c") + args
} else {
args
}
internal fun windowsAwareBashCommandLine(
fun windowsAwareBashCommandLine(
vararg args: String,
bashWindowsHome: String? = null
): List<String> =
@@ -216,7 +216,8 @@ class JsonUtilsTest {
"cxxModuleCMakeListsModuleName": null,
"cxxModuleCMakeListsPath": null,
"cxxModuleHeaderName": null,
"dependencyConfiguration": "implementation"
"dependencyConfiguration": "implementation",
"isPureCxxDependency": false
}
}
}
@@ -298,6 +299,11 @@ class JsonUtilsTest {
.platforms!!
.android!!
.dependencyConfiguration)
assertFalse(
parsed.dependencies!!["@react-native/oss-library-example"]!!
.platforms!!
.android!!
.isPureCxxDependency!!)
}
private fun createJsonFile(@Language("JSON") input: String) =
+6 -6
View File
@@ -1,6 +1,6 @@
{
"name": "react-native-info",
"version": "1.0.0",
"version": "0.75.3",
"main": "build/index.js",
"license": "MIT",
"private": true,
@@ -17,11 +17,11 @@
"directory": "packages/react-native-info"
},
"dependencies": {
"@react-native-community/cli-config": "^13.6.4",
"@react-native-community/cli-platform-apple": "^13.6.4",
"@react-native-community/cli-tools": "^13.6.4",
"@react-native-community/cli-types": "^13.6.4",
"commander": "^12.0.0",
"@react-native-community/cli-config": "14.1.0",
"@react-native-community/cli-platform-apple": "14.1.0",
"@react-native-community/cli-tools": "14.1.0",
"@react-native-community/cli-types": "14.1.0",
"commander": "^9.4.1",
"fs-extra": "^11.2.0",
"yaml": "^2.4.1"
},
@@ -1,6 +1,6 @@
{
"name": "@react-native/popup-menu-android",
"version": "0.75.0-main",
"version": "0.75.3",
"description": "PopupMenu for the Android platform",
"main": "index.js",
"files": [
@@ -17,7 +17,7 @@
],
"license": "MIT",
"devDependencies": {
"@react-native/codegen": "0.75.0-main"
"@react-native/codegen": "0.75.3"
},
"peerDependencies": {
"@types/react": "^18.2.6",
@@ -1,6 +1,6 @@
{
"name": "@react-native/oss-library-example",
"version": "0.0.1",
"version": "0.75.3",
"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.20.0",
"@react-native/babel-preset": "0.75.0-main",
"react-native": "*"
"@react-native/babel-preset": "0.75.3",
"react-native": "0.75.3"
},
"peerDependencies": {
"react": "*",
@@ -1,7 +1,7 @@
{
"name": "@react-native/test-renderer",
"private": true,
"version": "0.75.0-main",
"version": "0.75.3",
"description": "A Test rendering library for React Native",
"license": "MIT",
"devDependencies": {
@@ -26,7 +26,7 @@ use_hermes = ENV['USE_HERMES'] == nil || ENV['USE_HERMES'] == '1'
new_arch_enabled_flag = (is_new_arch_enabled ? " -DRCT_NEW_ARCH_ENABLED" : "")
is_fabric_enabled = true #is_new_arch_enabled || ENV["RCT_FABRIC_ENABLED"]
hermes_flag = (use_hermes ? " -DUSE_HERMES" : "")
other_cflags = "$(inherited)" + folly_compiler_flags + new_arch_enabled_flag + hermes_flag
other_cflags = "$(inherited) " + folly_compiler_flags + new_arch_enabled_flag + hermes_flag
header_search_paths = [
"$(PODS_TARGET_SRCROOT)/../../ReactCommon",
@@ -61,7 +61,7 @@ Pod::Spec.new do |s|
s.pod_target_xcconfig = {
"HEADER_SEARCH_PATHS" => header_search_paths,
"OTHER_CPLUSPLUSFLAGS" => other_cflags,
"CLANG_CXX_LANGUAGE_STANDARD" => "c++20",
"CLANG_CXX_LANGUAGE_STANDARD" => rct_cxx_language_standard(),
"DEFINES_MODULE" => "YES"
}
s.user_target_xcconfig = { "HEADER_SEARCH_PATHS" => "\"$(PODS_ROOT)/Headers/Private/React-Core\""}
@@ -43,7 +43,7 @@ Pod::Spec.new do |s|
s.header_dir = "RCTBlob"
s.pod_target_xcconfig = {
"USE_HEADERMAP" => "YES",
"CLANG_CXX_LANGUAGE_STANDARD" => "c++20",
"CLANG_CXX_LANGUAGE_STANDARD" => rct_cxx_language_standard(),
"HEADER_SEARCH_PATHS" => header_search_paths.join(' ')
}
+3 -3
View File
@@ -14,9 +14,9 @@ const version: $ReadOnly<{
patch: number,
prerelease: string | null,
}> = {
major: 1000,
minor: 0,
patch: 0,
major: 0,
minor: 75,
patch: 3,
prerelease: null,
};
@@ -32,11 +32,7 @@ static NSInteger RCTImageBytesForImage(UIImage *image)
return image.images ? image.images.count * singleImageBytes : singleImageBytes;
}
static uint64_t getNextImageRequestCount(void)
{
static uint64_t requestCounter = 0;
return requestCounter++;
}
static auto currentRequestCount = std::atomic<uint64_t>(0);
static NSError *addResponseHeadersToError(NSError *originalError, NSHTTPURLResponse *response)
{
@@ -510,7 +506,7 @@ static UIImage *RCTResizeImageIfNeeded(UIImage *image, CGSize size, CGFloat scal
auto cancelled = std::make_shared<std::atomic<int>>(0);
__block dispatch_block_t cancelLoad = nil;
__block NSLock *cancelLoadLock = [NSLock new];
NSString *requestId = [NSString stringWithFormat:@"%@-%llu", [[NSUUID UUID] UUIDString], getNextImageRequestCount()];
NSString *requestId = [NSString stringWithFormat:@"%@-%llu", [[NSUUID UUID] UUIDString], currentRequestCount++];
void (^completionHandler)(NSError *, id, id, NSURLResponse *) =
^(NSError *error, id imageOrData, id imageMetadata, NSURLResponse *response) {
@@ -42,7 +42,7 @@ Pod::Spec.new do |s|
s.header_dir = "RCTImage"
s.pod_target_xcconfig = {
"USE_HEADERMAP" => "YES",
"CLANG_CXX_LANGUAGE_STANDARD" => "c++20",
"CLANG_CXX_LANGUAGE_STANDARD" => rct_cxx_language_standard(),
"HEADER_SEARCH_PATHS" => header_search_paths.join(' ')
}
s.framework = ["Accelerate", "UIKit"]
@@ -41,7 +41,7 @@ Pod::Spec.new do |s|
s.header_dir = "RCTLinking"
s.pod_target_xcconfig = {
"USE_HEADERMAP" => "YES",
"CLANG_CXX_LANGUAGE_STANDARD" => "c++20",
"CLANG_CXX_LANGUAGE_STANDARD" => rct_cxx_language_standard(),
"HEADER_SEARCH_PATHS" => header_search_paths.join(' ')
}
@@ -40,7 +40,7 @@ Pod::Spec.new do |s|
s.header_dir = "RCTAnimation"
s.pod_target_xcconfig = {
"USE_HEADERMAP" => "YES",
"CLANG_CXX_LANGUAGE_STANDARD" => "c++20",
"CLANG_CXX_LANGUAGE_STANDARD" => rct_cxx_language_standard(),
"HEADER_SEARCH_PATHS" => header_search_paths.join(" ")
}
@@ -5,6 +5,7 @@
* LICENSE file in the root directory of this source tree.
*/
#import <atomic>
#import <mutex>
#import <React/RCTLog.h>
@@ -20,6 +21,8 @@
RCTNetworkTask *_selfReference;
}
static auto currentRequestId = std::atomic<NSUInteger>(0);
- (instancetype)initWithRequest:(NSURLRequest *)request
handler:(id<RCTURLRequestHandler>)handler
callbackQueue:(dispatch_queue_t)callbackQueue
@@ -28,10 +31,8 @@
RCTAssertParam(handler);
RCTAssertParam(callbackQueue);
static NSUInteger requestID = 0;
if ((self = [super init])) {
_requestID = @(requestID++);
_requestID = @(currentRequestId++);
_request = request;
_handler = handler;
_callbackQueue = callbackQueue;
@@ -40,7 +40,7 @@ Pod::Spec.new do |s|
s.header_dir = "RCTNetwork"
s.pod_target_xcconfig = {
"USE_HEADERMAP" => "YES",
"CLANG_CXX_LANGUAGE_STANDARD" => "c++20",
"CLANG_CXX_LANGUAGE_STANDARD" => rct_cxx_language_standard(),
"HEADER_SEARCH_PATHS" => header_search_paths.join(' ')
}
s.frameworks = "MobileCoreServices"
@@ -41,7 +41,7 @@ Pod::Spec.new do |s|
s.header_dir = "RCTPushNotification"
s.pod_target_xcconfig = {
"USE_HEADERMAP" => "YES",
"CLANG_CXX_LANGUAGE_STANDARD" => "c++20",
"CLANG_CXX_LANGUAGE_STANDARD" => rct_cxx_language_standard(),
"HEADER_SEARCH_PATHS" => header_search_paths.join(' ')
}
s.framework = "UserNotifications"
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
@@ -41,7 +41,7 @@ Pod::Spec.new do |s|
s.header_dir = "RCTSettings"
s.pod_target_xcconfig = {
"USE_HEADERMAP" => "YES",
"CLANG_CXX_LANGUAGE_STANDARD" => "c++20",
"CLANG_CXX_LANGUAGE_STANDARD" => rct_cxx_language_standard(),
"HEADER_SEARCH_PATHS" => header_search_paths.join(' ')
}
@@ -182,21 +182,23 @@ type MaximumOneOf<T, K extends keyof T = keyof T> = K extends keyof T
export interface TransformsStyle {
transform?:
| MaximumOneOf<
PerspectiveTransform &
RotateTransform &
RotateXTransform &
RotateYTransform &
RotateZTransform &
ScaleTransform &
ScaleXTransform &
ScaleYTransform &
TranslateXTransform &
TranslateYTransform &
SkewXTransform &
SkewYTransform &
MatrixTransform
>[]
| Readonly<
MaximumOneOf<
PerspectiveTransform &
RotateTransform &
RotateXTransform &
RotateYTransform &
RotateZTransform &
ScaleTransform &
ScaleXTransform &
ScaleYTransform &
TranslateXTransform &
TranslateYTransform &
SkewXTransform &
SkewYTransform &
MatrixTransform
>[]
>
| string
| undefined;
transformOrigin?: Array<string | number> | string | undefined;
@@ -30,7 +30,7 @@ Pod::Spec.new do |s|
s.preserve_paths = "package.json", "LICENSE", "LICENSE-docs"
s.header_dir = "RCTText"
s.framework = ["MobileCoreServices"]
s.pod_target_xcconfig = { "CLANG_CXX_LANGUAGE_STANDARD" => "c++20" }
s.pod_target_xcconfig = { "CLANG_CXX_LANGUAGE_STANDARD" => rct_cxx_language_standard() }
s.dependency "Yoga"
s.dependency "React-Core/RCTTextHeaders", version
@@ -651,8 +651,6 @@ RCT_NOT_IMPLEMENTED(-(instancetype)initWithFrame : (CGRect)frame)
- (NSString *)returnKeyTypeToString:(UIReturnKeyType)returnKeyType
{
switch (returnKeyType) {
case UIReturnKeyDefault:
return @"Default";
case UIReturnKeyGo:
return @"Go";
case UIReturnKeyNext:
@@ -680,7 +678,6 @@ RCT_NOT_IMPLEMENTED(-(instancetype)initWithFrame : (CGRect)frame)
{
returnKeyTypesSet = [NSSet setWithObjects:@(UIReturnKeyDone),
@(UIReturnKeyGo),
@(UIReturnKeyDefault),
@(UIReturnKeyNext),
@(UIReturnKeySearch),
@(UIReturnKeySend),
@@ -29,7 +29,7 @@ Pod::Spec.new do |s|
s.header_dir = "RCTTypeSafety"
s.pod_target_xcconfig = {
"USE_HEADERMAP" => "YES",
"CLANG_CXX_LANGUAGE_STANDARD" => "c++20",
"CLANG_CXX_LANGUAGE_STANDARD" => rct_cxx_language_standard(),
"HEADER_SEARCH_PATHS" => "\"$(PODS_TARGET_SRCROOT)/Libraries/TypeSafety\""
}
@@ -31,7 +31,7 @@ const Platform: PlatformType = {
major: number,
minor: number,
patch: number,
prerelease: ?number,
prerelease: ?string,
|},
Version: number,
Release: string,
+1 -1
View File
@@ -24,7 +24,7 @@ type PlatformConstants = {
major: number;
minor: number;
patch: number;
prerelease?: number | null | undefined;
prerelease?: string | null | undefined;
};
};
interface PlatformStatic {
@@ -32,7 +32,7 @@ type IOSPlatform = {
major: number,
minor: number,
patch: number,
prerelease: ?number,
prerelease: ?string,
|},
systemName: string,
isMacCatalyst?: boolean,
@@ -65,7 +65,7 @@ type AndroidPlatform = {
major: number,
minor: number,
patch: number,
prerelease: ?number,
prerelease: ?string,
|},
Version: number,
Release: string,
@@ -34,7 +34,7 @@ const Platform: PlatformType = {
major: number,
minor: number,
patch: number,
prerelease: ?number,
prerelease: ?string,
|},
systemName: string,
isMacCatalyst?: boolean,
@@ -41,7 +41,7 @@ Pod::Spec.new do |s|
s.header_dir = "RCTVibration"
s.pod_target_xcconfig = {
"USE_HEADERMAP" => "YES",
"CLANG_CXX_LANGUAGE_STANDARD" => "c++20",
"CLANG_CXX_LANGUAGE_STANDARD" => rct_cxx_language_standard(),
"HEADER_SEARCH_PATHS" => header_search_paths.join(' ')
}
s.frameworks = "AudioToolbox"
@@ -8711,7 +8711,7 @@ type IOSPlatform = {
major: number,
minor: number,
patch: number,
prerelease: ?number,
prerelease: ?string,
|},
systemName: string,
isMacCatalyst?: boolean,
@@ -8735,7 +8735,7 @@ type AndroidPlatform = {
major: number,
minor: number,
patch: number,
prerelease: ?number,
prerelease: ?string,
|},
Version: number,
Release: string,
+8
View File
@@ -0,0 +1,8 @@
# Where is the template?
The React Native Template has moved from being shipping inside the [react-native](https://www.npmjs.com/package/react-native) package to it's own package: [@react-native-community/template](https://github.com/react-native-community/template).
## Why has it moved?
The [React Native Frameworks RFC0759](https://github.com/react-native-community/discussions-and-proposals/blob/main/proposals/0759-react-native-frameworks.md#evolving-the-react-native-community-template--cli) provides background information.
## When was it moved?
The 0.75 release.
+1 -1
View File
@@ -72,7 +72,7 @@ Pod::Spec.new do |s|
"HEADER_SEARCH_PATHS" => header_search_paths,
"DEFINES_MODULE" => "YES",
"GCC_PREPROCESSOR_DEFINITIONS" => "RCT_METRO_PORT=${RCT_METRO_PORT}",
"CLANG_CXX_LANGUAGE_STANDARD" => "c++20",
"CLANG_CXX_LANGUAGE_STANDARD" => rct_cxx_language_standard(),
"FRAMEWORK_SEARCH_PATHS" => frameworks_search_paths.join(" ")
}
s.user_target_xcconfig = { "HEADER_SEARCH_PATHS" => "\"$(PODS_ROOT)/Headers/Private/React-Core\""}

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