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 (63a4539e4d) 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
Summary:
Android 13 adds a new `POST_NOTIFICATION` runtime permission, which can only be requested if the `targetSdkVersion` of the app is set to 33. Since we upgrading Catalyst to SDK 33, let's add it as one of the permission examples.
Changelog:
[Android][Changed] - Add POST_NOTIFICATION runtime permission to RNTester
Reviewed By: fkgozali
Differential Revision: D38850138
fbshipit-source-id: 4cf7a5f60dd0891d7ada40aca37f0489d9d0d190
Summary:
changelog: [internal]
Call `AnimatedProps.setNativeView` any time `AnimatedProps` node changes to make sure it is always connected to underlaying host component.
Reviewed By: yungsters
Differential Revision: D41122065
fbshipit-source-id: 1d10fdd44933ff82d9bfc424cecb2640b7a66837
Summary:
Part of https://github.com/facebook/react-native/issues/34872:
> Update the [IncorrectlyParameterizedGenericParserError](https://github.com/facebook/react-native/blob/main/packages/react-native-codegen/src/parsers/errors.js#L134) error in the error.js file to accept a Parser instead of a ParserType parameter. Use the nameForGenericTypeAnnotation method of the parser to extract the genericName and delete the ternary operator.
Since the task was added to the issue we split the IncorrectlyParameterizedGenericParserError into 2 errors: MissingTypeParameterGenericParserError and MissingTypeParameterGenericParserError (https://github.com/facebook/react-native/pull/35134/), so I applied the change on both errors.
## 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] - Use parser instead of language in MissingTypeParameterGenericParserError and MoreThanOneTypeParameterGenericParserError
Pull Request resolved: https://github.com/facebook/react-native/pull/35294
Test Plan: I tested using Flow and Jest commands. More specifically, the tests that cover this change are the ones I renamed.
Reviewed By: christophpurrer
Differential Revision: D41181069
Pulled By: cipolleschi
fbshipit-source-id: 3412e29b1319a28b3ec6afb38b1eda448055fa6a
Summary:
This is just a PR to realign main branch (and put it ahead) of a local change we did in 0.71: 741d102476
## 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
-->
[General] [Changed] - Bump CLI to v10 alpha5
Pull Request resolved: https://github.com/facebook/react-native/pull/35260
Test Plan: N/A
Reviewed By: christophpurrer
Differential Revision: D41122011
Pulled By: cipolleschi
fbshipit-source-id: 8f01ed94bfd39d58b2e54cd2945fcca5bb8ebd18
Summary:
This PR ports back into main the changes required to properly close the SonaType repository on Maven
## Changelog
[General] [Fixed] - Close the Maven repository properly
Pull Request resolved: https://github.com/facebook/react-native/pull/35272
Test Plan: We tested these changed in 0.71-stable branch when releasing 0.71.0-RC.0
Reviewed By: christophpurrer
Differential Revision: D41154965
Pulled By: cipolleschi
fbshipit-source-id: 74dd46e8fabf3baef544342282829c70d92f671f
Summary:
During the outage it become clear that we are not doing enough to communicate what the release support policy/window is. This is one of the tweaks I'm doing to help with that
## 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] - small tweaks to issue templates + clear mention of support window
Pull Request resolved: https://github.com/facebook/react-native/pull/35304
Test Plan: N/A
Reviewed By: christophpurrer
Differential Revision: D41183435
Pulled By: cipolleschi
fbshipit-source-id: 32519c52616fb1903507fad291200eb959d451b4
Summary:
probably the smallest PR I ever submitted, but it was bothering me lol
There was a missing space in the method doc.
## Changelog
Add space to the method doc
<!-- Help reviewers and the release process by writing your own changelog entry. For an example, see:
https://reactnative.dev/contributing/changelogs-in-pull-requests
-->
[iOS] [Fixed] - Add missing space in method documentation comment
Pull Request resolved: https://github.com/facebook/react-native/pull/35303
Reviewed By: jacdebug
Differential Revision: D41182765
Pulled By: cipolleschi
fbshipit-source-id: ebe5d56072137547e543a312c66cc3234142db13
Summary:
This was left over from an old codemod.
Changelog: [Internal]
Reviewed By: christophpurrer
Differential Revision: D41154548
fbshipit-source-id: 0b5fb3e78491b66ebaf13555f80e0265a25dc7d8
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/35138
Changelog:
[General][Added] - Add a C++ only TurboModule example (for Android/iOS/macOS/Windows)
react-native@0.69 introduced a new bridging layer to ease integration for pure C++ TurboModules using C++ std:: types directly instead of the lower level jsi:: types:
https://github.com/facebook/react-native/tree/v0.69.0/ReactCommon/react/bridging
This bridging layer can be used in JSI functions or more conveniently in C++ TurboModules.
Here is a example of an C++ only TurboModule which will work on Android and iOS and macOS/Windows (using microsoft/react-native-macos|windows) only using flow/TypeScript and standard C++ types.
C++ only TurboModules are very handy as they do not require to work with JSI APIs - instead std:: or custom C++ can by used.
Reviewed By: javache
Differential Revision: D39011736
fbshipit-source-id: 84c833d8540671fde8505f1aeb0265074b248730
Summary:
Changelog:
[Category][Internal] - Fix inspecting on non-fabric
the pointer events don't work on non-fabric components. In addition to check the pointer events feature flag, we need to check if fabric is on as well.
Reviewed By: rbalicki2
Differential Revision: D41053393
fbshipit-source-id: ab47bd845b578a0859f282ea8ff04ddbff17da02
Summary:
>Expandable and Collapsible are unique in the Android Accessibility API, in that they are not represented as properties on the View or AccessibilityNodeInfo, but are only represented as AccessibilityActions on the AccessibilityNodeInfo. This means that Talkback determines whether or not a node is "expandable" or "collapsible", or potentially even both, by looking at the list of AccessibilityActions attached to the AccessibilityNodeInfo.
>When setting the accessibilityState's expandable property, it should correlate to adding an action of either AccessibilityNodeInfoCompat.ACTION_EXPAND or AccessibilityNodeInfoCompat.ACTION_COLLAPSE on the AccessibilityNodeInfo. This work should be done in the ReactAccessibilityDelegate class's
>Currently, this feature is being "faked" by appending to the contentDescription in the BaseViewManager class. This should be removed when this feature is implemented properly.
fixes https://github.com/facebook/react-native/issues/30841
## Changelog
[Android] [Fixed] - using AccessibilityNodeInfo#addAction to announce Expandable/Collapsible State
Pull Request resolved: https://github.com/facebook/react-native/pull/34353
Test Plan:
- On some components, the state expanded/collapsed is properly announced on focus, on some it is not.
- On some components only the expanded/collapsed state is announced, and not other component text.
- Upon change, state change is not always announced.
- The accessibilityState's "expanded" field does not seem to work on all element types (for example, it has no effect on 's).
- using accessibilityActions it is possible to add an action for expand/collapse, but these are treated as custom actions and must have their own label defined, rather than using Androids built in expand/collapse actions, which Talkback has predefined labels for.
https://snack.expo.io/0YOQfXFBi
Tests 15th August 2022:
- Paper [Tests](https://github.com/facebook/react-native/pull/34353#issuecomment-1217425302)
- Fabric [Tests](https://github.com/facebook/react-native/pull/34353#issuecomment-1217781734)
Tests 6th September 2022:
- [Button which keeps control of extended/collapsed state in JavaScript with onAccessibilityAction, accessibilityActions and accessibiltyState (Paper)](https://github.com/facebook/react-native/pull/34353#issuecomment-1237601847)
- [TouchableWithoutFeedback keeps control of extended/collapsed state in Android Widget (Paper)](https://github.com/facebook/react-native/pull/34353#issuecomment-1237616304)
- [TouchableWithoutFeedback keeps control of extended/collapsed state in Android Widget (Fabric)](https://github.com/facebook/react-native/pull/34353#issuecomment-1237624755)
- [TouchableOpacity announces visible text and triggers expanded/collapsed with onPress and accessiblity menu (Fabric)](https://github.com/facebook/react-native/pull/34353#issuecomment-1237627857)
Announcing state with custom actions on Fabric (FAIL).
The issue is not a regression from this PR, as documented in https://github.com/facebook/react-native/pull/34353#issuecomment-1207744977. It will be fixed in a separate PR.
Reviewed By: NickGerleman
Differential Revision: D39893863
Pulled By: blavalla
fbshipit-source-id: f6af78b1839ba7d97eca052bd258faae00cbd27b
Summary:
* When I build the latest bishop (using buck), I get a failure and a suggestion:
```
Rule //fbobjc/Apps/Bishop:BishopPackage (//fbobjc/Apps/Bishop:BishopPlatform) FAILED because Command failed with exit code 1.
command: [/bin/bash, -e, /data/sandcastle/boxes/fbsource/buck-out/tmp/genrule-15268472800256890202.sh]
stderr: The target: fbsource//fbobjc/Apps/Bishop:BishopShareExtension is an App Extension, and must only use APIs available in App Extensions. However, it contains dependencies that do not set 'extension_api_only = True' in their BUCK files:
- //xplat/js/react-native-github:RCTSettingsApple
This command may be able automatically to fix this issue:
arc buildozer 'set extension_api_only True' //xplat/js/react-native-github:RCTSettingsApple
```
* This diff is the result of running that command
Reviewed By: christophpurrer
Differential Revision: D41121880
fbshipit-source-id: b1ecd077270d7f3909739364237af32dbc617f52
Summary:
This PR backport two fixes we did in 0.71 to unblock the release process:
* the change in `publish-npm` is needed because of the introduction of .strict() from 4f3ca8facf
* the removal of the other script (added originally here e4b5d3eec9) is because:
1) that step is not needed anymore (we don't publish/upload hermes artifacts to the GH release)
2) by the time this job gets run the release crew has already setup the GH release
3) the logic for the versioning was broken and even on the 0.71-rc pipeline it was tagging stuff as 1000.0.0
## 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 release scripts for "release" pipeline scenario
Pull Request resolved: https://github.com/facebook/react-native/pull/35258
Test Plan: The fact that 0.71-rc0 was released is the ✅ for this.
Reviewed By: jacdebug
Differential Revision: D41120888
Pulled By: cipolleschi
fbshipit-source-id: 06d108f0659ad1db53c6324fe1d735f52c34a3c5
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/35226
Changelog: [Internal]
This adds scaffolding for the C++ side of NativePerformanceObserver module.
Thanks to christophpurrer for helping set this up, as this is the first one of this kind inside core/OSS.
Reviewed By: rubennorte
Differential Revision: D41028555
fbshipit-source-id: 4acf0e71a254a42044cbbe5f94f40938342c6aa2
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/35106
This Diff remove the assert on the initializer in the EventEmitter in place of a more idiomatic check when the method is invoked.
It aims to solve an internal error and promotes best practices for the iOS platform.
## Changelog:
[iOS][Changed] Refactor RCTEventEmitter initialization
Reviewed By: sammy-SC
Differential Revision: D40762253
fbshipit-source-id: 83d26616ce147914948e536e9e4b1010758fb690
Summary:
This PR updates he cache strategy for the `checkout_with_cache command`.
The previous strategy was using three keys in descending priority order to restore from the cache:
* `<< parameters.checkout_base_cache_key >>-{{ arch }}-{{ .Branch }}-{{ .Revision }}`
* `<< parameters.checkout_base_cache_key >>-{{ arch }}-{{ .Branch }}`
*`<< parameters.checkout_base_cache_key >>-{{ arch }}`
When it saves, it always saves using the first key.
The restore works as it follows:
1. It tries to restore the cache using the first key
2. If it fails, it checks whether there is a cache hit for a key that matches the second key as a pattern
3. If it fails, it checks whether there is a cache hit for a key that matches the third pattern
4. Otherwise, it is a cache miss.
This does not work well. Imagine that you submit some code in commit `xxxx` for branch `abc`.
The CI run the first time, it misses all the three keys and checks out the code normally.
Then, it stores the checked out code in the `checkout_key-abc-xxxx` key.
Then, you submit a commit `yyyy` in the same branch.
The CI starts, it tries with the key `checkout_key-abc-yyyy` but it misses
It tries with the key `checkout_key-abc` and it finds the cache for `checkout_key-abc-xxxx` and it restores it, forgetting about your changes.
While doing the release, we created a tag in a commit X. Then we manually had to remove it, but the CI had a cached version of .git with the tag for
the `0.71-stable` branch. And the release failed because the tag was already existing.
### Why this should work
With this solution, we are going to cache using the commit. If there is no cache for a specific commit, it will be a miss. It won't try to be smart and
retrieve the code from previous caches.
This should prevent stale caches and if we manually remove a tag, and then we do a new commit, it should work.
This is a good trade-off that allows to pay the checkout cost only for the first batch of jobs of the pipeline.
**NOTE:** This still won't work if we don't do a new commit.
## Changelog
[General] [Fixed] - Change Cache strategy to avoid cache bumps in Release
Pull Request resolved: https://github.com/facebook/react-native/pull/35259
Test Plan: 1. CircleCI must be green
Reviewed By: jacdebug
Differential Revision: D41120895
Pulled By: cipolleschi
fbshipit-source-id: 2b45da01803197dbe4a25a313a9dfc53a976d096