Граф коммитов

26159 Коммитов

Автор SHA1 Сообщение Дата
LeoTM f75b92a12b Bump node version from 16 to 18 (#35443)
Summary:
Node 18: https://nodejs.org/de/blog/announcements/v18-release-announce/

Node 16 EOL: 2023-09-11
https://nodejs.org/en/blog/announcements/nodejs16-eol/

Node 18 EOL: 2025-04-30

Follow-up
- https://github.com/facebook/react-native/pull/34171
- https://github.com/facebook/react-native/pull/32980

Ref
- https://github.com/react-native-community/docker-android/pull/187

cc ramonmedel cortinico gengjiawen

## Changelog

<!-- Help reviewers and the release process by writing your own changelog entry. For an example, see:
https://reactnative.dev/contributing/changelogs-in-pull-requests
-->

[JavaScript] [Changed] - Bump node version from 16 to 18

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

Test Plan: Everything builds and runs as expected

Reviewed By: cipolleschi

Differential Revision: D41531161

Pulled By: cortinico

fbshipit-source-id: 305888f55ed179f75bef34548aebf22fc2951308
2022-11-25 06:44:21 -08:00
Adam Foxman 5aead70e80 eslint config & plugin packages - prep for monorepo RFC (#34581)
Summary:
The [monorepo RFC](https://github.com/react-native-community/discussions-and-proposals/pull/480) calls for renaming:

* `react-native-community/eslint-config` -> `react-native/eslint-config`
* `react-native-community/eslint-plugin` -> `react-native/eslint-plugin`

It also calls for the versions to be aligned with the rest of main -- currently `0.72.0`.

## Changelog

<!-- Help reviewers and the release process by writing your own changelog entry. For an example, see:
https://reactnative.dev/contributing/changelogs-in-pull-requests
-->

[General][Changed] - Renamed `react-native-community/eslint-config` to `react-native/eslint-config` v0.72.0 to align with other packages
[General][Changed] - Renamed `react-native-community/eslint-plugin` to `react-native/eslint-plugin` v0.72.0 to align with other packages

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

Test Plan:
First test is to run `yarn lint`, and verify that output matches before and after this change.

Second test is to change the ESLint config to use the "old" packages (under `react-native-commnuity`) and run `yarn lint` to make sure that they work as expected. This is what customers will experience, until they manually move to the new ESLint packages.

Reviewed By: cortinico

Differential Revision: D41520500

Pulled By: hoxyq

fbshipit-source-id: a61e5ae15d5aaf11f0143a3b0257a60a03b1550b
2022-11-25 05:44:17 -08:00
Riccardo Cipolleschi 319631f003 fix: update CircleCI config to use the RN version in tarball caching (#35471)
Summary:
This PR updates the Cache strategy for the tarballs to include the React Native version we are building. In this way, when we publish a new Release/RC we are sure that we are going to rebuild a nmew
tarball. This should fix caching problems like:

- we have misconfigured the build script for the Hermes tarball, we then fix it, but we distribute the wrong cached artifacts
- the cached artifact has the wrong version

## Changelog

[Internal] - Fixed Hermes Tarball Cache Logic

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

Test Plan:
1. CircleCI
The real way to check this is in the next RC cycle or in the next nightly.

Reviewed By: cortinico

Differential Revision: D41530651

Pulled By: cipolleschi

fbshipit-source-id: 45e8fd3b62c8e108d393d9463ff6762dfc6d3ec8
2022-11-25 05:14:42 -08:00
Riccardo Cipolleschi 67d02640ba Use the right logic to decide when we build Hermes from source (#35469)
Summary:
This PR backports the changes in 0.71 to apply the same logic to decide when we have to build Hermes from source in both the `hermes-engine.podspec`
and in the `react_native_pods.rb` script.

## Changelog

[iOS] [Fixed] - Use the right logic to decide when we have to build from source

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

Test Plan: Working on RC2

Reviewed By: cortinico

Differential Revision: D41529539

Pulled By: cipolleschi

fbshipit-source-id: 879522c2187df28f40f6bc699057e9ecfb7e25fb
2022-11-25 05:12:39 -08:00
Nicola Corti 2d1d61a38c Move on-issue-labeled to use actions/github-script@v6 (#35474)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/35474

This cleans up our `on-issue-labeled` workflow and makes sure we use only github-scripts. So we don't need to checkout the code & run an external action.

Changelog:
[Internal] [Changed] - Move on-issue-labeled to use actions/github-script@v6

Reviewed By: cipolleschi

Differential Revision: D41522650

fbshipit-source-id: c93d10eddf5be2ca9f779389e8059633291c0138
2022-11-25 04:01:31 -08:00
Lorenzo Sciandra c4959b9806 fix(e2e script): backport from 71 fixes to the E2E script (#35477)
Summary:
Because the /scripts folder for some reason is not typechecked at all, some changes broke the script and went undetected until we tried running it. This is a backport of those fixes:
* 67c373ff3a
* 6107793fda
* 6107793fda

Also, it's backporting an improvement to the e2e local script clean to remove the hermes-engine pod cache which has been proven annoyingly in the way while testing:
* 9979e38c70

## Changelog

[Internal] [Fixed] - Fix e2e script not working and augment clean script

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

Test Plan: Works on 0.71 ;)

Reviewed By: dmytrorykun

Differential Revision: D41530272

Pulled By: jacdebug

fbshipit-source-id: d45650d919ad5ef08438b307f122817d72771f46
2022-11-25 03:26:20 -08:00
Ruslan Lesiutin e680018109 fix(ci/template): fixed unresolved variable in script
Summary:
Changelog:
[Internal] [Changed] - fixed unresolved variable in template initialization script

Reviewed By: cipolleschi

Differential Revision: D41527165

fbshipit-source-id: acdd8d4cf9fb6153022b0395d3715ca9ca6363c9
2022-11-25 01:07:42 -08:00
Petr Bela 1f8c0c8860 remove return type from constructor (#35466)
Summary:
I'm getting `node_modules/react-native/Libraries/Events/EventPolyfill.js: Unexpected token, expected "{"` when building an app. Looking at the source code, it seems odd there'd be a return type defined for a constructor. Unless I'm missing something (I don't use flow), I think it should be removed?

## Changelog

[Internal] [Fixed] - Remove return type from constructor

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

Test Plan: N/A

Reviewed By: jacdebug

Differential Revision: D41527010

Pulled By: yungsters

fbshipit-source-id: 9f4faf1305ebe1915f5bcf07fc86b7437aed0c97
2022-11-24 18:26:36 -08:00
Ruslan Lesiutin 6a45f2ce79 refactor(circleci/template): publish all packages to Verdaccio before template initialization (#35459)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/35459

Changelog:
[Internal] [Changed] - now bootstrapping Verdaccio before template app initialization, this is required because react-native migh depend on some package which version is not yet published to npm

Reviewed By: cipolleschi

Differential Revision: D41521496

fbshipit-source-id: 6183ab02c697d9d08e9dca5b323bd7a11a749c3a
2022-11-24 13:56:09 -08:00
Nicola Corti 50c6ee40ea Build RNTester Release inside buildAll (#35464)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/35464

This extends the buildAll task to build both RNTester Debug and Release
We can finally do this now as debug and release are fully isolated
and don't clash on each other.

Changelog:
[Internal] [Changed] - Build RNTester Release inside buildAll

Reviewed By: cipolleschi

Differential Revision: D41521995

fbshipit-source-id: 37ec5e3b55080372f01f2736c1bb020b3776b193
2022-11-24 11:22:54 -08:00
Dmitry Rykun a5c77115ae Build hermesc in Xcode run script phase
Summary:
Build hermesc in Xcode run script phase, so it ends up inside `Pods/hermes-engine/buld_host_hermesc`. All the the housekeeping is now done by CocoaPods and Xcode, and we can get rid of all the setup/cleanup code.

Changelog:
[iOS][Changed] - Build hermesc in Xcode run script phase.

Reviewed By: cipolleschi

Differential Revision: D41521987

fbshipit-source-id: 336854fa23582255cba6d161acf2cc791cac9d00
2022-11-24 10:22:40 -08:00
Nicola Corti 09843a0094 Store RN Tester and Template APKs for Android on CI (#35463)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/35463

This will allow us to easily retrieve debug/release APK for
both RN-Tester and the Template jobs for every run of the CI.

Changelog:
[Internal] [Changed] - Store RN Tester and Template APKs for Android on CI

Reviewed By: cipolleschi

Differential Revision: D41521977

fbshipit-source-id: e2ed60921fd005425d3915323b18dde2851e7fc2
2022-11-24 10:21:57 -08:00
Nicola Corti 0c6a4f8c59 Remove AVD code from Android CI
Summary:
We don't really run AVD (Emulators on CI) so those steps
are entirely unnecessary and skipped every time. I'm removing them.

Changelog:
[Internal] [Changed] - Remove AVD code from Android CI

Reviewed By: cipolleschi

Differential Revision: D41521976

fbshipit-source-id: 2737ef0dfc84198ab9b837819c16ae46280ba43f
2022-11-24 10:21:57 -08:00
Cedric van Putten 4a4cceef25 Fix hardcoded path to codegen cli for monorepos (#35430)
Summary:
Fixes https://github.com/facebook/react-native/issues/35429

This fix is fairly straightforward. Instead of hardcoding two separate paths for this repo or a simple user's project, we ask Node to resolve `react-native-codegen`.

Because `react-native-codegen` is moved [into the `/packages/*` folder](https://github.com/facebook/react-native/blob/main/package.json#L104), it's part of a workspace in this repository. That means that this fix works not only for monorepos in general but also resolves the right path within the react native repository.

You can test this out yourself when running this command in either the root, or any other workspace in this repository:
```bash
node --print "require('path').dirname(require.resolve('react-native-codegen/package.json'))"
```

I've tested this on Node 16 and 18, and seems to work nicely. Note that you _**have to specify `react-native-codegen/package.json`**_. That's because the `react-native-codegen` package itself is technically invalid; it's missing an entry point within the package (no `main`). When running `node --print "require.resolve('react-native-codegen')"` Node can't resolve the main entry point, and will fail during this process.

## Changelog

<!-- Help reviewers and the release process by writing your own changelog entry. For an example, see:
https://reactnative.dev/contributing/changelogs-in-pull-requests
-->

[iOS] [Fixed] - Fix incorrect codegen CLI paths in monorepo projects

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

Test Plan: See PR https://github.com/facebook/react-native/issues/35429

Reviewed By: cortinico

Differential Revision: D41475878

Pulled By: cipolleschi

fbshipit-source-id: f0c362b64cf9c3543a3a031d7eaf302c1314e3f0
2022-11-24 10:15:43 -08:00
Nicola Corti 4c5eb8dd2a Bump AGP to 7.4.x (#35456)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/35456

Fixes #35439

There is a bug in AGP 7.3.x which is causing assets to don't be copied properly inside the
final artifact: issuetracker.google.com/issues/237421684
As AGP 7.4.x is really close to release (is in Beta5, should be released stable in the next weeks)
we should be fine by bumping to beta5.

This also requires a bump of RNGP

Changelog:
[Android] [Changed] - Bump AGP to 7.4.x

allow-large-files

Reviewed By: cipolleschi

Differential Revision: D41519549

fbshipit-source-id: 60d568a3e49798a23f1d7bf4839ab58bd5549aba
2022-11-24 09:18:36 -08:00
Nicola Corti 92be0e3fde Allow `reactnativejni` to be consumed via prefab (#35461)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/35461

This is another library which is adding prefab support as it's needed by
Expo libraries and Reanimated.

Changelog:
[Internal] [Changed] - Allow `reactnativejni` to be consumed via prefab

Reviewed By: cipolleschi

Differential Revision: D41520801

fbshipit-source-id: 91142a5b5051cfba478d93a2475a178eed6fbb29
2022-11-24 08:45:15 -08:00
Nicola Corti 332822150a Add missing headers to `react_nativemodule_core` prefab module (#35460)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/35460

Reanimated reported that `react_nativemodule_core` was missing some headers.
Specifically the one from ReactAndroid::react_debug, ReactAndroid::react_render_core, ReactAndroid::glog,
and ReactAndroid::react_render_debug.

I'm adding them here so they get included in the shipped headers for `react_nativemodule_core`

Changelog:
[Internal] [Changed] - Add missing headers to `react_nativemodule_core` prefab module

Reviewed By: cipolleschi

Differential Revision: D41520751

fbshipit-source-id: 4627a2d0f880d4bb3ff2f0e43cd735cf9a3f2f9a
2022-11-24 08:45:15 -08:00
Nicola Corti 055d09cb76 Add prefab for _uimanager _scheduler and _mounting (#35458)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/35458

We're adding prefab support for those modules as they're needed by Reanimated
and we're exposing headers for them as well.

Changelog:
[Internal] [Changed] - Add prefab for _uimanager _scheduler and _mounting

Reviewed By: cipolleschi

Differential Revision: D41520606

fbshipit-source-id: 76f3c81705e99057b92cd9b86d0601a2b1410f95
2022-11-24 08:45:15 -08:00
Nicola Corti b70707b96d Expose `hermes-executor` to be consumed via prefab (#35457)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/35457

This exposes `hermes-executor` to be consumed via prefab so that
libraries can depend on it and use its symbols if needed (Expo and Reanimated need it).

Changelog:
[Internal] [Changed] - Expose `hermes-executor` to be consumed via prefab

Reviewed By: cipolleschi

Differential Revision: D41520019

fbshipit-source-id: d590a043ea89fdd8ff41b0ed20900c9cf381a1e4
2022-11-24 08:45:15 -08:00
Nicola Corti fe2716b8ae Consolidate hermes-executor-debug and -release inside a single target (#35454)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/35454

Historically, we used to have hermes-executor debug and release as separate dynamic libraries.
This makes it impossible to prefab this library, so I have to reconcile it into a single library.

This will also help keep the setup consistent with the internal (BUCK) where we have a single target.

Changelog:
[Internal] [Changed] - Consolidate hermes-executor-debug and -release inside a single target

Reviewed By: cipolleschi

Differential Revision: D41519119

fbshipit-source-id: d9ddc30b72164daa29c735836ea433fd4d917fc8
2022-11-24 08:45:15 -08:00
Dmitry Rykun af6c9e2183 Do not add "Copy Hermes Framework" script phase to hermes-engine target
Summary:
This script phase is added to the main target of the user project.
Adding it to the hermes-engine target is redundant and does nothing useful.

Changelog:
[iOS][Changed] - Do not add "Copy Hermes Framework" script phase to hermes-engine target.

Reviewed By: cipolleschi

Differential Revision: D41521276

fbshipit-source-id: a024fa33f7ec1605d1d6021f436d3d397871a50c
2022-11-24 08:43:21 -08:00
Lorenzo Blasa db3ac93001 Bump Flipper to 0.174.0 (#35445)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/35445

As Flipper version is a bit old, let's bump it to the latest stable: 0.174.0.

This is a follow-up from D33583090 (50057158ca).

At the time, it wasn't possible to update to the latest stable Flipper as crashes were observed due to NDK mismatch.

Changelog:
[Android] [Changed] - Bump Flipper to 0.174.0

Reviewed By: cortinico

Differential Revision: D41492705

fbshipit-source-id: 9ec205bb0b8e4ddcb56355a194cae0a64f3345d6
2022-11-24 07:46:00 -08:00
Nicola Corti 25c97bbb22 RNGP - Correctly Support Gradle Configuration Cache (#35455)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/35455

This little change allows to support Gradle Configuration cache in user projects:
https://docs.gradle.org/current/userguide/configuration_cache.html

It allows to save several seconds on the build time.
We'll keep it disabled for now, but Gradle plans to enable it by default for everyone
in the future, so this changes makes us ready for it.

Changelog:
[Internal] [Changed] - RNGP - Correctly Support Gradle Configuration Cache

Reviewed By: cipolleschi

Differential Revision: D41519506

fbshipit-source-id: 6252546e811deb0777c0aab5332291368be7fa8f
2022-11-24 07:45:17 -08:00
Christoph Purrer 9517320176 Enable C++17 for cxxreact and jsiexecutor/inspector and ... (#35435)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/35435

This raises the C++ language standard to C++17 which is needed to remove some folly:: dependencies

changelog: [Internal]

Reviewed By: cortinico

Differential Revision: D41482821

fbshipit-source-id: 62af6e95e6e78378112a4ce4e9c3ab7df0587218
2022-11-23 18:48:47 -08:00
Phillip Pan e6cba99744 rename Geometry.h -> Vector.h
Summary:
Geometry only contains the Vector struct now, renaming it for accuracy

Changelog: [Internal]

Reviewed By: stephinphection

Differential Revision: D41453351

fbshipit-source-id: 973b4a03208f4eeb0e209ea0aa58f5beca17c483
2022-11-23 16:16:38 -08:00
Nicola Corti 9d068ba8b9 Do not suggest users to report on MessageQueue
Summary:
This is a nit. We have this message "Please Report" which is really confusing in the
error message. Users are opening Github Issues but that's not really actionable for us.
We should clean it up.

Changelog:
[Internal] [Changed] - Do not suggest users to report on MessageQueue

Reviewed By: shwanton

Differential Revision: D41501707

fbshipit-source-id: fa57e50114a6e67b98f4b0b5d805031ae07d8776
2022-11-23 15:33:45 -08:00
Ruslan Lesiutin e11cfe98e9 feat(react-native/template): use verdaccio to publish local packages before testing template app (#35444)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/35444

Changelog:
[Internal][Changed] - now using Verdaccio to publish necessary packages for template app

- Adds script `/scripts/template/install-dependencies.js`, which incapsulates the logic of installing dependencies of template app
- The idea of the script is to run verdaccio and publish all necessary packages to node_modules, since these packages might not yet be present on npm
- This should also potentially resolve some template app test failures on CircleCI related to package-ifying Animated, VirtualizedList, FlatList modules

Reviewed By: cortinico

Differential Revision: D41498086

fbshipit-source-id: 48fbbb1c9334e7a9e7657e6275b7b04f9ce290b5
2022-11-23 13:20:00 -08:00
Phillip Pan c5a8425fad more Geometry.h cleanup
Summary: Changelog: [Internal]

Reviewed By: mdvacca

Differential Revision: D41452147

fbshipit-source-id: f427b8d95572c4b602b96962be187b62b801d62b
2022-11-23 01:41:23 -08:00
Phillip Pan 6c10df5c90 update graphics imports
Summary:
i recently made a change to modularize some of our graphics dependencies

i think this codegen will be incorrect now after my diff, so i updated it so we would codegen the correct deps

Changelog: [Internal]

Reviewed By: mdvacca

Differential Revision: D41451842

fbshipit-source-id: 98b5576e9fbd2d693c8bcfeac39d8dfb1b1e0584
2022-11-23 01:41:23 -08:00
Tim Yung 3eb69f24dd Animated: Revert `setNativeView` Workaround
Summary:
Reverts {D41122065 (1b1b26a099)}, which is no longer necessary because {D41208895 (7cf4cf3afb)} fixed the `ref` invalidation in `ScrollView`.

Changelog:
[Internal]

Reviewed By: sammy-SC

Differential Revision: D41390543

fbshipit-source-id: 36c3db80af6e426f233ef0aaf5909942fb7103b2
2022-11-22 15:15:44 -08:00
GabeDahl 6410a621ce Fix typo in renderItem usage snippet (#35416)
Summary:
Fix typo in renderItem usage snippet - TouchableOpacity's JSX closing tag

## Changelog

[General] [Fixed] - Message

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

Test Plan: N/A - Typo is in a comment

Reviewed By: christophpurrer

Differential Revision: D41445946

Pulled By: NickGerleman

fbshipit-source-id: 147226f9b0ef443908f71d25ccf8063b8c1c6142
2022-11-22 14:58:33 -08:00
Dmitry Rykun 0d3d00287c Backport fix copy-hermes-xcode.sh from 0.71-stable (#35431)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/35431

`[ -f "$source" ]` was wrong.
`man test` reads:
>  -f file       True if file exists and is a regular file.
-e file       True if file exists (regardless of type).

hermes.framework is not a regular file but a directory. `-e` is beter here.
Also intermediate destiantion directories are now created if they didn't exist.

Changelog:
[iOS][Fixed] - Make copy-hermes-xcode.sh more reliable.

Reviewed By: robhogan

Differential Revision: D41472846

fbshipit-source-id: 87de0b48d178ca542299b8e5fa741fdc0570d4e2
2022-11-22 09:17:33 -08:00
matiassalles99 cc311ff01a Extract the UnsupportedArrayElementTypeAnnotationParserError in its o… (#35167)
Summary:
This PR is part of https://github.com/facebook/react-native/issues/34872
This PR extracts the [UnsupportedArrayElementTypeAnnotationParserError](https://github.com/facebook/react-native/blob/main/packages/react-native-codegen/src/parsers/flow/modules/index.js#L132) in its own throwing function.

## Changelog
[Internal] [Changed] - Extract the UnsupportedArrayElementTypeAnnotationParserError in its own throwing function

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

Test Plan: <img width="454" alt="Screen Shot 2022-11-02 at 15 21 15" src="https://user-images.githubusercontent.com/57004457/199582495-23e4e3be-cb7e-41e8-a1fa-0250e127993c.png">

Reviewed By: cipolleschi

Differential Revision: D41437971

Pulled By: rshest

fbshipit-source-id: 14a6e09297d96f3b57568e0303e5cafff76e6f32
2022-11-22 06:16:24 -08:00
Rujin Cao 285a98084e @emails -> @oncall (miscs)
Differential Revision: D41063745

fbshipit-source-id: 395ccd254c7410b96915156d59a584d3b255faa8
2022-11-22 01:36:05 -08:00
Nick Gerleman a02bd0ded1 Add explicit defaulted copy ctor to `Values` (#1176)
Summary:
X-link: https://github.com/facebook/yoga/pull/1176

`Values` is a wrapper to story an array of YGValue's as CompactValues.

From https://github.com/facebook/yoga/issues/1174 we see a warning `Wdeprecated-copy` beacuse a user-defined copy constructor is not present, but a user-defined asignment operator is (the defaulted one). This adds an explicitly defaulted copy contructor which should silence the warning I think.

Changelog:
[Internal]

Reviewed By: christophpurrer

Differential Revision: D41447490

fbshipit-source-id: 8cc8f291cf12014d87cc71c4598bb84fdd6cd930
2022-11-21 16:33:36 -08:00
David Vacca 45a9b9f992 Remove unused method
Summary:
Remove unused method

changelog: [internal] intenral

Reviewed By: makovkastar

Differential Revision: D41386919

fbshipit-source-id: d0ce952ea5f52effb7791d3b97605ce9c4c65957
2022-11-21 12:27:24 -08:00
David Vacca 2f06b26634 refactor ViewGroupManager to use IViewGroupManager
Summary:
In this diff I'm  refactoring ViewGroupManager to implement IViewGroupManager
This will be used by ViewManagers that require to add views but don't depend on ViewGroupmanager

changelog: [internal] internal

Reviewed By: javache

Differential Revision: D41386918

fbshipit-source-id: 427b9689eb3408c2477cf38494d42280b41fd7d8
2022-11-21 12:27:24 -08:00
David Vacca c0a0481656 Introduce IViewGroupManager
Summary:
In this diff I'm introducing IViewGroupManager to extract methods required to add/remove views from a viewGroup

This will be used by ViewManagers that require to add views but don't depend on ViewGroupmanager

changelog: [internal] internal

Reviewed By: javache

Differential Revision: D41386920

fbshipit-source-id: a7d893d92d0f12766dcc71dfd1b22539c3b9687d
2022-11-21 12:27:24 -08:00
David Vacca 78e7311cd5 Fix lints and clean up interfaces
Summary:
quick diff to fix lints and clean-up interfaces in com.facebook.react.uimanager

changelog: [internal] internal

Reviewed By: NickGerleman

Differential Revision: D41382839

fbshipit-source-id: 7c28fb7b0120e13e6a601c96a58b144161f64d5f
2022-11-21 12:27:24 -08:00
Arushi Kesarwani 662b51fad2 Adding Dev Loading controller without activity for VR (#35392)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/35392

Changelog:
    [General][Added] - For supporting Dev Loading View across platforms, adding the DevLoadingViewController without an activity/context.

Reviewed By: rshest

Differential Revision: D40947239

fbshipit-source-id: de124b0a7ee39dc7da3c1c45972a6703eff2f0ef
2022-11-21 11:59:01 -08:00
Christoph Purrer 6c315de226 Add butter/function.h (#35385)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/35385

In OpenSource builds folly:: types are not always easy to consume.

With butter:: we actually allow consumers to opt-into other/non folly:: types (by providing a custom butter:: implementation).

This change adds a butter::function for that purpose.

It is especially useful for react-native-windows which prefers Mso::Functor over folly::Function.

You can use it by setting those compiler flags:
-DBUTTER_FUNCTION_OVERRIDE_INCLUDE=<functional/functor.h>
-DBUTTER_FUNCTION_OVERRIDE=Mso::Functor

std::function is no option as it is not move-only and we can't wait till 2025 > https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2021/p0288r9.html

Changelog: [Internal]

Reviewed By: sammy-SC

Differential Revision: D41388193

fbshipit-source-id: 56f58b9ddc602aa4b13000031d50de5228b4a16b
2022-11-21 11:17:01 -08:00
Riccardo Cipolleschi f12b12c999 Improve version checks to avoid mistakes in the versioning (#35296)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/35296

This change adds some version checks and enforces that every version matches some specific format based on the build type we are trying to run.

## Changelog
[General][Changed] - Improve version checks

Reviewed By: cortinico

Differential Revision: D41161756

fbshipit-source-id: 4172195c5e031c1eaf7b33bb74f381c04e9adaf5
2022-11-21 10:52:17 -08:00
Pieter De Baets ef66856bae Fix packager liveness check broken on internal builds
Summary: Changelog: [Internal]

Reviewed By: sammy-SC

Differential Revision: D41437735

fbshipit-source-id: 83dbea41512c196bfcb4b8b9e5d94847f2b11ce4
2022-11-21 10:36:05 -08:00
Samuel Susla d9ade19b71 Make links in LogBox tappable
Summary:
changelog:
[General][Add] LogBox now makes URL links tappable.

Logbox messages may contain URLs with more information about the given error. Right now, they are not tappable or copyable. So engineers need to resort to manually retype the link to browser. This diff tries to address that.

Example of StrictMode error that has link in it.

{F798509909}

Reviewed By: yungsters

Differential Revision: D41305784

fbshipit-source-id: 456a9faf34f8b9e443759dd6903ba67d0b9de73c
2022-11-21 09:09:23 -08:00
Riccardo Cipolleschi 850f855eb6 chore: fail prepare package for release if tag exists (#35305)
Summary:
This PR makes sure that the `preapre_package_for_release` script fail fast if there is already a tag for the desired version
on github.

## Changelog

[General] [Added] - Make the `prepare_package_for_release` fail if there is already a git tag with that version

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

Test Plan:
Tested manually. The script is currently only invoked during the release process.
<img width="1238" alt="Screenshot 2022-11-10 at 12 24 03" src="https://user-images.githubusercontent.com/11162307/201090947-274c1b1c-0b6a-4619-bc85-fa60e5eaeee1.png">

Reviewed By: cortinico

Differential Revision: D41403159

Pulled By: cipolleschi

fbshipit-source-id: fb87df345b14568c750482e5c68be53551a9acbb
2022-11-21 07:12:56 -08:00
Dmitry Rykun 5dd0f7327b Various fixes for Hermes build-from-source behaviour
Summary:
Original title: **[RN] Do not encode path to cmake in hermes-engine Pod, build hermesc in prepare_pods**

The result of `#{%x(command -v cmake | tr -d '\n')}` was being encoded into the `hermes-engine` Pod. This can lead to conflicts in the CocoaPods cache when `pod install` is run on different machines.

Instead of running the command during `pod install`, we defer to the actual build scripts so they can find `cmake` when `$CMAKE_BINARY` is not set.

More importantly, this fixes an issue that crept into the Sandcastle CocoaPods offline mirrors, but which would only manifest itself when people run `js1 oss prepare-pods`.

RNTester would not build due to RNTesterPods.xcworkspace being configured to use cmake from an arbitrary path instead of using the cmake from $PATH.

This does not affect Sandcastle due to `CMAKE_BINARY` getting overriden in Sandcastle.
 ---

**Update** by dmytrorykun:

It is impossible to address the problem described in the original title by simply adding `CMAKE_BINARY=${CMAKE_BINARY:-cmake}` to `build-hermes-xcode.sh`. This script is supposed to run from Xcode. Since Xcode doesn't have access to system `PATH` variable, it is unable to locate `cmake`, and build fails.

However this diff contains other useful changes:

1. Remove trailing newline in `cmake` path in `build-hermes-xcode.sh`.
2. Fix inverted logic in `copy-hermes-xcode.sh`.
3. Fix typo in `remove xcuserdata` step in Sandcastle.
4. Remove unused `HERMES_DISABLE_HERMESC_BUILD`.

Changelog:
[iOS] [Fixed] - Various fixes for Hermes build-from-source behaviour.

Reviewed By: cipolleschi

Differential Revision: D41139384

fbshipit-source-id: 4a4a44a7ac201d279718d84cd02d60b4eaf3956b
2022-11-21 07:09:18 -08:00
David Angulo cb7f1b1f0b Read `.ruby-version` file in `Gemfile` (#35410)
Summary:
When updating the Ruby version, 2 files are always needed to be updated (`.ruby-version` and `Gemfile`). When not in sync it can lead to an error like `Your Ruby version is 2.7.6, but your Gemfile specified 2.7.5`.

This lessens the files that need to be updated when upgrading the Ruby version and makes it in sync always. It makes the `.ruby-version` the source of truth.

### Example 1:

<img width="481" alt="Screenshot 2022-11-20 at 13 56 08" src="https://user-images.githubusercontent.com/36528176/202888191-450ab6d0-32a4-4d37-ad82-0beb2b22fa82.png">

When upgrading from `0.70.0` to `0.71.0-rc.0`. 2 files needs to be updated when it could have been just 1.

Source: https://react-native-community.github.io/upgrade-helper/?from=0.70.0&to=0.71.0-rc.0

### Example 2:

21c8837c12 updates 4 files (`.ruby-version`, `Gemfile`, `template/Gemfile`, `template/_ruby-version`) when it could have been just 2.

### Other Sources:
* https://andycroll.com/ruby/read-ruby-version-in-your-gemfile/
* https://render.com/docs/ruby-version (Heroku alternative)
* https://stackoverflow.com/a/35823132/9375533

## Changelog

[General] [Changed] - Read `.ruby-version` file in `Gemfile`

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

Test Plan: Only `.ruby-version` and `template/_ruby-version` needs to be updated when upgrading Ruby version.

Reviewed By: christophpurrer, cipolleschi

Differential Revision: D41429147

Pulled By: rshest

fbshipit-source-id: 9e541a1d84aed5dca1e6f465c61bb0ba15574211
2022-11-21 05:59:19 -08:00
Riccardo Cipolleschi 138af74e3f Remove `HERMES_BUILD_FROM_SOURCE` flag (#35397)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/35397

This Diff removes the `HERMES_BUILD_FROM_SOURCE` that was not always propagated to the original script. This lead to some cases where hermesC was built during `pod install` and then removed by the `react_native_post_install`'s `else` branch.

Basically, when the Pods are installed the first time, everything run smoothly. Subsequent invocations of `pod install`, to install other dependencies, for example, will incur in this problem because:
1. Cocoapods will see that hermes-engine is already installed
2. the podspec is not executed, given that the pod has been fetched from the cache
3. The env var is not set (given that the podspec is not executed)
4. the main script sees the env var as not set, `ENV['HERMES_BUILD_FROM_SOURCE'] == "1"` return false
5. The `else` branch is executed, and it removes the `hermesc_build_dir` and the `copy Hermes framework` script phase.

## Changelog:
[iOS][Changed] - Remove `HERMES_BUILD_FROM_SOURCE` flag

Reviewed By: cortinico, dmytrorykun

Differential Revision: D41373439

fbshipit-source-id: ea4aafd187c0ca3ff5c0d79f8aeaaa46ad50f499
2022-11-21 05:21:39 -08:00
Dmitry Rykun 8b319fd488 Do not run prepare_pods with js1 oss update-pods
Summary:
The order of following calls is irrelevant.
```
  __update_pods_and_offline_mirrors "$JS_ENGINE_JSC"
  __update_pods_and_offline_mirrors "$JS_ENGINE_HERMES"
```
If execute `__update_pods_and_offline_mirrors "$JS_ENGINE_HERMES"` last, then `prepare_pods "$JS_ENGINE_HERMES"` is redundant.

allow-large-files

Changelog:
[Internal][Changed] - Cleanup offline pod mirrors updating behaviour.

Reviewed By: cipolleschi

Differential Revision: D41346899

fbshipit-source-id: 694713330fb94561d872883a18f97869cd30cd26
2022-11-21 04:44:31 -08:00
Riccardo Cipolleschi 25132c8490 Fix: Avoid path in the template import (#35394)
Summary:
Investigating [this comment](https://github.com/reactwg/react-native-releases/discussions/41#discussioncomment-4170008), I made some tests.
It seems like we can simply use `#import <RCTAppDelegate.h>` instead of the `#import <React-RCTAppDelegate/RCTAppDelegate.h>` in both setups:
- default setup
- `use_frameworks! :linkage => :static`

## Changelog

[iOS] [Fixed] - Support `use_framework! :linkage => :static` in template

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

Test Plan:
1. Manually tested with a new app
2. CircleCI
3. Sandcastle

Reviewed By: cortinico

Differential Revision: D41402060

Pulled By: cipolleschi

fbshipit-source-id: e1ed8196ed860b3663a88f5283f2745e39b0e944
2022-11-21 03:55:21 -08:00