Summary:
This change puts back D40716048 (https://github.com/facebook/react-native/commit/279cfec55fdf404fdb9198edbb37d3adfdfb3bf1) but in the right way, i.e. modifying the script that should generate those changes.
## Changelog
[iOS][Added] - Make the blobs proper TM
Reviewed By: dmytrorykun
Differential Revision: D41312160
fbshipit-source-id: 38850a63eb8d66ffd179743b4948a23340c8782e
Summary:
changelog: [internal]
Removing this to decrease clutter of warnings when devs navigate to Marketplace Home.
Reviewed By: cipolleschi
Differential Revision: D41306378
fbshipit-source-id: a1b7f8ebe1f4bb00e931d609eb97a3bbd5ef9052
Summary:
This PR is a task of https://github.com/facebook/react-native/issues/34872
- combined `Flow` and `TS` `buildPropertySchema` fn 's into common fn
- added callback param `resolveTypeAnnotation` to the same
- moved it to `parsers-commons.js`
- re-organized imports and exports
## Changelog
[INTERNAL] [CHANGED] - [Codegen]: Refactored `buildPropertySchema` fn of (Flow, TS) into common fn in `parsers-commons.js`
Pull Request resolved: https://github.com/facebook/react-native/pull/35288
Test Plan:
- ensure 👇 is `#00ff00`
```bash
yarn lint && yarn flow && yarn test-ci
```
Reviewed By: christophpurrer
Differential Revision: D41247738
Pulled By: cipolleschi
fbshipit-source-id: aecc0ed8d07efa1c2c39e8a8e64b4ee73b720b8f
Summary:
Cherry pick https://github.com/microsoft/react-native-macos/commit/e877ebfe083ffaa252738477098322504492f4be from React Native macOS into React Native Core. We've had this bug fix in our fork for a while now, so it's probably safe.
=== Original change notes ===
First, misc straightforward deprecated API updates.
Second, defensive changes to potentially address RCTDisplayLink crash.
Real-world data suggests crashes with this stack:
CVDisplayLink::start()
-[RCTDisplayLink updateJSDisplayLinkState] (RCTDisplayLink.m:157)
-[RCTDisplayLink registerModuleForFrameUpdates:withModuleData:]_block_invoke (RCTDisplayLink.m:67)
-[RCTTiming timerDidFire] (RCTTiming.mm:324)
-[_RCTTimingProxy timerDidFire] (RCTTiming.mm:93)
Some symbols are missing in this stack, presumably due to compiler optimizations.
-updateJSDisplayLinkState is calling CVDisplayLinkStart as a result of a
call to "_jsDisplayLink.paused = NO".
-registerModuleForFrameUpdates block is presumably getting called via pauseCallback,
likely via [RCTTiming startTimers], presumably owned by RCTCxxBridge.
The most likely immediate explanation for the crash is that we are calling
CVDisplayLinkStart with a zombie _displayLink pointer.
However there is a lot of indirection here as well as thread-hopping, and
unfortunately no clearly incorrect code that would explain such a zombie pointer.
Some defensive changes:
-explicitly remove the association to pauseCallback when underlying display link object is invalidated.
-remove a prior attempt at additional check in updateJSDisplayLinkState itself as it is not relevant.
-make sure we explicitly set _displayLink to NULL when we release it, such that there is one less failure point.
## 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] - RCTDisplayLink fix plus bonus deprecated API cleanup
Pull Request resolved: https://github.com/facebook/react-native/pull/35359
Test Plan: CI should pass.
Reviewed By: cipolleschi
Differential Revision: D41335438
Pulled By: christophpurrer
fbshipit-source-id: 5e97d28eab7dd8e5c81d0a5386df6631e16405a2
Summary:
Cherry pick https://github.com/microsoft/react-native-macos/commit/19a62d9f57a6fae7a046741e19978a801f69abee to React Native. These style props were being applied to a <Text> element, not a <View> element. They seemingly only worked because of a quirk of iOS.
=== Original change notes ===
The issue with the test is that the react native Text component has its own props for shadows - i.e. [textShadowColor, textShadowRadius, etc](https://reactnative.dev/docs/text-style-props) and the shadow props that View uses does not work on Text (i.e. shadowColor, shadowRadius, etc.). Not entirely sure how this test was passing without any errors before my change, it seems like something about the change is causing (expected) errors to actually show up.
## 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] - Shadow consistency opacity fix with test updates
Pull Request resolved: https://github.com/facebook/react-native/pull/35360
Test Plan: Tested in our React Native macOS fork on iOS.
Reviewed By: cipolleschi
Differential Revision: D41335366
Pulled By: christophpurrer
fbshipit-source-id: f789b9565ed4e00fa558af8e418dd9e078064f98
Summary:
X-link: https://github.com/facebook/yoga/pull/1173
In https://github.com/facebook/react-native/issues/35351 we see incorrect child item height when the flex-wrap is enabled, the cross-axis is to be stretched, and main-axis overflow is caused by gap.
In YGDistributeFreeSpaceSecondPass, if we do not have overflow (determined by flexBasisOverflows), we have stretch cross-alignment, and we reason that nothing can add to main axis dimensions, we know we're a single line and want to take full cross dimensions. and can set YGMeasureModeExactly which uses parent dimensions. Guessing an optimization?
If we do have overflow, then we set YGMeasureModeAtMost to find minimum possible cross-axis dimensions instead.
`flexBasisOverflows` incorporates both computed flex basis, and margin, so it is more generally a flag for whether we will wrap. So we should incorporate gap spacing into it. E.g. it is also used for whether we should the match main axis parent dimension of the overall container. This change does just that, and renames the flag to `mainAxisOverflows`.
We will want to cherry-pick the fix for this into RN 0.71 since we have not yet introduced the community to the incorrect behavior, and we expect a lot of usage of flex-gap.
Changelog:
[General][Fixed] - Fix incorrect height when gap causes main axis to overflow and cross-axis is stretched
Reviewed By: yungsters
Differential Revision: D41311424
fbshipit-source-id: bd0c3b5aac478a56878703b6da84fc3993cc14da
Summary:
The goal of this diff is to introduce the scafolding of a BoxComponent. This class will be eventually shared by Android and iOS
changelog: [internal] internal
Reviewed By: sammy-SC
Differential Revision: D41205801
fbshipit-source-id: e33e58062aa33e0c8e9a48fd112309a358f0a060
Summary:
The goal of this diff is to refactor the name of Component to ComponentDeprecatedAPI
Also, I'm introducing a new very simple Component API, this new Component will evolve in the next few diffs and days
changelog: [internal] internal
Reviewed By: sammy-SC
Differential Revision: D41128461
fbshipit-source-id: b6aea08caa609153663cdd4165694cc57b4b76b6
Summary:
Rename this helper to make it explicit what it's used for. There's still more to do here to simplify these.
Changelog: [Internal]
Reviewed By: fkgozali
Differential Revision: D41184338
fbshipit-source-id: a33d306978cb9026ebf10b00853042da4aaecd5a
Summary:
a lot of files were depending on Geometry even though they didn't use Vector, this will help with future modularity
Changelog: [Internal]
Reviewed By: sammy-SC
Differential Revision: D41127194
fbshipit-source-id: 024519c638a1f0df3fdbfbdd937eac84b9adee6e
Summary:
at some point, the `Build.FINGERPRINT` of the emulator has changed and no longer includes `generic` as an option.
It apparently now, on all platforms, includes `google/sdk_gphone` at the beginning. Older emulators may still include `generic` in the `Build.FINGERPRINT` so we should maintain that check too.
## 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] [Fixed] - Fix android emulator detection for packager host
Pull Request resolved: https://github.com/facebook/react-native/pull/35111
Test Plan: When running on a modern emulator, ensure that the packager attempts to load from `10.0.2.2`.
Reviewed By: cipolleschi
Differential Revision: D41266071
Pulled By: GijsWeterings
fbshipit-source-id: 43115dbde6a411fe2ebde23e720dff4812a4309f
Summary:
This PR should solve the `"Circular Dependencies"` problem/issue because of which some PRs are getting blocked as discussed here https://github.com/facebook/react-native/pull/35288#issuecomment-1314081952
- also moved below helpers to `parsers-commons.js`;
- `getTypeAnnotationParameters`
- `getFunctionNameFromParameter`
- `getParameterName`
- `getParameterTypeAnnotation`
- `getTypeAnnotationReturnType`
<3
## Changelog
[INTERNAL] [CHANGED] - Moved `translateFunctionTypeAnnotation` fn from `parsers-primitives.js` to `parsers-commons.js` also, moved it's helpers
Pull Request resolved: https://github.com/facebook/react-native/pull/35343
Test Plan:
- ensure 👇 is `#00ff00`
`yarn lint && yarn flow && yarn test-ci`
Reviewed By: christophpurrer
Differential Revision: D41273191
Pulled By: rshest
fbshipit-source-id: cc1839a91579e7914f05516a90b280a776510c9d
Summary:
Changelog:
[Internal][Changeded] - https://github.com/facebook/react-native/pull/31841 introduced customisations for DevSupportManager which made this create() redundant, hence deprecating and adding the annotation.
Reviewed By: cipolleschi
Differential Revision: D41292920
fbshipit-source-id: 9fc348a3f4f8f64ba6f7aee85f302e87e10e8cd5
Summary:
`aria-labelledby` Flow types were added to the Text props on https://github.com/facebook/react-native/commit/f353119113d6fc85491765ba1e90ac83cb00fd61 but the text component does not support `accessibilityLabelledBy`, which is the prop we were supposed to map `aria-labelledby` to. As the Text component does not really support `aria-labelledby` this PR updates the `TextProps` documentation to explain that this prop is necessary for cross-platform purposes and that other platforms need it.
## Changelog
[Android] [Changed] - Add notes to `aria-labelledby` from Text props
Pull Request resolved: https://github.com/facebook/react-native/pull/35327
Test Plan: Ensure CI is green
Reviewed By: necolas
Differential Revision: D41280877
Pulled By: lunaleaps
fbshipit-source-id: 81cf016bcf3117f15385ddd119c44d6f9fdd6b68
Summary:
Deletes `setAndForwardRefs` because it encourages a subtle pitfall with managing the referential equality of `ref` entities.
By the time this commit is landed, there will have been no more call sites to it in the `facebook/react-native` repository.
Changelog:
[Internal]
Reviewed By: sammy-SC
Differential Revision: D41209331
fbshipit-source-id: 3ef9c3543b581a716a1e41e524957867ee811675
Summary:
Normally when a `ref` prop supplied to a component is changed, the old `ref` receives `null` and the new `ref` receives the active component instance.
However, the current implementation of `ScrollView` has a bug where this does not happen (i.e. changing `ref` or `innerViewRef` does not cause either the old or new refs to be updated). This bug is due to a subtle issue with how `ScrollView` internally memoizes the `ref` (or `innerViewRef`) that is passed into the native component.
This commit fixes this behavior so that `ScrollView`'s `ref` and `innerViewRef` have the correct behavior.
Changelog:
[General][Fixed] When a ScrollView's `ref` or `innnerViewRef` changes, the old ref will now be invoked with `null` and the new ref with the active instance. (Previously, changing `ref` or `innerViewRef` on a `ScrollView` would be treated as though the ref had not changed at all.)
Reviewed By: sammy-SC
Differential Revision: D41208895
fbshipit-source-id: b465f666076edbef410cdf9661e040e1d8fa0404
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/35285
While doing the release 0f 0.71.0-RC0, we noticed that having the RN version in the hermes tarball was causing more harm than good.
With the version in the name, we ended up with multiple tarballs for debug and release and we were not able to explicitly pick the right tarball given a build.
This change remove the version from the tarball name.
## Changelog
[General][Changed] - Remove React Native version from Hermes tarball name
Reviewed By: lunaleaps
Differential Revision: D41156353
fbshipit-source-id: 8899d5e1e1555bc728d923f3b78d1261e6ff09c7
Summary:
This is a backport of [this](https://github.com/facebook/react-native/commit/becb47ccb6a6ed77e81b5488561ef6d683933ffe) local fix we made on
0.71-stable.
All our podspecs delegates to the main React Native pods script to set up the dependencies properly. The React-Codegen.podspec, which is generated by
the script itself, was generated with hardcoded dependencies. This PR aligns the versioning with the other podspec.
On a side note, this could create issues in CI and when releaseing, because we are changing the versions to prepare the new release and it breaks some
steps.
## Changelog
[iOS] [Fixed] - Make sure that the React-Codegen.podspec does not enforce specific versions of its dependencies.
Pull Request resolved: https://github.com/facebook/react-native/pull/35274
Test Plan:
1. Ruby tests are passing
2. Manually tested that pods are correctly installed in the following configurations
- RNTester - Hermes - Old Architecture
- RNTester - Hermes - New Architecture
- RNTester - JSC - Old Architecture
- RNTester - JSC - New Architecture
Reviewed By: christophpurrer
Differential Revision: D41153859
Pulled By: cipolleschi
fbshipit-source-id: 043513866a66ecca3e326f8671bea3ec576422de
Summary:
Refering to "Support function signature along with function type properties in commands" in https://github.com/facebook/react-native/issues/34872
Many TypeScript programmers prefer `{ name(arg:string):void; }` to `{ readonly name:(arg:string)=>void; }`.
In this pull request, I updated test cases in both commands and modules to cover it, with missing implementation.
Command arguments are `NamedShape<T>` but the `optional` field is missing, it is also fixed.
## Changelog
[General] [Changed] - Add `TSMethodSignature` to react-native-codegen
Pull Request resolved: https://github.com/facebook/react-native/pull/35311
Test Plan: `yarn jest react-native-codegen` passed
Reviewed By: rshest
Differential Revision: D41217482
Pulled By: cipolleschi
fbshipit-source-id: 480af118d09b022bae919c5391547fd82c1a7cc9
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/35315
These headers are needed on react-native-macOS, but not explicitly imported all the time.
It seems that some UIKit header will implicitly import them.
We have other use case in react-native(-iOS) in which we also explicitly importing them - https://github.com/facebook/react-native/search?q=QuartzCore- , hence use following 'that' practice 'here'.
Changelog: [Internal]
Reviewed By: javache
Differential Revision: D41229835
fbshipit-source-id: b0182bf4f7905e8e157b341eb62cadec6ba354ca
Summary:
Inlines `setAndForwardRef` into `createAnimatedComponent.js`.
I am planning to delete `setAndForwardRef` because it encourages a subtle bad practice with management of the referential equality of `ref` entities. I am doing this instead of refactoring `createAnimatedComponent` because this legacy implementation is planned to be replaced very soon.
Changelog:
[Internal]
Reviewed By: sammy-SC
Differential Revision: D41205066
fbshipit-source-id: dc481e73a6c4d6acbae530d4da48b3a032575179
Summary:
Switches `TextInput` from `setAndForwardRefs` to `useMergeRefs` (and `useCallback`).
Instead of creating a new `_setNativeRef` function on every render, this will now only create a new ref function when either `mostRecentEventCount` changes, `viewCommands` (i.e. `props.multiline` on iOS) changes, or when `props.forwardedRef` changes.
When a text input is being edited, `mostRecentEventCount` will probably change. But when an unfocused `TextInput` is being updated because a parent is being updated, we will now no longer unnecessarily create a new `ref`. The observable behavior of this is that any `ref` supplied onto `TextInput` will now be invoked less frequently.
Changelog:
[General][Changed] Any `ref` set on `TextInput` will now be updated less frequently (when the underlying `ref` has not changed).
Reviewed By: sammy-SC
Differential Revision: D41191439
fbshipit-source-id: c69a061317c51ad6c6ca8acd116539e0f24a1d08
Summary:
While refactoring `TextInput`, I noticed that we are allocating each of the exported imperative instance methods on every invocation of the component. This is wasteful because if the `ref` does not change, this just creates more garbage.
Instead, we only need to allocate them when we are actually going to assign them onto a `ref`.
Changelog:
[Internal]
Reviewed By: sammy-SC
Differential Revision: D41191440
fbshipit-source-id: 0120d67a9e29a3e0c3f42c3fa436381d6bec7619
Summary:
Straightforward refactor of how `TextInput` augments the exported `ref` with instance methods.
This change is in preparation for additional refactors to eliminate `setAndForwadRefs`.
Changelog:
[Internal]
Reviewed By: christophpurrer
Differential Revision: D41191441
fbshipit-source-id: 30560ce489c48409003a9f92875e5096d3f1130e
Summary:
Hi, while adjusting [react-native-screens](https://github.com/software-mansion/react-native-screens) to `0.71.0-rc.0` I encountered the same problems as reported [here](https://github.com/reactwg/react-native-releases/discussions/41#discussioncomment-4085694) by WoLewicki.
Basically inside `CMake`'s `foreach` loop iterator variable is not being expanded to the actual value:
```cmake
foreach(autolinked_library ${AUTOLINKED_LIBRARIES})
target_link_libraries(autolinked_library common_flags) // <-- here we are literally linking to "autolinked_library".
endforeach()
```
## Changelog
[Android] [Fixed] - Fix Android autolinking failing because of not expanded variable
Pull Request resolved: https://github.com/facebook/react-native/pull/35306
Reviewed By: christophpurrer, cipolleschi
Differential Revision: D41220408
Pulled By: rshest
fbshipit-source-id: 12ce993f0c5227ca7d3c2cc272fe3739126930b3
Summary:
Cleans up `ScrollView-test.js` to be easier to read and to include a unit test for `ref`.
This prepares the Jest test suite to be extended with an additional test to validate a bug with `ref` invalidation.
Changelog:
[Internal]
Reviewed By: sammy-SC
Differential Revision: D41208894
fbshipit-source-id: 6d79adf131602292f7aa3180b1c230643e9baf16
Summary:
Add explicit annotations to React hook callbacks as required for Flow's Local Type Inference project. This codemod prepares the codebase to match Flow's new typechecking algorithm. The new algorithm will make Flow more reliable and predictable.
This diff adds `any` or `$FlowFixMe` in cases where more precise types could not be determined.
Details:
- Codemod script: `.facebook/flowd codemod annotate-react-hooks ../../xplat/js --default-any --write`
- Local Type Inference announcement: [post](https://fb.workplace.com/groups/flowlang/posts/788206301785035)
- Support group: [Flow Support](https://fb.workplace.com/groups/flow)
drop-conflicts
bypass-lint
Reviewed By: SamChou19815
Differential Revision: D41231214
fbshipit-source-id: d5f5ce8d61020baa1138292c9e9f1c69dffd324c
Summary:
Add explicit annotations to underconstrained implicit instantiations as required for Flow's Local Type Inference project. This codemod prepares the codebase to match Flow's new typechecking algorithm. The new algorithm will make Flow more reliable and predictable.
This diff adds `any` or `$FlowFixMe` in cases where more precise types could not be determined.
Details:
- Codemod script: `.facebook/flowd codemod annotate-implicit-instantiations ../../xplat/js --default-any --write`
- Local Type Inference announcement: [post](https://fb.workplace.com/groups/flowlang/posts/788206301785035)
- Support group: [Flow Support](https://fb.workplace.com/groups/flow)
drop-conflicts
bypass-lint
Reviewed By: SamChou19815
Differential Revision: D41226960
fbshipit-source-id: e5e3edbb1aed849f90cc683a4d416a9a2f8f3a19
Summary:
Changelog: [Internal]
The feature flag is a function not a boolean, flow didn't caught it..
Reviewed By: rbalicki2
Differential Revision: D41172775
fbshipit-source-id: b8a3365ab65049706b59e7e859f5f931ecab8360
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/35256
Changelog:
[General][Added] - Making Dev Loading View cross platform by abstracting out the activity/context logic from the controller in a polymorph class.
Reviewed By: rshest
Differential Revision: D40908923
fbshipit-source-id: db8e94f8ded5ffe0deeb88335cd7f3d1bf87243a
Summary:
When a __rounded__ View on Android has a border, a small gap appears between the border and the center of the view (most noticeably when the background and border colors are the same)
Since the border is drawn on top of the other layers, the approach here is to make the center of the View slightly larger so that there is an overlap with the border, and closing the visible gap
There are 2 cases for a View with a border:
1. `borderWidth` is set for a consistent border width around all 4 edges
2. Uneven border widths are set (using `borderTopWidth`, `borderLeftWidth, ...)
**How is a rounded rectangle drawn?**
__Case 1__: `borderWidth` is set for a consistent border width around all 4 edges
- Before:
- first, `mInnerClipPathForBorderRadius` was used to draw the center of the View
- then the border is drawn along the path of `mCenterDraw` with a stroke width of the border width
- Now:
- `mBackgroundColorRenderPath` is used to draw the center of the View and is exactly a slightly enlarged version of `mInnerClipPathForBorderRadius`
__Case 2__: Uneven border widths are set (using borderTopWidth, borderLeftWidth, ...)
- Before:
- `mInnerClipPathForBorderRadius` was used to draw the center of the View
- for each edge, a quadrilateral is drawn
- `mOuterClipPathForBorderRadius` clips the outer edge of the border
- `mInnerClipPathForBorderRadius` (same is used to draw the center of the View) clips the inner edge of the border
- Now:
- `mBackgroundColorRenderPath` is used to draw the center of the View, allowing `mInnerClipPathForBorderRadius` to persist as the path that clips the inner edge of the border
When `mGapBetweenPaths` = 0, `mBackgroundColorRenderPath` == `mInnerClipPathForBorderRadius`, which is exactly the original implementation
Changelog:
[Internal][Fixed] - rounded Views with borders shows small gap
Reviewed By: mdvacca
Differential Revision: D39979567
fbshipit-source-id: 6db71d14ead6256e1b7becf73862e0a537c6a47b
Summary:
In D38850138 (https://github.com/facebook/react-native/commit/63a4539e4d36ac90137eea6cdde0154ca06878c0) I added a new example of the runtime permission `POST_NOTIFICATIONS` to RNTester, but forgot to add this permission to AndroidManifest.xml.
Changelog:
[Android][Added] - Add POST_NOTIFICATIONS permission to AndroidManifest of RNTester
Reviewed By: fkgozali
Differential Revision: D41204931
fbshipit-source-id: 80e5d526406715fd7570cc94cbf384858ff05aed
Summary:
Refer to "Support intersection of object types, `{...a, ...b, ...}` in Flow is equivalent to `a & b & {...}` in TypeScript, the order and the form is not important." in https://github.com/facebook/react-native/issues/34872
In this change I also extract the common part from `getTypeAnnotation` and `getTypeAnnotationForArray` into `getCommonTypeAnnotation`. Most of the differences are about `default` in the schema. After a schema is generated from `getCommonTypeAnnotation` successfully, `getTypeAnnotation` will fill `default` if necessary, while `getTypeAnnotationForArray` does nothing.
## Changelog
[General] [Changed] - Add intersection types in react-native-codegen for TypeScript
Pull Request resolved: https://github.com/facebook/react-native/pull/35247
Test Plan: `yarn jest react-native-codegen` passed
Reviewed By: cipolleschi
Differential Revision: D41105744
Pulled By: lunaleaps
fbshipit-source-id: cd250a9594a54596a20ae26e57a1c801e2047703