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
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
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
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
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
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
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
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/35456Fixes#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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
Summary:
Changelog:
[iOS][Changed] - Abort pod install if bad HERMES_ENGINE_TARBALL_PATH is set.
Reviewed By: cipolleschi
Differential Revision: D41341471
fbshipit-source-id: 34a3ac154b0a3f795d07dcd10f92361cb9bb4ad6
Summary:
The template has moved to typescript now, the self-reference needed an update
## 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] [FIXED] - reference App.tsx vs App.js in text of new typescript template
Pull Request resolved: https://github.com/facebook/react-native/pull/35377
Test Plan: It is just a text change - it either makes sense or it doesn't. I think it makes sense?
Reviewed By: cipolleschi
Differential Revision: D41386912
Pulled By: NickGerleman
fbshipit-source-id: 6e62c11567e8fbff70b123446a827b18af43e864
Summary:
The commit 3eddc9abb7 included on v0.69 introduced a wrong `if` statement inside the `componentDidUpdate` function of the `TouchableOpacity` component. As this `if` statement always evaluates to `true` (`(true || false) !== undefined`) we end up making unnecessary calls to the `_opacityInactive` method every time the component props changes, e.g. every time a `<Text>` inside the TouchableOpacity changes we call this function over and over, and this has been causing some performance issues on big lists.
This PR fixes this problem by adjusting the `componentDidUpdate` function to only call `_opacityInactive` when necessary.
Closes https://github.com/facebook/react-native/issues/34442
Closes https://github.com/facebook/react-native/issues/32476
## Changelog
[General] [Fixed] - Fix TouchableOpacity componentDidUpdate causing an excessive number of pending callbacks
Pull Request resolved: https://github.com/facebook/react-native/pull/35387
Test Plan:
1. Open the RNTester app and navigate to the `Touchable* and onPress` page
2. Test the `TouchableOpacity` component through the many sections
Reviewed By: cipolleschi
Differential Revision: D41397396
Pulled By: ryancat
fbshipit-source-id: 24863b5cbbdd2f3dd1f654b43d7031560937b888
Summary:
X-link: https://github.com/pytorch/pytorch/pull/89233
The `-weak_framework` flag is no longer necessary, Buck will weakly link frameworks depending on the `target_sdk_version` of the binary being linked.
Reviewed By: ebgraham, malfet
Differential Revision: D41348639
fbshipit-source-id: 47992282ba030294b2304c550d49df13e24e9c79