Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/37342
Upgrades to `flow-enums-runtime@0.0.6`, which is just a `README.md` update.
Changelog:
[Internal]
Differential Revision: D45713984
fbshipit-source-id: a458ccb099df53401fa41826f3571bca7e292dbf
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/37326
Changelog: [Internal]
in this change, i introduced a block type that returns a `JSEngineInstance`. a block gives a bit more flexibility in terms of lazily loading the engine + its dependencies, but i might get rid of it later and just pass down the engine itself.
Reviewed By: javache
Differential Revision: D45678969
fbshipit-source-id: 52d3ec0de77a3ab74d3cf304ea22fb5fc1315a2e
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/37317
changelog: [internal]
This diff does three things:
1. Combines Android's mobile config `react_fabric:enable_text_measure_cache` with iOS mobile config `react_fabric:enable_nstextstorage_caching`. We will get into why later.
2. Fixes cache `ParagraphLayoutManager::cachedTextMeasurement_` invalidation logic for iOS and Android.
3. Fixes cache invalidation logic for `ParagraphLayoutManager::hostTextStorage_`.
Initially, Android's text measure cache (D44221170) and iOS's NSTextStorage (D43692171) were design as two separate optimisations. But they overlap and NSTextStorage actually needs some parts of text measure cache to work correctly. That's why I decided to merge them together.
Previously, `ParagraphLayoutManager::cachedTextMeasurement_` was only invalidated if maximum width for the node changed. But node can change in different ways, for example input string changes or attributes change. This diff accounts for that by computing a hash for AttributedString+ParagraphAttributes to check if anything has changed.
Previously, `ParagraphLayoutManager::hostTextStorage_` was not correctly invalidated if maximum width changed. To my surprise, this happens less frequently than one expects.
bypass-github-export-checks
Reviewed By: mdvacca
Differential Revision: D45637797
fbshipit-source-id: 1840b51cdb1423de0560a35fd17c24a71ad115e1
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/37303
Intent of a change to the last diff was to make `PropsParserContext` act gracefully if it tried to parse "auto" without a `ReactNativeConfig` being set (e.g. if our tests wanted to do that).
We would actually assert if we tried to do that with what I added, since `ContextContainer::at()` acts like `at()` does in the STL containers and will expect the parameter to be in bounds/present. (`RawProps::at()` is the odd one out that will return `nullptr` instead).
This changes the usage to ContextContainer::find() which will return ` std::optional<std::shared_ptr>>`.
Changelog: [Internal]
Reviewed By: rshest
Differential Revision: D45651032
fbshipit-source-id: b1f16f9329ceb4ef7a6c469f968eae57a2fe3da5
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/37337
Changelog: [Internal]
Removes usage of a local `Performance` instance, since this the global one is now safe to use.
Reviewed By: christophpurrer
Differential Revision: D45697243
fbshipit-source-id: 4f3f9798e79c15295094d5a4650af04db2856f60
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/37323
ReactInstance is an internal concept and name, we should not leak ReactInstance name for client code.
bypass-github-export-checks
changelog: [internal] internal
Reviewed By: RSNara
Differential Revision: D45578268
fbshipit-source-id: c0306b89d854d7beb5fcd38ba3623099846ec932
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/37333
## Changelog:
[Internal] -
Add a safeguard against accidentally removing a virtual destructor from `ShadowNode`.
Since this is something that happened before, and `ShadowNode` has a non-trivial class inheritance tree, this could be a good idea to prevent potential memory leaks.
Differential Revision: D45691614
fbshipit-source-id: 3aa7a3eecba98478d7fb9aaef62adb547b653b82
Summary:
This PR does two things:
1. Improves the labeling workflow in cases where the user is on a supported version but a higher patch number is available. Now, the label name will be friendlier ('Newer Patch Available') and we will report the version they should consider upgrading to in the message body. Once this change is merged, I can also rename all existing versions of this label for consistency.
2. Moves the addDescriptiveLabels.js script to the workflow-scripts folder for consistency with the other workflow scripts.
## Changelog:
[INTERNAL] [CHANGED] - Enhancing issue triage workflow for patch versioning
Pull Request resolved: https://github.com/facebook/react-native/pull/37324
Test Plan: See some examples of the workflow run in my fork: https://github.com/SlyCaptainFlint/react-native/issues
Reviewed By: cipolleschi
Differential Revision: D45680812
Pulled By: NickGerleman
fbshipit-source-id: 7ab07fcf52fe372d2e449bb43d6618b1c98e9245
Summary:
Nightly builds of Android no longer build due to a recent version format change.
## Changelog:
[ANDROID] [FIXED] - Fixed nightly builds of Android no longer building due to a recent version format change
Pull Request resolved: https://github.com/facebook/react-native/pull/37332
Test Plan:
```
git clone https://github.com/microsoft/react-native-test-app.git
cd react-native-test-app
npm run set-react-version nightly
cd example
yarn android
```
Reviewed By: jacdebug
Differential Revision: D45690926
Pulled By: cortinico
fbshipit-source-id: dc935733607c2b33ba296b507a98f43ba483e348
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/37275
When enabling `USE_FRAMEWORKS=dynamic`, we need to explicitly defines all the dependencies used by the pods.
This change add those missing dependencies.
## Changelog:
[iOS][Added] - Add explicit dependencies for 3rd parties libraries
Reviewed By: NickGerleman
Differential Revision: D45523646
fbshipit-source-id: 228a7e0ae98ea262af4d58b7dc855f944ebed463
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/37276
When enabling dynamic linking, we had a circulr dependency between Fabric and the Image Manager.
Specifically, Image Manager depends on Fabric, but the Image component, in Fabric, is using some implementation specific files from the Image Manager that surface only when enabling the dynamic linking.
Xcode fails to find those symbols unless the dependencies are explicitly added to the podspec.
This change is technically breaking, but we tried to minimize the breakage by adding the new pod in all the required search paths.
## Changelog
[iOS][Breaking] - Add React-FabricImage pod.
Reviewed By: NickGerleman
Differential Revision: D45517278
fbshipit-source-id: 994aa8c40301c68bf9fecdf46de7833028f0d3c2
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/37312
## Why?
Internally one of our apps is using a custom view manager that isn't respecting the `NotNull` constraint,
causing a runtime error. We have no visibility over what this manager is. The custom exception will give
us more clues to track this down.
If you look at the below stack trace, it's pretty clear the earlier approach would fail:
{F979121677}
Like a bit of a noddy, I've been waiting for days for the new exception to be hit, when it's very clear from [3 May](https://fburl.com/scuba/errorreporting_facebook_android_crashes/a63t7ilm) that this wasn't going to happen:
{F979130611}
The lesson here is to monitor 3 things:
1. the [original NullPointerExceptions](https://fburl.com/scuba/errorreporting_facebook_android_crashes/m2o0t45h),
2. the new [ReactViewReturnTypeException](https://fburl.com/scuba/errorreporting_facebook_android_crashes/2j0vtuwb), and
3. the [number of users exposed](https://fburl.com/scuba/mobile_active_users/9mbevwed) to whatever release this change goes out on.
Changelog: [Internal]
The NullPointerExceptions are hit when call the the java createView method. Previous (D45185598)
didn't capture this exception and wasn't very useful.
Reviewed By: cortinico
Differential Revision: D45660487
fbshipit-source-id: f1a7a114778a0c2eae963d64558541266ed57bda
Summary:
FlatList `viewabilityConfig` prop seems no need to be any type. So I replaced it with `ViewabilityConfig` from `VirtualizedList.d.ts`
## Changelog:
[GENERAL] [FIXED] - change FlatList `viewabilityConfig` prop type `any` to `ViewabilityConfig`
Pull Request resolved: https://github.com/facebook/react-native/pull/37299
Test Plan: Ran yarn test-typescript and yarn test-typescript-offline with no errors.
Reviewed By: jacdebug
Differential Revision: D45689033
Pulled By: cipolleschi
fbshipit-source-id: e7fd31c534c5f47321b36d0d764f466392ad897e
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/37316
In Fabric, a ShadowNode may re-initialize YGConfig several times throughout the lifetime of a perpetually cloned Yoga Node.
RN sets `pointScaleFactor` lazily, when laying out the rootview. So right now it initializes a config to `pointScaleFactor` of 1.0, sets it, sets a new `pointScaleFactor` on the config, then repeats. This cycles the config between two `pointScaleFactor` values and will excessively dirty the node now that `YGNodeSetConfig` dirties on config change (D45505089)
This change makes it so that we retain previously used `pointScaleFactor` when cloning the Yoga nodes.
Changelog: [Internal]
Reviewed By: rozele
Differential Revision: D45669878
fbshipit-source-id: bfd2e185d9264a1cda64e59132960060385e16f1
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/37320
Changelog: [Internal]
this is just my personal taste, but here's what i did, would love to hear others' opinions (and maybe get these eventually codified):
- private methods preprended with underscore
- pragma mark groupings in this order: public, overrides, protocols, then private
Reviewed By: cipolleschi, dmytrorykun
Differential Revision: D45582491
fbshipit-source-id: 76c80955422ea7f29e7307ce2c08f70e7e8a5188
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/37314
Turns out we never transitioned fbsource to an API change we made for FlatList, due to mismatched `.js` and `.js.flow` files.
Inside of RN, `$ArrayLike` in Flow, unlike `ArrayLike` in TypeScript, treats `length` as writable. So we wrap that in `$ReadOnly`. Another option might be to inline our own version, since it is not the only [case where they differ](https://fb.workplace.com/groups/flow/permalink/24328911383397481/).
In product code, the changes end up impacting:
1. `getItemLayout` is no longer typed to receive a mutable array. I changed all of the incompatible explicit type parameters from `Array<ItemT>` to `Iterable<ItemT>`.
2. Flow has a harder time inferring destructured `data` in examples that were passing `any` to FlatList, so I needed to give some type hints where `data` was previously untyped
3. Replace some `$FlowFixMe[incompatible-type]` with `$FlowFixMe[incompatible-type-arg]`
Changelog: [Internal]
Reviewed By: lunaleaps
Differential Revision: D45665199
fbshipit-source-id: 59aa908e277a27f7ca88acb48de493d2782517a9
Summary:
It's just a code improvement, with postponement of best practices.
## Changelog:
[Android] [Added] - Code improvement.
Pull Request resolved: https://github.com/facebook/react-native/pull/37297
Test Plan: The new code does not change existing logic.
Reviewed By: NickGerleman
Differential Revision: D45658400
Pulled By: yungsters
fbshipit-source-id: dcbe4b732d665a0c3c26ee2cf28843f951c3979d
Summary:
- The whole project root is included by default anyway, the include
section should be redundant and just misleading.
- The generated ignore paths ignore more than intended as they didn't
escape the `.` for regex.
Changelog: [Internal]
Reviewed By: mofeiZ
Differential Revision: D45658874
Pulled By: kassens
fbshipit-source-id: fd1ec59eeffa3ac1cb39c190e17f018951fafbe7
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/37307
This should no longer log to `console.error()` after the latest prop-types update.
Changelog: [Internal]
Reviewed By: yungsters
Differential Revision: D45654389
fbshipit-source-id: c3d04c6a74b335e300137aa67bd7fb3640ba0303