Summary:
We are running into a group seeing frequent disconnects from Metro in a specific office. These are surfaced (at least on iOS) as websocket closures, without a prior websocket error. WebSocket closure can be for a variety of reasons, and the spec for a CloseEvent is to include fields `wasClean`, `code`, and `reason`, with `code` having the most well-defined meaning.
This change makes it so that we emit extra context when the websocket is closed. That should help inform developers the reason behind any close that may be abnormal.
Changelog:
[General][Added] - Log Abnormal Closes to Metro Websocket
Reviewed By: motiz88
Differential Revision: D40660765
fbshipit-source-id: ef606d8d809af1c697a78eb00cc5666c29a8bca3
Summary:
Currently, RCTBlobManager (the native module for Blob support) cannot be loaded on iOS when the new architecture is enabled.
## Changelog
[General] [Added] - `BlobModule` to `RCTCoreModulesClassProvider`
Pull Request resolved: https://github.com/facebook/react-native/pull/35047
Test Plan:
The snippet below can be used to test Blob support with the new architecture enabled.
```
// App.tsx
import { useEffect } from 'react';
import { View } from 'react-native';
function uriToBlob(uri: any) {
return new Promise((resolve, reject) => {
const xhr = new XMLHttpRequest();
xhr.responseType = 'blob';
xhr.onload = () => {
const blob = xhr.response;
resolve(blob);
};
xhr.onerror = err => {
reject(err);
};
xhr.open('GET', uri);
xhr.send();
});
}
export default function App() {
useEffect(() => {
uriToBlob('https://www.google.com/images/branding/googlelogo/1x/googlelogo_color_272x92dp.png');
});
return <View />;
}
```
Related issue: https://github.com/facebook/react-native/issues/35042
Reviewed By: NickGerleman
Differential Revision: D40716048
Pulled By: cipolleschi
fbshipit-source-id: 17643d230fa7ea83baee363d137d51f87818baa8
Summary:
This remove a flag to effectively go publishing to Sonatype.
The idea was to protect us against accidentally publishing a nightly as a stable release.
We need to remove this before RC0
Changelog:
[Internal] [Changed] - Remove the --dry-run gate from publishing to Sonatype
Reviewed By: cipolleschi
Differential Revision: D40687038
fbshipit-source-id: e6821905f41899430813f9575f17a5068b05a9bb
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/35092
As we're close to the cut of the 0.71 branch, I'll take the opportunity to polish
our Gradle public API.
We're exposing a mixture of Path (String) and File (java.io.File or RegularFileProperty).
Here I've moved everything to use File as it's more configurable for the users,
specifically if they're using monorepos or other setup.
This also allows us to remove the resolution logic for the cliPath.
Changelog:
[Internal] [Changed] - RNGP - Use the File Api to specify cliPath and remove ComposeSourceMap path
Reviewed By: cipolleschi
Differential Revision: D40710595
fbshipit-source-id: a17095eebae5123b70fd2b8e3d512656817006ca
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/35091
This diff refines the DefaultNewArchitectureEntryPoint to make it easier for user to
either turn on Fabric, TurboModules or both.
Changelog:
[Internal] [Changed] - Make it easier for user to toggle only Fabric or TurboModules in New Architecture
Reviewed By: cipolleschi
Differential Revision: D40710596
fbshipit-source-id: 236060b2ebccb1bf25e7f5c0fc15f54c5ce5f608
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/35093
It turns out that using the Artifacts API to manipulate the APK to remove
.so has unintended side effects and is causing the `installDebug` and `installRelease`
commands to fail.
I've resorted to register a packaging option for each variant to make sure we include only
the correct artifacts we want.
This should fix the current startup crash that is experienced on main.
Changelog:
[Android] [Fixed] - RNGP - Do the .so cleanup using pickFirst and exclude
Reviewed By: cipolleschi
Differential Revision: D40722285
fbshipit-source-id: 982e1e9c474522fc4419c969ede5ee14e5404f3a
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/35083
We don't need to `enableCodegenInApps` keys but we can instead rely on the
existence of the `codegenConfig` key inside the `package.json` to decide if
Codegen should run in App modules or not.
Changelog:
[Internal] [Changed] - RNGP - Remove enableCodegenInApps and infer it from package.json
Reviewed By: cipolleschi
Differential Revision: D40687079
fbshipit-source-id: cd4a6c67caa19c1d199ae75388a0551339f876a0
Summary:
This PR is part of https://github.com/facebook/react-native/issues/34872.
This PR contains two changes, extracting the visitor object and then factoring out the `getConfigType()` function to the `parsers/utils.js` file. Then we can reuse the same function in both flow and typescript by passing the extracted visitor object.
## Changelog
[Internal] [Changed] - Extract visitor object in the same file and factor out `getConfigType()` to `parsers/utils.js`.
Pull Request resolved: https://github.com/facebook/react-native/pull/35035
Test Plan: Output of `yarn jest react-native-codegen` ensures all passed test cases
Reviewed By: cortinico
Differential Revision: D40548855
Pulled By: cipolleschi
fbshipit-source-id: 310b8565322a4e4800a3fffc67479a9dfa45d620
Summary:
changelog:
[general][Added] - Concurrent rendering safe implementation of ScrollViewStickyHeader
This is a re-land of ScrollViewStickyHeader from Kacie Bawiec.
Reviewed By: yungsters
Differential Revision: D40380217
fbshipit-source-id: 60dc86086a4d9d97eef71c4ed2e26536f7e72889
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/35089
Changelog:
[General][Fixed] - Back out "Add enum example to Android/iOS rn-tester TurboModule"
This broke the rn-tester adding due to an invalid flow-enum setup. Needs further investigation
Reviewed By: cipolleschi
Differential Revision: D40714320
fbshipit-source-id: 9831276762f90df0ffaca3304382fe5925009343
Summary:
This pull request migrates the activity indicator example to using React Hooks.
## Changelog
[General] [Changed] - RNTester: Migrate ActivityIndicator to hooks
Pull Request resolved: https://github.com/facebook/react-native/pull/35071
Test Plan: The animation works exactly as it did as when it was a class component
Reviewed By: jacdebug
Differential Revision: D40698379
Pulled By: NickGerleman
fbshipit-source-id: 08b275fcc4e3a10b5872e0031fa2ecce5360a7b9
Summary:
fd91748146 added a condition not to pump an extra message when we didn't see symbolication warnings (which do not seem to show up in a stock internal build), but I missed that the test specific to RCTLogLevelError checked for string containment instead of equality, and the last assertion we process on log level is incorrect in OSS as a result.
Changelog:
[Internal][Fixed] - Fix RCTLoggingTests in OSS
Pull Request resolved: https://github.com/facebook/react-native/pull/35085
Test Plan:
`test_ios-Hermes` passes again in OSS: https://github.com/facebook/react-native/pull/35085 (JSC and Android failures look unrelated)
RCTLoggingTests still pass running `buck test //xplat/js/react-native-github/packages/rn-tester:RNTesterIntegrationTests`
Reviewed By: rshest
Differential Revision: D40699773
Pulled By: NickGerleman
fbshipit-source-id: 5acc8ec2b26a1f9acac2f070b85f1d65ee15a011
Summary:
* Add a DevToolsSettingsManager, which has android and iOS variants, which uses a new TM (Android) or takes advantage of the Settings TM (iOS) to get/set console patch settings
* This is backed by either the existing Settings module (iOS) or a new Java TM, which uses the SharedPreferences AP
## Testing
Manual testing
## Changelog
[General] [Added] - Add DevToolsSettingsManager
Pull Request resolved: https://github.com/facebook/react-native/pull/34964
Test Plan: * Extensive manual testing
Reviewed By: NickGerleman
Differential Revision: D40333083
Pulled By: rbalicki2
fbshipit-source-id: f3816e3bd7dea3086f6f2269c3a099af14aebb3b
Summary:
Without this, the CocoaPods output would display multiple "Building RNTester..." logs. With these changes, we make it clear that these are separate targets that are being configured.
Changelog: [internal]
Reviewed By: mdvacca, cipolleschi
Differential Revision: D40656813
fbshipit-source-id: a317112e804d08b9e64e2d62e8b27e4045b317b0
Summary:
Some portions of continuous test runs RNTesterIntegrationTests will hang for an hour when running in Sandcastle without outputting anything. Locally debugging, I see a deadlock waiting on a semaphore, where the test assumed an extraneous symbolication warning would be fired.
This change makes it so that we only look for the extraneous messages if we haven't already seen the target message, since they do not seem to show up in local testing. I also added assertions per semaphore that the log statement is propagated within a still very gracious 10 seconds. This means we still can see what tests are running/failing if this test has issues, instead of a deadlocked test runner with no output.
Changelog:
[Internal][Fixed] - Fix deadlock in RCTLoggingTests
Reviewed By: cipolleschi
Differential Revision: D40667275
fbshipit-source-id: ab78f3c2ef47e2fd740b1dad2a65912e9542301d
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/35079
This bumps the Docker image for React Native Android to 6.0
shipping the NDK 23 with it, finalizing all the work needed
to support NDK 23.
Changelog:
[Internal] [Changed] - Bump the Android Docker image to 6.0 (for NDK 23)
Reviewed By: cipolleschi
Differential Revision: D40675449
fbshipit-source-id: 5fb53080ce796263cd592dbc489743e6295060ba
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/35075
This diff updates the New App template for Android to use the React Native Gradle Plugin.
With this we can:
1. Get rid of all the C++ code.
2. Remove a lot of New Architecture logic in the build.gradle
3. Reuse the prebuilts of React Native/Hermes via prefab
Changelog:
[Android] [Changed] - Update the template to use RNGP
Reviewed By: cipolleschi
Differential Revision: D40673732
fbshipit-source-id: 70935248993d1e24904c982e75f12ad580faa9d8
Summary:
There are use cases in which we want to pass a set of unique elements from C++ to JS and back. We can do this simple by re-using a plain JS array for these purposes.
Changelog:
[Internal][Added] react-native bridging > Add support for std::set
Reviewed By: cipolleschi
Differential Revision: D40668244
fbshipit-source-id: d06603440569e5f760c2859a54cf6e4232c7d97a
Summary:
With RNGP we can now deprecate react.gradle
I'll create a page on the website to describe what is the migration strategy here,
but users should be fine by just replacing `apply from react.gradle` with
`apply plugin: com.facebook.react`.
Changelog:
[Android] [Removed] - Deprecate react.gradle
Reviewed By: cipolleschi
Differential Revision: D40675546
fbshipit-source-id: a50348791d669df1ed9e0470a6664e291c1a4584
Summary:
The `typeof X` type annotation now respects the initialization state of `X`: if `X` hasn't been declared it will be an error to get its type.
Changelog: [Internal]
Reviewed By: jbrown215
Differential Revision: D40638870
fbshipit-source-id: 57459dec30ec5b87397365a709f2d846c87e378a
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/35036
This diff is the base to create a polimorphic behavior for TypeScript and Flow parser. This type will allow to share a lot of code between the parsers and also to keep their differences a part.
It will be the base diff/PR for further tasks in the Codegen umbrella Issue
## Changelog:
[General][Added] - Parser interface to divide parser logic.
Reviewed By: cortinico
Differential Revision: D40548707
fbshipit-source-id: e632ba52b00b43e50306e3a792a841e72e8c07f4
Summary:
Bumping RNGP to make sure all the changes are available for 0.71
I've also removed the caret from react-native's package.json as
I don't want .5 to be used by template tests yet.
The Android template needs to be updated in order to use
that version of the Gradle plugin.
Changelog:
[Internal] [Changed] - Bump react-native-gradle-plugin to 0.71.5
Reviewed By: cipolleschi
Differential Revision: D40642114
fbshipit-source-id: 70359efc3d2300e9c04c1b361c45061fd1c2931b
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/35066
This just bumps the NDK version used inside the template to be 23.
We can't merge this as it is but we have to wait for a bump of the Docker image for Android.
Changelog:
[Android] [Changed] - Bump NDK to 23
allow-large-files
Reviewed By: cipolleschi
Differential Revision: D40637103
fbshipit-source-id: e637140cbe6052e94a6efedf12f4b5b81b90a7eb
Summary:
Throws a JS error instead of crashing Hermes with an invariant when trying to convert a JS symbol or BigInt to a folly::dynamic value.
Changelog:
[General][Fixed] - Fixed crash when converting JS symbol to folly::dynamic
Reviewed By: javache
Differential Revision: D40444164
fbshipit-source-id: 37df8059b2eb425563f30cf1e9c0436e8d665b34
Summary:
I tried to build the source locally to test changes with `rn-tester`. However, the gradle build failed due to "./ReactAndroid/gradle.properties (No such file or directory)". I believe this error was introduced by https://github.com/facebook/react-native/commit/3d05bac5872b42a5f412ec9042ce5be0b5d5b8d3.
## 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] [Fixed] - Fix ReactAndroid not found in rn-tester build
Pull Request resolved: https://github.com/facebook/react-native/pull/35058
Test Plan:
- Clone the react-native repo.
- Run `cd packages/rn-tester`.
- Run `yarn install-android-jsc` and encounter the error.
- Apply the fix.
- Run `yarn install-android-jsc` and build succeeds.
Reviewed By: cipolleschi
Differential Revision: D40639856
Pulled By: cortinico
fbshipit-source-id: 58b51bcad0af7a21cac032c98484c5942a203e4c
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/35067
I accidentally broke test_android by landing a diff without waiting for
the full CI output.
Changelog:
[Internal] [Fixed] - Unbreak test_android by passing the correct file to hermesc
Reviewed By: cipolleschi
Differential Revision: D40638239
fbshipit-source-id: 1d03106f3b144f537265910df095a6023b181d85
Summary:
As pointed out by necolas on https://github.com/facebook/react-native/issues/34424#issuecomment-1261482517 we forgot we add the `role` prop mapping to the `Text` component. This PR adds a new `role` prop to `Text`, mapping the web `role` values to the already existing `accessibilityRole` prop and moves the `roleToAccessibilityRoleMapping` to a common file that can be imported by both the `Text` and `View` components as requested on https://github.com/facebook/react-native/issues/34424. This PR also updates the RNTester AcessebilityExample to include a test using this new prop.
## Changelog
[General] [Added] - Add role prop to Text component
Pull Request resolved: https://github.com/facebook/react-native/pull/34976
Test Plan:
1. Open the RNTester app and navigate to the Accessibility Example page
2. Test the `role` prop through the `Text with role = heading` section
Reviewed By: yungsters
Differential Revision: D40596039
Pulled By: jacdebug
fbshipit-source-id: f72f02e8bd32169423ea517ad18b598b52257b17
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/35063
This is part of a series of tasks to make the React Native Gradle Plugin (RNGP) variant-aware.
Here I'm add Variant support to RNGP via the Variant API from AGP 7.x
A short summary of changes:
- I've pushed a number of breaking changes to ReactExtension (we should document them in the release notes). Specifically I've removed properties which I believe were unnecessary and confusing
- I've removed all the extra logic to do the .so cleanups and use the new tasks that use the Artifacts API
- I've introduced only a `debuggableVariants` to make all the decisions for the bundling and minification which should be sufficient for users
- I've removed all the funcional interfaces are replaced them with lists as they're easy to handle and understand for users.
Changelog:
[Android] [Changed] - Added Flavor Support to React Native Gradle Plugin (RNGP)
Reviewed By: cipolleschi
Differential Revision: D40335028
fbshipit-source-id: d9ac1437de8a27db2e93df15b13772b221e036b2
Summary:
This is part of a series of tasks to make the React Native Gradle Plugin (RNGP) variant-aware.
I'm extending RNGP to do autoconfiguration of dependencies for React Native and Hermes Engine using the Utils classes which were introduced before.
Changelog:
[Internal] [Changed] - RNGP - Automatically Configure Dependencies for ReactNative & Hermes
Reviewed By: cipolleschi
Differential Revision: D40633487
fbshipit-source-id: d4240987a9400fff2ec2aff2d13afc5b24778598
Summary:
This is part of a series of tasks to make the React Native Gradle Plugin (RNGP) variant-aware.
Historically we used to enable the codegen only for library modules. This is not working well for apps like RN Tester which don't have library modules but are running the codegen.
Therefore I'm introducing the `enableCodegenInApps` that is allowing apps to turn off the codegen if needed.
Changelog:
[Internal] [Changed] - RNGP - Introduce enableCodegenInApps
Reviewed By: cipolleschi
Differential Revision: D40633106
fbshipit-source-id: dc2ae9bbfe5b7940f9e9fe505ab2198a42c8a3f6
Summary:
This is part of a series of tasks to make the React Native Gradle Plugin (RNGP) variant-aware.
Here I'm renaming the top level property to enable hermes from `enableHermes` to `hermesEnabled`. We have a bunch of other properties which are called *Enabled. This one was following a different convention.
I'm retaining the backward compatibility for users using `project.ext.react.enableHermes` so this is not going to be a breakign change.
Changelog:
[Internal] [Changed] - RNGP - Top level property enableHermes -> hermesEnabled
Reviewed By: cipolleschi
Differential Revision: D40633109
fbshipit-source-id: 9d7efad6cb3bb382d1beb56966795a3f42bdaae6
Summary:
This is part of a series of tasks to make the React Native Gradle Plugin (RNGP) variant-aware.
Here I'm creating a new task BundleAndHermesCTask that is variant-aware.
Historically we had problems with the Bundle and the Hermes task being separated and overriding their own output. Consolidating those two steps in a single one will make it easier to support seaprate variants.
I'm going to use this task in a subsequent diff.
Changelog:
[Internal] [Changed] - RNGP - Introduce the BundleAndHermesCTask
Reviewed By: cipolleschi
Differential Revision: D40633108
fbshipit-source-id: 89f6d32ef219626ed5d4c5a0b8ac804c6704b2d6