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

438 Коммитов

Автор SHA1 Сообщение Дата
Ruslan Shestopalyuk ad953f6f4b Unify native performanceNow implementation across platforms
Summary:
[Changelog][Internal]

Both iOS and Android platforms are at this point using the same native implementation of `performanceNow`, based on `std::chrono` (it used to be different some time ago).

This diff unifies the implementations, so it comes from one place in C++ code for all platforms.

The context is that I am developing event timing instrumentation and need a consistent way to get current timestamp from either JS or native (C++) side. The latter is now possible via calling `JSExecutor::performanceNow()`, which is guaranteed to be the same as called from JS.

Reviewed By: christophpurrer

Differential Revision: D42267898

fbshipit-source-id: dcb592f37d6567340ea59faddbf3b6d2b8507d50
2022-12-28 11:03:14 -08:00
Christoph Purrer 022e22cbd4 Replace folly::Optional with std::optional (#35436)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/35436

Using std::optional as react-native has been using C++17 for quite some time

changelog: [Internal]

Reviewed By: cortinico

Differential Revision: D41415031

fbshipit-source-id: d786647f64b4f90cf75409109830ae0885460c17
2022-11-28 02:08:12 -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
Christoph Purrer 19d65a2baf Update .podspec license information (#35245)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/35245

Changelog: [Internal]

Reviewed By: cipolleschi

Differential Revision: D41084913

fbshipit-source-id: a4ba31a19ffe515aa4e7c5a6e273a8cc4b6bc42d
2022-11-07 09:52:52 -08:00
Christoph Purrer 089684ee56 Remove remaining TV_OS fragments (#35110)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/35110

Changelog:
[General][Fixed] Remove remaining TV_OS fragments

Reviewed By: shwanton

Differential Revision: D40775881

fbshipit-source-id: 122ff8737de35689ee0951b068997ee546c7019c
2022-10-28 02:50:49 -07:00
Riccardo Cipolleschi 52d37aa403 Back out "add oncall annotation for BUCK files in xplat based on supermodule information - /home/s2shi/tmp/xplat_buck_oncall/xplat_buck_batch10" (#35064)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/35064

Original commit changeset: 0fb0db845c04

Original Phabricator Diff: D40610875 (d941940b4c)

Open source is using BUCK 1 which does not seem to have the `oncall` directive.

Backing it out because it is breaking the external CI.

## Changelog
[internal]

Reviewed By: cortinico

Differential Revision: D40635873

fbshipit-source-id: 79ebd4db0972520fcca6ccb8c1725657a8ef7949
2022-10-24 10:44:39 -07:00
Jonathan Keljo e69e6f4014 supermodule:xplat/default/public.react_native.infra
Reviewed By: javache

Differential Revision: D40376280

fbshipit-source-id: d76e692fd8a571614729d0fb15ebde8895d3de28
2022-10-23 15:55:13 -07:00
Stanley Shi d941940b4c add oncall annotation for BUCK files in xplat based on supermodule information - /home/s2shi/tmp/xplat_buck_oncall/xplat_buck_batch10
Differential Revision: D40610875

fbshipit-source-id: 0fb0db845c041265faf0a06877d05ffbb55ba648
2022-10-21 22:39:18 -07:00
Héctor Ramos a68c418082 Do not build JSI in React-jsi when Hermes is enabled, resolve JSI ODR violation (#35038)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/35038

React-jsi provides JSI to allow React Native to interface with JavaScriptCore.
The hermes-engine Pod provides a second copy of JSI, as Hermes is built and linked statically with JSI.
This second copy of JSI would lead to an [ODR Violation](https://en.cppreference.com/w/cpp/language/definition).

To resolve this, when Hermes is enabled:
- React-hermes and hermes-engine are installed.
- React-jsc is not installed.
- React-jsi continues to be installed.
- React-jsi will not build JSI.
- React-jsi will declare a dependency on hermes-engine.

The result is that the JSI dependency for React Native is satisfied by hermes-engine, and there is no duplicate JSI library in the project.

When Hermes is disabled:
- React-jsi and React-jsc are installed.
- React-hermes and hermes-engine are not installed.
- React-jsi will build JSI.

Changelog:
[iOS][Changed] Resolve JSI ODR violation, make hermes-engine the JSI provider when Hermes is enabled

Reviewed By: cipolleschi

Differential Revision: D40334913

fbshipit-source-id: 409407a193a35cbd21b0e8778537b3627e4c54a2
2022-10-20 14:14:23 -07:00
Héctor Ramos 6b129d81ed CocoaPods: Split React-jsc out of React-jsi (#35031)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/35031

The React-jsi Pod was serving two purposes: building JSI, and configuring JavaScriptCore as the JS engine.

By splitting the React-jsi Pod into React-jsi and React-jsi, we can start working towards de-coupling the JSI dependency from any particular JS engine.

Pods that depended on React-jsi, now depend on React-jsi and React-jsc.
One exception to this is React-hermes, which is only installed when Hermes is enabled, and thus does not require JavaScriptCore.
Upcoming commits should take care of removing the React-jsc dependency when Hermes is enabled, but it is out of scope for this commit.

Changelog:
[iOS][Changed] - The JSC Runtime is now provided by the React-jsc Pod instead of React-jsi. Libraries that declared a dependency on React-jsi in order to specifically create a JSC runtime (`makeJSCRuntime()`) will need to add React-jsc to their dependencies.

Reviewed By: dmytrorykun

Differential Revision: D40442603

fbshipit-source-id: b9b21146b9deb401f80cfef76a87c9867754a953
2022-10-20 14:14:23 -07:00
Lorenzo Sciandra 232e4474e6 chore: re-align version to be 1000.0.0 on main everywhere (#34817)
Summary:
While working on https://github.com/facebook/react-native/pull/34513 I noticed that on main branch the versioning is not really consistent everywhere. So this PR is an attempt at realigning so that on the main branch, RN is 1000.0.0 everywhere - in a way, it's cleaning up the room for the monorepo work to go flawlessly).

It's just a pass of `node scripts/set-rn-version.js --to-version 1000.0.0`.

There's the small chance that some versions where kept to 0.0.0 on purpose (build tools are weird), so we might just have to close this off. No big deal :)

## Changelog

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

[Internal] [Changed] -  re-align version to be 1000.0.0 on main everywhere

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

Test Plan: CI is green and when imported, nothing breaks.

Reviewed By: cortinico

Differential Revision: D39926953

Pulled By: cortinico

fbshipit-source-id: ff66530382f891e17c00b35edf97c03591b6a9a8
2022-10-04 08:36:21 -07:00
Christoph Purrer 9cb716ff76 Add additional Systrace support
Summary:
Adding support for application to hook into further tracing methods

## Changelog

[General][Added] - Add additional Systrace support

Reviewed By: NickGerleman

Differential Revision: D38673212

fbshipit-source-id: 55a90a0cd57809bca5f01da7acddcf253e5852ba
2022-09-14 16:29:20 -07:00
Pieter De Baets 450fa4d1d3 Remove molly dep from react-native buck graph
Summary:
Folly's molly target combines a number of targets that are supposed to be useable on mobile. Since we're trying to move away from folly, we should instead list explicitly which parts of folly we're using so we can remove them over time, and track which targets no longer have any folly dependencies.

Changelog: [Internal]

Reviewed By: NickGerleman

Differential Revision: D38352060

fbshipit-source-id: 09d0d84793692f97f4d49390c99c38b23441df54
2022-08-11 04:53:34 -07:00
Nick Gerleman 063c2b4668 Enable -Wpedantic for targets inside ReactCommon
Summary:
React Native is compiled downstream with MSVC, meaning the introduction of code depending on language extensions specific to gcc/clang may cause breakage.

We can enable `-Wpedantic` to flag any behavior not officially supported by the specified C++ standard. This will includes rules beyond what MSVC has trouble with, but seems to not have too many "noisy warnings".

This change enables -Wpedantic in BUCK targets within ReactCommon.

This makes the OSS C++ build for Android/iOS slightly more permissive than the internal build, A followup is to add the changes to OSS build logic as well, to avoid contributors seeing more errors upon internal submission. (checking with cortinico on how to do this for Android).

react-native-windows uses a higher warning level than `-Wall`, which is an additional cause of compilation failures, but is not addressed as part of this change.

Changelog:
[Internal][Changed] - Enable -Wpedantic for targets inside ReactCommon

Reviewed By: rshest

Differential Revision: D38457812

fbshipit-source-id: 014da1ac0b7ad8f78154e6e447ed58def6bd0d47
2022-08-11 04:37:35 -07:00
Chiara Mooney 33dbb6c40c Fix Make Unused Not Compiler Specific (#34357)
Summary:
Use of `__attribute__` and `__unused` is compiler specific. Opt for standard `[[maybe_unused]]` instead.

## Changelog

[General] [Fixed] - Remove compiler-specific syntax.

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

Test Plan: Built on react-native-windows.

Reviewed By: cipolleschi

Differential Revision: D38498481

Pulled By: javache

fbshipit-source-id: af43206788f54dda3b747b6417e20096c7d520e8
2022-08-08 03:50:58 -07:00
Pieter De Baets 71e89213aa Make ReactCommon and tests compile for CXX platform
Summary:
If you don't list `Cxx` as a supported platform, we will use Android builds, even when using `buck run` for local execution.

Changelog: [Internal]

Reviewed By: derolf

Differential Revision: D37600464

fbshipit-source-id: 6ba8566cde4180524351c9d8c647ce1d4ac5279d
2022-07-05 05:56:35 -07:00
Pieter De Baets e23520bb56 Fix inconsistent-missing-destructor-override warning
Summary: Changelog: [internal]

Reviewed By: neildhar, jpporto

Differential Revision: D37454445

fbshipit-source-id: 423fa99f91e54ade807a56169204c523ad1f9d20
2022-06-29 12:56:01 -07:00
Pieter De Baets a5a956bab8 Remove unused MicroProfiler
Summary:
This was introduced a while ago in D3635319 (0418353249), and was never really adopted.

Changelog: [Internal]

Reviewed By: JoshuaGross

Differential Revision: D37460402

fbshipit-source-id: 70586b23697e02208c393e556625ae534773177f
2022-06-28 02:51:34 -07:00
Luis Santana 68f3a42fc7 bump RTC-Folly to 2021.07.22 (#33841)
Summary:
Bumping RTC-Folly version used to address CVE-2022-24440.

## Changelog

<!-- Help reviewers and the release process by writing your own changelog entry. For an example, see:
https://github.com/facebook/react-native/wiki/Changelog
-->

[General][Security] - Bump RTC-Folly to 2021-07-22

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

Reviewed By: Andjeliko, philIip

Differential Revision: D36425598

Pulled By: cortinico

fbshipit-source-id: d38c5f020dbecf794b10f12ed2da30e1825071af
2022-06-21 12:36:43 -07:00
Michael Lee (Engineering) 2d66bd4851 Rename the folly `headers_only` target to warn
Summary:
This target is not a good idea for a number of reasons:
1. It groups up multiple targets which breaks the dependency graph
2. It does not handle dependency remapping correctly
3. It has no mirror into fbcode

We should warn people this is a bad idea

Reviewed By: alexmalyshev

Differential Revision: D36519357

fbshipit-source-id: d60ca3237c7710118732578fecd1b2fc8903321b
2022-05-26 08:17:27 -07:00
Nicola Corti 26a54169f2 Remove unused Makefiles from React Native core
Summary:
This diff cleans up several Android Makefiles which we're not using anymore
as they've been replaced by CMake files.

There are still 3 Makefiles left, which I'm aiming to remove in the near future.

Changelog:
[Internal] [Changed] - Remove unused Makefiles from React Native core

Reviewed By: javache

Differential Revision: D36660902

fbshipit-source-id: 8afffac74d493616b0f9414567821cd69f4ef803
2022-05-25 07:54:06 -07:00
NikoAri 3f98c8e4c2 Avoid full copy of large folly::dynamic objects by switching to std::move semantics (#33621)
Summary:
Problem:
Current creation of ModuleConfig does a full copy of folly::dynamic object, which for large objects can cause 1000's of memory allocations, and thus increasing app's memory footprint and speed.

Fix:
Use std::move semantics to avoid copy of folly::dynamic, thus avoiding memory allocations.

## Changelog

[General] [Fixed] - Avoid full copy of large folly::dynamic objects by switching to std::move semantics

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

Test Plan:
Compiled React Native for Windows
Consumed into Microsoft Excel App
Tested functionality through Microsoft Office Excel App
Viewed Memory Allocations in Debugger

Reviewed By: cortinico

Differential Revision: D35599759

Pulled By: RSNara

fbshipit-source-id: 095a961422cca4655590d2283f6955472f1f0410
2022-04-13 16:26:55 -07:00
Chris Olszewski daa105aba5 Fixup typo in pfh labels
Summary:
Now that the PFH node has been renamed this updates the pfh label.

Produced via `xbgs -l -e '"pfh:ReactNative_CommonInfrastructurePlaceholde"' | xargs sed -i 's/"pfh:ReactNative_CommonInfrastructurePlaceholde"/"pfh:ReactNative_CommonInfrastructurePlaceholder"/'`

Reviewed By: jkeljo

Differential Revision: D35374087

fbshipit-source-id: 61590f69de5a69ec3b8a0478f6dd43409de3c70b
2022-04-05 12:15:05 -07:00
Chris Olszewski ceae48c0f7 Add pfh labels to targets
Summary:
While it would be better to be able to do all of the ownership metadata at the Buck macro level, that proved to be more work than expected.

This diff adds the corresponding pfh label to all targets in `xplat/js/react-native-github` that have a Supermodule label. Once the migration is complete the Supermodules labels will be able to be removed.

Reviewed By: cortinico

Differential Revision: D35221544

fbshipit-source-id: d87d5e266dfb5e6ee087251dc34dff5db299bbaf
2022-03-30 14:37:03 -07:00
Phillip Pan 982ca30de0 bump iOS and tvOS from 11.0 to 12.4 in cocoapods
Summary:
Changelog: [iOS][Deprecated] Deprecating support for iOS/tvOS SDK 11.0, 12.4+ is now required

allow-large-files

Reviewed By: sammy-SC

Differential Revision: D34547333

fbshipit-source-id: a24bb09d03939a092de4198efb1aa4a44c69f718
2022-03-16 21:08:01 -07:00
Andrei Shikov e5874d90e2 Folly_runtime for CMake
Summary:
Ports improvements from Android.mk setup to CMake, replacing folly_json and futures with runtime where plausible

Changelog: [Internal] - CMake folly_runtime setup

Reviewed By: cortinico

Differential Revision: D34854295

fbshipit-source-id: fa882a9cd0b78feb20f8abcc9350c27702375def
2022-03-16 08:10:55 -07:00
Pieter De Baets 6c9de5543e Cleanup ScriptTag helpers on Instance
Summary:
We were opening the file multiple times just to read the same couple of bytes.

Changelog: [Internal]

Reviewed By: motiz88

Differential Revision: D34835972

fbshipit-source-id: 9de899f37a9193db4ab72e69e02e8d41e5515da0
2022-03-15 05:58:52 -07:00
Pieter De Baets be0ff779b1 Fix parseTypeFromHeader for Hermes bytecode
Summary: Changelog: [Internal] Fix bug where Hermes bytecode bundles were not always recognized

Reviewed By: motiz88

Differential Revision: D34718511

fbshipit-source-id: 5bbebe49962d098988d99153b0938fbb5d449ae6
2022-03-15 05:58:52 -07:00
Nicola Corti e12bc9cf62 Setup Globbing with CONFIGURE_DEPENDS inside CMake files.
Summary:
This Diff moves from specifying a list of files to use file(GLOB) with
CONFIGURE_DEPENDS on several CMakefiles.
I've updates those where we use globbing also inside buck.

Changelog:
[Internal] [Changed] - Setup Globbing with CONFIGURE_DEPENDS inside CMake files

Reviewed By: ShikaSD

Differential Revision: D34826311

fbshipit-source-id: 8fc654626c897cdc4cdd79c699ce19f1e5e1212f
2022-03-15 01:55:27 -07:00
Andrei Shikov 5d5addd661 Separate folly into runtime + folly_futures specific for hermes inspector
Summary:
Rearranges folly_futures configuration into a static library only required for `hermes-inspector` + `folly_runtime` which merges `folly_json` and mutex-related implementations `folly_futures` was used for. As `hermes-executor-debug` is removed by `vmCleanup` configurations later, it allows to shave additional 300KB from the release APK size.

Changelog: [Internal] - Rearrange folly build to reduce APK size

Reviewed By: cortinico

Differential Revision: D34342514

fbshipit-source-id: b646680343e6b9a7674019506b87b96f6007caf2
2022-03-13 15:15:21 -07:00
Nicola Corti a3d9892ed9 Build Hermes from Source (#33396)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/33396

This commit fully unplugs the `ReactAndroid` from using hermes from the NPM package and plugs the usage of Hermes via the `packages/hermes-engine` Gradle build.

I've used prefab to share the .so between the two builds, so we don't need any extra machinery to make this possible.

Moreover, I've added a `buildHermesFromSource` property, which defaults to false when RN is imported, but is set to true when RN is opened for local development. This should allow us to distribute the `react-native` NPM package and users could potentially toggle which source to use (but see below).

Changelog:
[Android] [Changed] - Build Hermes from Source

Reviewed By: hramos

Differential Revision: D34389875

fbshipit-source-id: 107cbe3686daf7607a1f0f75202f24cd80ce64bb
2022-03-11 15:23:36 -08:00
Nicola Corti b676ca560d First Round of CMake files for React Android
Summary:
This is the first round of CMake files to support the React Native build on Android.
They're supposed to eventually replace the various Android.mk files we have around in the codebase.

So far we're not actively using them. This is the first step towards migrating our
setup to use CMake

Changelog:
[Internal] [Changed] - First Round of CMake files for React Android

Reviewed By: ShikaSD

Differential Revision: D34762524

fbshipit-source-id: 6671e203a2c83b8874cefe796aa55aa987902a3b
2022-03-11 11:39:23 -08:00
Samuel Susla c2e4ae39b8 Add support for C++17 in OSS
Summary: changelog: Add support for C++17

Reviewed By: cortinico

Differential Revision: D34612257

fbshipit-source-id: 88a0307a750f2e0793a639b7a2b670a4571332fe
2022-03-04 07:25:59 -08:00
Pieter De Baets 20b9ed91c0 Remove FBREMAP experiment
Summary:
The flag was removed in https://www.internalfb.com/diff/D28467996 (2c5f68df46) but the code was not removed yet.

Changelog: [Internal]

Reviewed By: motiz88

Differential Revision: D33792884

fbshipit-source-id: 0ae5d904ca2ca94437ca63b495d41e47585fde33
2022-01-27 12:02:19 -08:00
Andres Suarez 8bd3edec88 Update copyright headers from Facebook to Meta
Reviewed By: aaronabramov

Differential Revision: D33367752

fbshipit-source-id: 4ce94d184485e5ee0a62cf67ad2d3ba16e285c8f
2021-12-30 15:11:21 -08:00
Luna Wei 3204c55981 Remove usages of bump-oss-version from generated scripts
Summary: Changelog: [Internal] - Update the source of the changes in generated files, no longer bump-oss-version but set-rn-version

Reviewed By: sota000

Differential Revision: D33110408

fbshipit-source-id: 8cd5004f5d40dde82fe4d6271d5b8598cd27ca31
2021-12-17 18:37:37 -08:00
Julio C. Rocha 1d45b20b6c Set CxxModule instance before retrieving Method vector (#32719)
Summary:
Allows `CxxModule` objects to set their `instance_` member before `getMethods()` is invoked, allowing for the `Method` callbacks to capture a weak reference to `getInstance()` if needed.

## Changelog

<!-- Help reviewers and the release process by writing your own changelog entry. For an example, see:
https://github.com/facebook/react-native/wiki/Changelog
-->

[General] [Fixed] - Set CxxModules' Instance before retrieving their Method vector.

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

Test Plan: Ensure this statement swap does not break any scenarios with existing CI validation.

Reviewed By: JoshuaGross

Differential Revision: D32955616

Pulled By: genkikondo

fbshipit-source-id: fd7a23ca2c12c01882ff1600f5aef86b1fe4a984
2021-12-15 14:37:37 -08:00
Nicola Corti b8f415eb6c Update LOCAL_SHARED_LIBRARIES to be a multiline string
Summary:
We have `LOCAL_SHARED_LIBRARIES` that are getting longer and are
making reviewing them on Diffs quite hard.
Having all the list of the dependency on a single line is suboptimal
and it makes hard to find duplicated entries.
I've updated the longest `LOCAL_SHARED_LIBRARIES` to be multilines and
I've sorted the entries here.

Changelog:
[Internal] [Changed] - LOCAL_SHARED_LIBRARIES

Reviewed By: ShikaSD

Differential Revision: D32695127

fbshipit-source-id: f5b381c501ddff083ef9f4baaca6c4c8c9523368
2021-11-29 13:01:51 -08:00
Nicola Corti a5469f9d7f Update libruntimeexector to be a shared lib rather than a static lib
Summary:
AGP 7.x is changing the path where we can find
the precompiled static libraries. Therefore is getting complicated
to share prebuilt `.a` files. I'm updating `libruntimeexecutor` to be
a shared library instead so this will solve this issue for now.

Changelog:
[Internal] [Changed] - Update libruntimeexector to be a shared lib rather than a static lib

Reviewed By: ShikaSD

Differential Revision: D32646112

fbshipit-source-id: ce42e930076c1d3b5f54f3d8adcca1c38909d0fb
2021-11-24 10:58:54 -08:00
Paige Sun 160807d112 Add ReactMarker::LogTaggedMarkerBridgeless, to replace LogTaggedMarkerWithInstanceKey
Summary:
# Issue in iOS
Before this diff, [Venice would override](https://www.internalfb.com/code/fbsource/[08e6e7a37f9ac1d33e14fc14ed763c0f8716f73a]/fbobjc/Apps/Internal/Venice/Core/RCTPerformanceLoggerUtils.mm?lines=52%2C57) the static function ReactMarker::LogTaggedMarker [created in CxxBridge](https://www.internalfb.com/code/fbsource/[08e6e7a37f9ac1d33e14fc14ed763c0f8716f73a]/xplat/js/react-native-github/React/CxxBridge/RCTCxxBridge.mm?lines=179%2C183). This means that in mixed mode they would share the Bridgeless instance of RCTPerformanceLogger [owned by Venice-only RCTInstance](https://www.internalfb.com/code/fbsource/[08e6e7a37f9ac1d33e14fc14ed763c0f8716f73a]/fbobjc/Apps/Internal/Venice/Core/RCTInstance.mm?lines=65%2C73).

This is wrong because Bridge is supposed to use the instance of RCTPerformanceLogger [owned by RCTBridge](https://www.internalfb.com/code/fbsource/[73ab70b2d9e28569171b62f60e9f25744461d4d9]/xplat/js/react-native-github/React/Base/RCTBridge.m?lines=353).

# Fix iOS and refactor Android

1) Add LogTaggedMarkerBridgeless to use the bridgeless RCTPerformanceLogger.

2) Use LogTaggedMarkerBridgeless to replace logTaggedMarkerWithInstanceKey.
- Remove logTaggedMarkerWithInstanceKey because it always clear from the code that instanceKey is 0 for Bridge, and 1 for Bridgeless,
- iOS doesn't use instanceKey and keeps separate instances of FBReactBridgeStartupLogger, FBReactWildePerfLogger, and RCTPerformanceLogger instead. This is better than using instanceKey because they are all [deallocated when Bridgeless is invalidated](https://www.internalfb.com/code/fbsource/[ea436e5ea6ae4ebc5e206197c4900022be867135]/fbobjc/Apps/Wilde/FBReactModule2/FBReactModuleAPI/FBReactModuleAPI/Exported/FBReactModule.mm?lines=1160%2C1167%2C1170).
- logTaggedMarkerWithInstanceKey is only called from Venice's ReactInstance.cpp so it's easy to remove.

Reviewed By: sshic

Differential Revision: D32588327

fbshipit-source-id: 3151a44c9796da88fef4459b9b56946861514435
2021-11-23 12:55:56 -08:00
Joshua Gross b60e229d7f Remove compiler_flags from BUCK modules
Summary:
Nearly all of these are identical and these compiler_flags are now centralized in rn_defs.bzl. This should have NO CHANGE on build configuration, the flags have just moved for now.

Changelog: [Internal]

Reviewed By: mdvacca

Differential Revision: D31631766

fbshipit-source-id: be40ebeb70ae52b7ded07ca08c4a29f10a0ed925
2021-10-14 15:34:29 -07:00
Kevin Gozali b0c8a4eee8 Link RCT-Folly against libc++abi
Summary:
Folly now depends on libc++abi. This solves linker error for RCT-Folly.podspec like this:

```
Undefined symbols for architecture arm64:
  "___cxa_increment_exception_refcount", referenced from:
      folly::exception_ptr_get_type(std::exception_ptr const&) in libRCT-Folly.a(Exception.o)
ld: symbol(s) not found for architecture arm64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
```

See https://github.com/react-native-community/releases/issues/251

Note: RNTester was not affected by this bug for some reason, so the only way to verify is via the new app generated via `npx react-native init`.

Changelog: [Fixed][iOS] Unbreak Folly linker error

Reviewed By: lunaleaps

Differential Revision: D30950944

fbshipit-source-id: 3eb146e23faa308a02363761d08849d6801e21ca
2021-09-16 22:24:10 -07:00
Sota Ogo b29a78732d Emit soft error for warning
Summary:
This diff adds a default behavior for the unified logger on Android.

Added the call site in the CXXNativeModule.

Changelog: [internal]

Reviewed By: JoshuaGross

Differential Revision: D30377767

fbshipit-source-id: 000014828f2f245dc9492e3617218895d9a33536
2021-08-18 23:38:01 -07:00
Ramanpreet Nara f536f82e12 Warn whenever CxxNativeModules are used
Summary:
After this diff, when ReactFeatureFlags.warnOnLegacyNativeModuleSystemUse is enabled, the legacy NativeModule infra will log soft exceptions whenever legacy NativeModules are accessed/used.

Changelog: [Internal]

Reviewed By: p-sun

Differential Revision: D30272695

fbshipit-source-id: 7111402c1d8b883a600dcb4559e9ff1d56447070
2021-08-13 13:53:44 -07:00
Kudo Chien b77948e33b Upgrade folly to 2021.06.28.00 and boost to 1.76.0 (#31840)
Summary:
1. [ios] upgrade folly to 2021.06.28.00 which aligned to android.
2. folly compile setting from c++14 -> c++17: _this folly requires c++17 for `std::unordered_map::insert_or_assign`._
3. boost 1.63.0 -> 1.76.0:  _the old boost does not support c++17._
4. deprecating react-native-community/boost-for-react-native: _by cocoapods installer, we could download the official target._

## Changelog

[iOS] [Changed] - Upgrade folly to 2021.06.28.00 and boost to 1.76.0

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

Test Plan: CI passed

Reviewed By: fkgozali

Differential Revision: D29668480

Pulled By: yungsters

fbshipit-source-id: 98eae9ca47f489dcea91974e6f5e9dcb4d66c40c
2021-07-16 15:13:12 -07:00
Ramanpreet Nara 281daf1222 Ship bridge RuntimeExecutor JSIExecutor flushing
Summary:
The RuntimeExecutor that Fabric gets from the bridge doesn't call JSIExecutor::flush(). In the legacy NativeModule system, we're supposed to flush the queue of NativeModule calls after every call into JavaScript. The lack of this flushing means that we execute NativeModule calls less frequently with Fabric enabled, and TurboModules disabled. It also means that [the microtask checkpoints we placed inside JSIExecutor::flush()](https://www.internalfb.com/code/fbsource/[62f69606ae81530f7d6f0cba8466ac604934c901]/xplat/js/react-native-github/ReactCommon/jsiexecutor/jsireact/JSIExecutor.cpp?lines=427%2C445) won't be executed as frequently, with Fabric enabled.

Changelog: [Android][Fixed] - Flush NativeModule calls with Fabric on Android, on every Native -> JS call.

Reviewed By: JoshuaGross, mdvacca

Differential Revision: D28620982

fbshipit-source-id: ae4d1c16c62b6d4a5089e63104ad97f4ed44c440
2021-06-02 16:54:33 -07:00
Neil Dhar 2c5f68df46 Disable WITH_FBREMAP
Summary:
WITH_FBREMAP was an experiment that is no longer needed. Just disabling the flag for now, the code will be deleted in a separate commit.

Changelog: [Internal]

Reviewed By: fkgozali

Differential Revision: D28467996

fbshipit-source-id: cb7bc00ea0b9d6e82219dda5148ab29978ddc83d
2021-05-19 12:23:39 -07:00
Peter Argany 36b58a824e Bump Flipper-Folly to 2.5.3 and RCT-Folly to 2021.04.26.00
Summary:
This fixes an error where folly fails to build on Xcode 12.5, by bumping the various folly deps in RN to builds with a fix.

Next step is to commit this to 0.64 release branch

allow-large-files

Changelog: [iOS] Fix builds on Xcode 12.5

Reviewed By: fkgozali

Differential Revision: D28071808

fbshipit-source-id: 236b66bf8294db0c76ff25b11632c1bf89525921
2021-04-29 10:39:25 -07:00
Ramanpreet Nara c0ec82e61e Add flushing to RuntimeExecutor
Summary:
## Motivation
With the bridge, every call into JS flushes the queue of NativeModule calls. Fabric bypasses this mechanism, because it uses a RuntimeExecutor that schedules work directly on the JavaScript thread. This diff makes Fabric's RuntimeExecutor also flush the queue of NativeModule calls.

This likely won't fix anything in Fabric, because we don't execute any async NativeModule calls on Fb4a. However, this is necessary for the drainMicrotask work we're doing in D27729702 (7310847758), because (1) we need to drain the Hermes microtask queue on every call from C++ -> JavaScript (2) we drain the microtask queue [inside JSIExecutor::flush()](de477a0df6/ReactCommon/jsiexecutor/jsireact/JSIExecutor.cpp (L427),L445).

Changelog: [Android][Fixed] - Flush JSIExecutor in Fabric's RuntimeExecutor

Reviewed By: JoshuaGross

Differential Revision: D27975839

fbshipit-source-id: 27f031fb36593253da116a033e30998475eb1473
2021-04-23 18:16:03 -07:00
Ramanpreet Nara db3625a3b0 Refactor: Move RuntimeExecutor into Instance.cpp
Summary:
RuntimeExecutor is currently declared inside NativeToJsBridge. It doesn't need to be: Instance.cpp can use NativeToJsBridge::runOnExecutorQueue to schedule work on the JS Thread. So, this diff moves RuntimeExecutor out of NativeToJsBridge into Instance.cpp. Now, both the JS CallInvoker and the RuntimeExecutor are declared in the same file.

Changelog: [Internal]

Reviewed By: JoshuaGross

Differential Revision: D27975840

fbshipit-source-id: aa06f479fa24bb7a15bfd21712df5414a183266c
2021-04-23 18:16:03 -07:00