Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/35621
Changelog: [Internal]
1. Added `for-each-package.js` script. This can be used to iterate through all of the packages inside `/packages` with the access to package manifest. This soon can be used as a replacement for `yarn workspaces --info`
2. Added `find-and-publish-all-bumped-packages.js` script. This script iterates through all the packages and detects if the version was changed via `git log -p` (same as `git diff`). If so, it tries to publish it to npm.
3. Added corresponding job and workflow to CircleCI config, which will use this script
Reviewed By: cortinico
Differential Revision: D41972733
fbshipit-source-id: c5d0ed5b852b744a699ecb88861ea3e82200e1f3
Summary:
While working on D42008409 I found out that codegen for pure C++ modules doesn't work with container types that are nested inside generated data structures, which happens because they don't have a specialization of `bridging::toJS` that wouldn't pass the `invoker` instance through.
It looks like an easiest option would be just to use `invoker` in codegen for `toJS` as well, which this diff does.
Note that I also experimented with removing `invoker` from being used in the `::toJS` specializations for containers altogether (see D42008410), as there doesn't seem to be a single use case when `invoker` would be ever needed in any `::toJS` specialization (and imagining such a scenario would be a stretch, tbh - why a conversion function would invoke anything running on JS side, given that invoker provides no return values anyway?..)
But since I am still not 100% about the invoker purpose there, I went with the codegen change.
Changelog: [Internal]
Reviewed By: christophpurrer
Differential Revision: D42008724
fbshipit-source-id: 6302d3ceacdfc8fed296ee1ef1a985f7273c2261
Summary:
changelog: [internal]
To make migration to the new architecture more straight forward, this change makes `UIManager.measure`, `UIManager.measureInWindow`, `UIManager.measureLayout` and `UIManager.measureLayoutRelativeToParent` functions backwards compatible. Users will not have to make any change to continue using the APIs.
This will make [Migrating .measure*()
](https://reactnative.dev/docs/new-architecture-library-intro#migrating-measure) in the migration guide optional.
Reviewed By: yungsters
Differential Revision: D41613050
fbshipit-source-id: 3c65ced231590243d118fbc120a87b08d5261da0
Summary:
I just noticed while working on 0.71 that the PR https://github.com/facebook/react-native/pull/35580 was incomplete. This PR takes care of re-aligning the leftovers. (in 0.71 I've taken care of the changes locally)
## Changelog
<!-- Help reviewers and the release process by writing your own changelog entry.
Pick one each for the category and type tags:
For more details, see:
https://reactnative.dev/contributing/changelogs-in-pull-requests
-->
[INTERNAL] [FIXED] - realign "leftover" metro packages from 0.73.3 to 0.73.5
Pull Request resolved: https://github.com/facebook/react-native/pull/35625
Test Plan: N/A
Reviewed By: cortinico, cipolleschi
Differential Revision: D41996338
Pulled By: dmytrorykun
fbshipit-source-id: bc1c95b0159f639e33835b922555d2f5b8c22c66
Summary:
This diff adds prepare command to hermes-engine.podspec. That command creates dummy `universal/hermes.xcframework` and `maocosx/hermes.framework`. This allow us to utilise CocoaPods auto-linking, and remove manual linking/cleanup code.
Also we now do not pollute user project with "Copy Hermes Framework" script phase. Which was quite bad on its own, and also caused annoying bugs on the CI.
allow-large-files
Changelog:
[iOS][Changed] - Prepare dummy hermes.xcframework before pod install.
Reviewed By: cipolleschi
Differential Revision: D41533994
fbshipit-source-id: d7d098ba5e882ac2d036335c23d7cda447d75b8d
Summary:
This is a backport of 0edcbc30c8. It fixes inconsistencies in caching strategies of Hermes tarball and Hermes workspace on CircleCI.
## Changelog
[INTERNAL] [FIXED] - Update CircleCI config to use the RN version in Hermes workspace caching.
Pull Request resolved: https://github.com/facebook/react-native/pull/35617
Test Plan:
1. Create and push a new branch.
2. Change version in. react-native/package.json
3. Push those changes.
Before:
CircleCI restores cached Hermes workspace for the old version.
After:
CircleCI creates new workspace for the new version.
Reviewed By: cipolleschi
Differential Revision: D41970943
Pulled By: dmytrorykun
fbshipit-source-id: 7e343b7a8d4b1c5a63016ec53538abe4ad7808cc
Summary:
The current implementation think `{[key:T]:U}` and `{key:object}` are the same type, which is semantically wrong.
This pull request fixes the problem and return `{type:'GenericObjectTypeAnnotation'}`, so that `{[key:T]:U}` is `Object`. The current schema cannot represent dictionary type, `Object` is the closest one.
The previous incorrect implementation actually bring in code with logic that doesn't make sense (treating indexer as property), those and related unit test are all undone.
## Changelog
[General] [Changed] - Fix codegen output for object with indexer
Pull Request resolved: https://github.com/facebook/react-native/pull/35344
Test Plan: `yarn jest react-native-codegen` passed
Reviewed By: rshest
Differential Revision: D41304475
Pulled By: cipolleschi
fbshipit-source-id: caab8e458d83f9850c5c28b67cc561a764738372
Summary:
When using the `g` modifier on the regex, match and matchAll's behaviour is equivalent, and match has better backwards compatibility on older iOS versions.
Changelog: [General][Fixed] Fixed a backwards compatibility issue with AnimatedInterpolation
Reviewed By: yungsters
Differential Revision: D41879036
fbshipit-source-id: 240dda85ef0de8e27452846c77114ac46823f74f
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/35619
Reference https://github.com/reactwg/react-native-releases/discussions/41#discussioncomment-4353534
I'm exposing `ReactAndroid/src/main/jni/react/cxxcomponents` to be consumed via prefab.
It will be available to both: `react_nativemodule_core` and `reactnativejni`
Changelog:
[Internal] [Changed] - Expose ReactAndroid/src/main/jni/react/cxxcomponents via prefab
Reviewed By: cipolleschi
Differential Revision: D41965512
fbshipit-source-id: 3a5a7473267e2e161d9d7fb0e8dfa74593b47b6e
Summary:
This is a two step (1/2) fix to a race that could caused a `DELETE`...`CREATE` mutations being sent over to the fabric mounting layer. Such combination was assumed not possible from the differ, yet it happened at least in the existence of layout animation and when certain commits happen while animation is active.
This race condition could cause a view to get deleted at the end of one UI frame, yet the mount instructions generated from animation in the next frame still need to access the deleted view and caused crashes like T112157805. Note that even though such crash is recorded as `RetryableMountingLayerException` and is a soft crash (which only gets logged but not crash in production), the out-of-order mount instructions could lead to illegal view state and make the surface unusable, like what's shown here:
{F820669000}
The diff fixes this issue by removing the `DELETE` [conflict animation](https://fburl.com/code/5ctckvz3) keyframe, as well as the `CREATE` [immediate mutations](https://fburl.com/code/txyomytd) from the layout animation. The Fabric mounting layer assumes no combination of `DELETE...CREATE` in the same frame from differ + [layout animation overrides](https://fburl.com/code/zn17uqch).
Reviewed By: sammy-SC
Differential Revision: D41895427
fbshipit-source-id: d6df02663ba707af6db4a63a325ac776ca54d18e
Summary:
This diff adds support for String props on C++ Components
changelog: [internal] internal
Reviewed By: genkikondo
Differential Revision: D41784029
fbshipit-source-id: 3065186074e1feca3dd0dd724105f1596146ee1d
Summary:
Previous diff D41486648 is causing crashes and a sev S311353, which is due to usages of an old Android API that only work after level 24 (D36500518 (0fc42fd35c)). ~~This diff updates the implementation to use a compatible API, but with worse runtime complexity.~~
~~https://fburl.com/txd0r89e is a good explanation on the two algorithm to calculate a streaming median value. This diff uses the approach described in https://stackoverflow.com/a/4903642.~~
## Update
Following suggestion from sshic, I preserved the existing algorithm but with a custom comparator approach.
Changelog: [Internal]
Reviewed By: makovkastar
Differential Revision: D41505143
fbshipit-source-id: 494e07fa627b5cf8bad7971fa5de86d270a7412c
Summary:
Makes sure that we don't spam too often the JS performance entry reporting callback, which further dispatches entries to `PerformanceObserver` instances.
The logic is as following:
* ~~~If internal buffer of entries reaches the limit, we schedule the callback (with background priority)~~~
*~~~ Once the callback is processed, we schedule the next flush after a timeout of 500ms, this will also be scheduled from native with background priority~~~
* ~~~Whenever new performance type starts to be observed, we also schedule the callback, in order to prime the above~~~
* Schedule the flush with low priority, whenever there is the first entry coming into an empty buffer, and rely on the Scheduler to "do the right thing" when asked to flush it with background priority and not doo it exceedingly often (see the prolonged discussion)
Changelog: [internal]
Reviewed By: rubennorte
Differential Revision: D41875085
fbshipit-source-id: 368b525203215350ceabb43d5e9e8e3bd5242aca
Summary:
Delete references of CppComponentRegistry from the internals of React Native Android renderer, since it's not necessary anymore
changelog: [internal] internal
Reviewed By: javache
Differential Revision: D41638890
fbshipit-source-id: c4b08853722874dbb21891817836862225469dd9
Summary:
This diff deletes the first implementation of C++ ViewManagers integrated into the internals of Fabric
changelog: [internal] internal
Reviewed By: javache
Differential Revision: D41638894
fbshipit-source-id: 2e7aebff587e2e57b7f3fbf37a24b04943c74573
Summary:
There are other 3 packages which have unreleased changes on main:
```
babel-plugin-codegen/
eslint-plugin-specs/
eslint-config-react-native-community/
```
I'm bumping them in order to be able to publish them to NPM.
Changelog:
[Internal] [Changed] - Bump further patch packages to unblock nightly as they have unreleased changes on main
Reviewed By: hoxyq
Differential Revision: D41874749
fbshipit-source-id: 0b8cd69cab6fcb116f2635c964490927f4fb20be
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 (e2bd7db732) 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 .
![Simulator Screen Recording - iPhone 14 Pro - 2022-12-07 at 15 15 40](https://user-images.githubusercontent.com/6722175/206318170-1893c8f6-0596-4825-8312-f45e45557095.gif)
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 8e2bde6f27/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