Summary:
Changelog:
[Internal][Added] - Provided a way to override long press sensitivity,
Reviewed By: javache
Differential Revision: D41766246
fbshipit-source-id: befeafd93a73675ec609b0510dd8b5190b07dda0
Summary:
After adding `<uses-permission android:name="android.permission.POST_NOTIFICATIONS"/>` on my `AndroidManifest.xml`, I expected to use `PermissionsAndroid.PERMISSIONS.POST_NOTIFICATIONS` but `POST_NOTIFICATIONS` is `undefined` and is named `POST_NOTIFICATION` instead.
Every other Android permission is 1:1 in spelling except this one where it lacks `S`.
Not sure if this is a welcome change since this can be breaking. Or maybe we can include both with and without `S` to not be a breaking change. Or just keep it as is and close this PR.
## 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
-->
[Android] [Changed] - Rename `POST_NOTIFICATION` to `POST_NOTIFICATIONS`
Pull Request resolved: https://github.com/facebook/react-native/pull/35533
Test Plan: `PermissionsAndroid.PERMISSIONS.POST_NOTIFICATIONS` should not be `undefined`.
Reviewed By: cortinico
Differential Revision: D41705866
Pulled By: philIip
fbshipit-source-id: a0328b174f0196421565f0cd2b2f1eb509428553
Summary:
Our implementation of `PerformanceObserver.prototype.observe` diverges a little bit from the [spec](https://w3c.github.io/performance-timeline/#dom-performanceobserver-observe) regarding the behavior when calling it multiple times. E.g.:
1. We don't throw errors if both `type ` and `entryTypes` are passed.
2. We don't throw errors if neither `type ` nor `entryTypes` are passed.
3. We don't throw errors if we call observe with `type` and we call again later with `entryTypes`, and vice versa.
4. The logic to consolidate entry types in subsequent observe calls is incorrect.
This fixes those issues and also applies some minor naming improvements.
Changelog: [internal]
Reviewed By: rshest
Differential Revision: D41872269
fbshipit-source-id: 9a6b485f4ef2f479c8b6f0307012322f65a11879
Summary:
We're currently showing warnings when we call `performanceObserver.observe` and the native module for performance observers isn't available, but we don't do the same for `performance.mark`, `performance.measure`, etc.
This adds the warning in those cases.
Changelog: [internal]
Reviewed By: rshest
Differential Revision: D41872270
fbshipit-source-id: d720580b930550f27c827a58243579c42a4f6da9
Summary:
Re-apply #29278 that was recently closed by still valid.
Changelog:
[Internal] [Changed] - Update reference to statusBarTranslucent in Modal comment
Reviewed By: christophpurrer
Differential Revision: D41765526
fbshipit-source-id: 0397e86aa9adc5e5495cad8e2612cc5457840273
Summary:
Nightlies are currently broken on main. That's because nightlies rely on packages that got
re-scoped under `react-native`. We need to publish them to NPM.
In order to do so, I'm bumping versions for the one that have changes on main so that they
can be published to NPM to unblock nightlies.
Changelog:
[Internal] [Changed] - Bump all the react-native/ packages to publish on main
Reviewed By: hoxyq
Differential Revision: D41840985
fbshipit-source-id: 45b691611e33668df0922d4ff753738a773f162c
Summary:
Changelog:
[iOS][Changed] - Create a new compile time flag to enable remote sample profiling.
Reviewed By: cortinico
Differential Revision: D41554133
fbshipit-source-id: 00a7f9f6c9f09d72afee070c1cc6187aa3d0ddb1
Summary:
Changelog:
[Android][Changed] - Include the inspector in all build modes, and only turn it off/on at runtime.
Reviewed By: jpporto
Differential Revision: D40248901
fbshipit-source-id: f13c58f631e4617a6f157df8899e128959af450a
Summary:
Running pod install result in some warninigs on ruby v3:
```
script_phases.rb:51: warning: Passing safe_level with the 2nd argument of ERB.new is deprecated. Do not use it, and specify other arguments as keyword arguments.
script_phases.rb:51: warning: Passing trim_mode with the 3rd argument of ERB.new is deprecated. Use keyword argument like ERB.new(str, trim_mode: ...) instead.
```
## Changelog
[INTERNAL] [FIXED] - warnings while running `pod-install` inside script phase script
Pull Request resolved: https://github.com/facebook/react-native/pull/35594
Test Plan:
- Install ruby v3 (I haven't tested on ruby v2, most m1 users need to upgrade to v3)
- Run `pod install` in ios folder
Reviewed By: christophpurrer
Differential Revision: D41839668
Pulled By: cortinico
fbshipit-source-id: f3d328573179ddfd307011f0701f0befa0b111f8
Summary:
`AlertIOS` was deprecated and removed long ago (https://github.com/facebook/react-native/commit/e2bd7db732602b2c477fe040f2946bd8293df297) but there continues to be a test page with the name `AlertIOS` in RN-Tester. `AlertIOSExample.js` contains valid examples of how to use `Alert.prompt()` so it's worth keeping them around. Let's move those into `AlertExample.js` and remove `AlertIOSExample.js`. While we're here, let's do some extra fixes to the test page:
- Remove `showsIndividualExamples = true`. For whatever reason, I needed to remove this to show the examples properly...
- Convert all uses of `<TouchableHighlight>` with `<Pressable>`. The latter replaces the former, so I thought that made sense..
Some extra context:
In React Native macOS, we had forked `AlertIOS` into `AlertMacOS`, with a corresponding example page. This PR was made while working on removing those (https://github.com/microsoft/react-native-macos/pull/1548/).
## Changelog
[INTERNAL] [CHANGED] - Moved `Alert.prompt` examples into common rn-tester test page
Pull Request resolved: https://github.com/facebook/react-native/pull/35586
Test Plan:
Test page shows up fine on iOS .

Reviewed By: lunaleaps
Differential Revision: D41825889
Pulled By: NickGerleman
fbshipit-source-id: 82e4405b1f3a1ccb558b5a5038a90416e7a32c29
Summary:
Encountered this, causing typechecking to fail on an example in the current RN documentation.
`onFail` is an optional parameter (see https://github.com/facebook/react/blob/8e2bde6f2751aa6335f3cef488c05c3ea08e074a/packages/react-native-renderer/src/ReactNativeTypes.js#L106), which is not optional in current TS types. Update the TS typings to match.
Note that "?" here is positioned to be a Flow optional parameter, instead of a maybe type. Which means it accepts undefined, but not null, matching the TS usage of "?" which always means possibly undefined (but never null, like a flow maybe type allows).
Changelog:
[General][Fixed] - Fix TS Type for measureLayout optional parameter
Reviewed By: lunaleaps
Differential Revision: D41775900
fbshipit-source-id: 8f53428b8077ec9139c7c1bbc60ed20f5fa9f7ea
Summary:
In this diff I'm extending component to integrate layout and hierarchy of components
changelog: [internal] internal
Reviewed By: javache
Differential Revision: D41621587
fbshipit-source-id: e31c87676ec3068036fb6e9444bce85934b18b7b
Summary:
changelog: [internal]
Fix Flow types for UIManager measure functions.
Host platform does not accept null value for reactTag parameter. It errors if null is passed. This moves error closer to developers as Flow can catch it.
Reviewed By: javache
Differential Revision: D41614452
fbshipit-source-id: 2216c195808b8a1aae58c7cb2fa15be8a073e222
Summary:
We have the expected module name available as part of the codegen schema, so we can remove the need for developers to implement the `getName` method as part of their module implementation.
Note that this method is not actually used when the TurboModules infra is used, as the moduleName from the turbo module manager is passed through to the TurboModule base class instead. Moving the method to codegen will make it easier to remove this method altogether once the old architecture is fully removed.
Changelog: [Android][Added] Support generating `getName` in react-native-codegen for Java TurboModules
Reviewed By: mdvacca
Differential Revision: D41615387
fbshipit-source-id: 6b117645fa39e5e9ab014b21198496a52f6f2ae2
Summary:
Small PR with bump to the new versions of CLI and Metro in preparation of the stable release for 0.71.
## Changelog
[General] [Changed] - Bump CLI to 10.0.0 and Metro to 0.73.5
Pull Request resolved: https://github.com/facebook/react-native/pull/35580
Test Plan: CI green
Reviewed By: cortinico
Differential Revision: D41800580
Pulled By: jacdebug
fbshipit-source-id: 7bf81308eb41490b004e685b1763574bfd3b27fb
Summary:
This diff adds type parameters to all uses of `new Array`.
Changelog: [internal]
Reviewed By: SamChou19815
Differential Revision: D41746116
fbshipit-source-id: 8aa2777dd13ef4cd9f8613adaa3509d3573d4446
Summary:
Changelog: [Internal]
This implements the C++ side logic of handling `Performance.measure` calls.
Since measures may refer to earlier logged marks by name, we need to keep track of the former. I also use a fixed size (circular) buffer to prevent the marks from piling forever.
Also adds implementation of clearing marks/measures, as per standard.
Reviewed By: mdvacca
Differential Revision: D41756928
fbshipit-source-id: 19dce28d6af4c5646274e6d5db20b41869282780
Summary:
Changelog: [Internal]
This adds JS side implementation (including the API) for the `Performance.measure` functionality, [as described in the corresponding standard](https://www.w3.org/TR/user-timing/#measure-method).
The JS part is separated from the C++ implementation (further down the stack) to help the review being more focused.
Reviewed By: mdvacca
Differential Revision: D41733190
fbshipit-source-id: 72b69f6bb332aed4b9477a186b0e818b62009220
Summary:
Followup to D41654962 (https://github.com/facebook/react-native/commit/59ee57352738f030b41589a450209e51e44bbb06), it looks like the default parser here is something different, so not all newer JS syntax is correctly recognixed. Set the parser for JSX to babel/eslint-parser explicitly.
Changelog:
[General][Fixed] - Explicitly set parser for jsx in ESLint config
Reviewed By: motiz88
Differential Revision: D41708672
fbshipit-source-id: 362716ab0aadb7c9cf5fc9f1175b69168372df88
Summary:
changelog: Introduce setNativeProps to Fabric
Add support for `setNativeProps` in Fabric for backwards compatibility. It is still recommended to move away from `setNativeProps` because the API will not work with future features.
We can make step [Migrating off setNativeProps](https://reactnative.dev/docs/new-architecture-library-intro#migrating-off-setnativeprops) in migration guide optional.
Reviewed By: yungsters, mdvacca
Differential Revision: D41521523
fbshipit-source-id: 4d9bbd6304b8c5ee24a36b33039ed33ae1fc21f8
Summary:
changelog: [internal]
Add findShadowNodeByTag_DEPRECATED` to Fabric's UIManager.
This API makes it possible to get ShadowNode reference for given native tag.
We will leverage this API to make UIManager.measure* calls backwards compatible in the new architecture.
Reviewed By: yungsters
Differential Revision: D41550734
fbshipit-source-id: a45b6a76634d034eac70603bad8ac60f9135ff24
Summary:
`findPackageJsonFile` always returns a path even though `package.json` does not exist. This causes issues in libraries whose repo setups look like:
```
react-native-webview
├── android
│ └── build.gradle
├── example <-- Note the lack of `package.json` here
│ └── App.tsx
├── ios
│ └── RNCWebView.xcodeproj
├── macos
│ └── RNCWebView.xcodeproj
├── package.json
└── src
```
When `newArchEnabled=true`, running `yarn android` will fail with the following:
```
FAILURE: Build failed with an exception.
* What went wrong:
Could not determine the dependencies of task ':app:generateCodegenArtifactsFromSchema'.
> Could not create task ':app:generateCodegenSchemaFromJavaScript'.
> /~/react-native-webview/example/package.json (No such file or directory)
```
## Changelog
[Android] [Fixed] - `findPackageJsonFile` should return `null` if `package.json` does not exist
Pull Request resolved: https://github.com/facebook/react-native/pull/35566
Test Plan:
```
git clone https://github.com/react-native-webview/react-native-webview.git
cd react-native-webview
git checkout new-arch-ios
yarn
cd example/android
./gradlew clean assembleDebug
```
Reviewed By: NickGerleman
Differential Revision: D41739176
Pulled By: cortinico
fbshipit-source-id: cab0f1f717db160df244c9bb2769e345d6e19917
Summary:
Changelog:
[General][Changed] - renamed react-native/polyfills -> react-native/js-polyfills and align with other packages versions (0.72.0) as a part of migration to monorepo
Reviewed By: motiz88
Differential Revision: D41553157
fbshipit-source-id: eef70c8e7639080acdeb6716d1a915760a85458a
Summary:
Missed while reviewing https://github.com/facebook/react-native/pull/34974 that flex gap props in Flow typings were added to ShadowStyle instead of LayoutStyle (directly above). The same issue is not present in the TS typings.
Changelog:
[General][Fixed] - Move flex gap props to the correct type
Reviewed By: yungsters
Differential Revision: D41736652
fbshipit-source-id: de0db1676464fbd962b2c7e7e9ef62b795332f1b
Summary:
Color support for AnimatedInterpolation was incomplete with native drivers, as only rgba type strings were supported. There was also an issue where color props instead a StyleAnimatedNode would never get applied. We were also potentially duplicating color parsing support, which is already centralized in normalizeColor / processColor.
Changelog: [iOS][Added] Enable AnimatedInterpolation to interpolate arbitrary color types.
Reviewed By: philIip
Differential Revision: D41649337
fbshipit-source-id: 505ba555b6a79113635fdfb35c6fe69c92d82234
Summary:
This PR prevents blob data from being prematurely de-allocated in native code when using slice to create views into an existing blob. Currently, whenever a new blob is created via createFromOptions, BlobManager.js creates a new blobCollector object since options.__collector is never provided.
https://github.com/facebook/react-native/blob/dc80b2dcb52fadec6a573a9dd1824393f8c29fdc/Libraries/Blob/BlobManager.js#L115-L123
When the reference to a blobCollector is garbage collected, the corresponding native memory for the blob data is de-allocated.
https://github.com/facebook/react-native/blob/27651720b40cab564a0cbd41be56a02584e0c73a/Libraries/Blob/RCTBlobCollector.mm#L19-L25
Since, `blob.slice()` is supposed to create a new view onto the same binary data as the original blob, we need to re-use the same collector object when slicing so that it is not GC'd until the last reference to the binary data is no longer reachable. Currently, since each blob slice gets a new blobCollector object, the memory is de-allocated when the first blob is GC'd.
Fixes https://github.com/facebook/react-native/issues/29970
Fixes https://github.com/facebook/react-native/issues/27857
## 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
-->
[iOS] [Fixed] - Blob data is no longer prematurely deallocated when using blob.slice
Pull Request resolved: https://github.com/facebook/react-native/pull/31392
Test Plan: I could use help coming up with a test plan here. I could add a referential equality check for the blob.data.__collector in `Blob-test` but it doesn't seem quite right to be testing the implementation detail there.
Reviewed By: javache
Differential Revision: D41730782
Pulled By: cortinico
fbshipit-source-id: 5671ae2c69908f4c9acb5d203ba198b41b421294
Summary:
D40660765 (https://github.com/facebook/react-native/commit/3982a2c6bd116a6dcc6ee6889e4a246b710b70a7) introduced extra logging for abnormal closes. The websocked 'close' event may not be called with the event argument.
Changelog: [Internal] - Fix for undefined websocket close
Reviewed By: jacdebug, cortinico
Differential Revision: D41731339
fbshipit-source-id: 92b28dcc0d55d0e9e32b4f4321f325fb3471edcd
Summary:
Newer versions of Buck (not released open source) support an `oncall` annotation to denote who owns a particular BUCK file. These annotations are useful to support so that if BUCK files are updated with such annotations they don't break.
## Changelog
[Internal] [Changed] - support oncall annotation in BUCK files
Pull Request resolved: https://github.com/facebook/react-native/pull/35562
Test Plan: The `test_buck` CI job validates that the file can be evaluated by open-source Buck. I ran this on a CircleCI fork, and it passed.
Reviewed By: motiz88
Differential Revision: D41731925
Pulled By: cortinico
fbshipit-source-id: 7d0ae164c3e6289d4aa76892658d46bbe4faf99c
Summary:
This note was added when upgrading from 0.69x to 0.70.x when `hermes_enabled` is explicitly set to `true`.
<img width="669" alt="Screenshot 2022-12-05 at 11 26 15" src="https://user-images.githubusercontent.com/36528176/205543104-b4a72c1c-57c0-422b-881e-8a0cb9d5c2a1.png">
But on 0.71, we are now using `get_default_flags` again which makes the note obsolete.
## Changelog
[Internal] [Removed] - removed hermes note
Pull Request resolved: https://github.com/facebook/react-native/pull/35555
Test Plan: N/A
Reviewed By: dmytrorykun
Differential Revision: D41731004
Pulled By: cortinico
fbshipit-source-id: d5f377062bf94fa73bc6e73d1f108e37ad68c715
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/35539
This file is unused now that we rely on RNGP. We should be able to remove it
in the next stable release 0.72. In 0.71 we shipped it with a removal warning,
and users should not rely on it anymore.
Changelog:
[Android] [Removed] - Remove the react.gradle file as it's unused
Reviewed By: rshest
Differential Revision: D41655709
fbshipit-source-id: 20860da5e596d35738eea5748c791d3d923dc4fb
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/35540
We now don't need to generate .mk files anymore, therefore I'm removing
this logic from the codegen. In RN 0.72 users should be fully migrated
to CMake.
Changelog:
[Android] [Removed] - Remove .mk prebuilt file and .mk file generation from codegen
Reviewed By: rshest
Differential Revision: D41654122
fbshipit-source-id: 3a3c01fa8ab4d48460338e1a9ce2ecbd6df25f47
Summary:
A codemod landed which broke our public CI as it added
disable_infer_precompiled_header which is not known to Buck OSS. This ignores the argument like we do for other internal parameter types.
Changelog: [Internal]
Reviewed By: cortinico
Differential Revision: D41729615
fbshipit-source-id: 30601d793b15cca3164d0513882da94064b47996
Summary:
D41708199 (https://github.com/facebook/react-native/commit/3e91415696a77e5106cc9cd58077632fdf534b37) updated `deprecated-react-native-prop-types` so we should be able to re-enable this test, which I previously disabled as part of making RN tests fail on `console.error()`/`console.warn()` (i.e. any test unintentionally creating a redbox/yellowbox).
Changelog:
[Internal]
Reviewed By: yungsters
Differential Revision: D41724052
fbshipit-source-id: 4e91809940c4bf9bde416367326167598a4d1354