Summary:
Fantom was disabling Metro hierarchical lookup in all cases when `JS_DIR` is set. The intention is that `node_modules` folders other than the configured `JS_DIR/public/node_modules` are not used.
However, this leads to incorrect resolution where a transitive dependency is not hoisted. If the origin of the resolution is already inside `node_modules`, we must perform a hierarchical lookup to avoid picking up just whichever version happens to be hoisted to `node_modules` root.
Changelog: [Internal]
Reviewed By: huntie
Differential Revision: D69303559
fbshipit-source-id: 12068fb0bebb8c2f81b64c23b952a623cb6fd792
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/49252
Changelog: [internal]
This adds a Fantom test placeholder for LogBox, which shows what type of tests we could be writing for this.
It also adds a few ids in LogBox components so we can inspect them in tests and make assertions on them.
Reviewed By: javache
Differential Revision: D69301572
fbshipit-source-id: 89a332a47c300c1dc18937cd91206ce6d820b6aa
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/49251
Changelog: [internal]
Components like `AppContainer` require passing the rootTag as a prop, but we don't have access to it from Fantom unless we render something in the root and access it via the RootTagContext. This exposes the rootTag of the Root as a method so we can use it in initial render too.
Reviewed By: javache
Differential Revision: D69301571
fbshipit-source-id: 429fb56d937d3dffeb3c17a70d136ba4925ece8e
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/49254
Changelog: [internal]
This is just a convenience method to do:
```
Fantom.dispatchNativeEvent(node, 'click');
```
Instead of:
```
runOnUIThread(() => {
enqueueNativeEvent(node, 'click');
});
runWorkLoop();
```
Which is too verbose and people rarely need this level of granularity in tests.
Note that, in Fabric, we have methods called `dispatchEvent` that don't match 1:1 with this API. In that case, `dispatchEvent` is more aligned with Fantom's `enqueueNativeEvent`.
Reviewed By: javache
Differential Revision: D69302382
fbshipit-source-id: 6f71a5ace11c81f551df2c2837881dbc6f48e7ba
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/49253
Changelog: [internal]
Renaming this low level method as `enqueue` is more accurate in this case than `dispatch`, which is misleading because it actually doesn't dispatch it to JS.
We should also rename this in Fabric, but that's a larger and breaking change, so just making the change in Fantom for now. This is a trade-off between convenience/ergonomics of the testing API vs. alignment with the internal nomenclature. In this case we favor the first.
Reviewed By: javache
Differential Revision: D69302383
fbshipit-source-id: 7e163920ace709503367bf68baab5e9f2bf8ae3f
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/49231
Those public modifier have no meaning as the class is internal. I'm removing them.
Changelog:
[Internal] [Changed] -
Reviewed By: javache
Differential Revision: D69252048
fbshipit-source-id: b51e5ac20338a01291d6cd04ee4c990cc8a6a755
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/49229
This interface was converted to Kotlin, but the single method should have been converted to a `val`.
People kotlin consumers could call ReactOverflowView.overflow; now they need to call getOverflow().
Changelog:
[Internal] [Changed] - Undo a breaking change on ReactOverflowView
Reviewed By: NickGerleman
Differential Revision: D69250226
fbshipit-source-id: 5c7cca8c83f5c76a9cc1d254f8aa51409150c356
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/49233
I'm converting the function inside ReactPointerEventsView from `fun` to `val`.
This Kotlin conversion resulted in a breakign change for Kotlin consumer which I believe can be prevented
if we do this change instead.
Changelog:
[Internal] [Changed] -
Reviewed By: alanleedev
Differential Revision: D69252562
fbshipit-source-id: b277c6720f3156ed532bf5f2253d54cd72e38050
Summary:
I wanted to test exclusion of .d.ts files in https://github.com/facebook/react-native/pull/49227, but it also has node_modules so it will not test that condition correctly.
## Changelog:
[INTERNAL] [FIXED] - Fix exclude .d.ts test in GenerateCodegenSchemaTaskTest
Pull Request resolved: https://github.com/facebook/react-native/pull/49238
Test Plan: Run tests
Reviewed By: cipolleschi
Differential Revision: D69291695
Pulled By: cortinico
fbshipit-source-id: 46b9367f3466b9cd49232a0565e5778a06b43990
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/49216
Should be able to replace `processTransformOrigin`.
As part of this, I discovered `processTransformOrigin` has a bug where it does not correctly support `center left` or `center right` syntax since it assumes first occurrence of `center` is for the horizontal
Changelog: [Internal]
Reviewed By: lenaic
Differential Revision: D69204030
fbshipit-source-id: 8001ef4f0b54fcbe93855920260e077b89669f6d
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/49189
Allow parsing the set of currently supported transform functions, and lists of them, using `CSSTranformFunction` (which may decompose to e.g. `CSSScaleX`), and `CSSTransformList`.
A bit more duplication than I would like here, but a lot of these have subtle differences.
Changelog: [Internal]
Reviewed By: lenaic
Differential Revision: D69153280
fbshipit-source-id: ef8e93c8a49a7f1b98bd7c57614aa1c84417120d
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/49230
Those public modifier have no meaning as the class is internal. I'm removing them.
Changelog:
[Internal] [Changed] -
Reviewed By: tdn120
Differential Revision: D69251378
fbshipit-source-id: 4c3747510d18330dcdb8a0798e92736c4ab65a03
Summary:
In some projects we have conventions of using .tsx extension even for files without react components, we had issues where codegen wasn't updated properly.
I debugged the files included in a large project and made some improvements:
- Include tsx and jsx files
- exclude nested node_modules
- exclude ts type def files
## Changelog:
[ANDROID] [FIXED] - Improve input files for codegen gradle task
Pull Request resolved: https://github.com/facebook/react-native/pull/49227
Test Plan: Tested in a large app using codegen. I inspected the files that are included in the task inputs and made sure it works with first party and 3rd party modules.
Reviewed By: cipolleschi
Differential Revision: D69254204
Pulled By: cortinico
fbshipit-source-id: 368408e9719e9b5c9839dd873430b86ae4a062c7
Summary:
`loadSourceForBridge` is broken after we refactor the appdelegate. So let's add it back.
## Changelog:
[IOS] [FIXED] - Added custom load js block in bridge mode
Pull Request resolved: https://github.com/facebook/react-native/pull/48845
Test Plan: Custom Appdelegate's `loadSourceForBridge` can be called in bridge mode.
Reviewed By: robhogan
Differential Revision: D68832046
Pulled By: cipolleschi
fbshipit-source-id: dcea791e6d8243fdb2f45a33af175aee1a4e1223
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/49222
Changelog: [internal]
This implements `test.only` in Fantom benchmarks, so we can focus on a specific case to speed up iteration.
Reviewed By: sammy-SC
Differential Revision: D69241220
fbshipit-source-id: 42b02fcb4d693988da4fa15a0c6bd7e90e473b9f
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/49223
Changelog: [internal]
Renames `suite.add()` as `suite.test()` for symmetry with Jest.
We'll also allow `test.only` in a following change for quick iteration.
Reviewed By: rshest
Differential Revision: D69241221
fbshipit-source-id: d141f80dc0c8e51b419ce233bca68bf0755fd356
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/49212
Currently, developers can't use `popup-menu-android` at all because the Gradle file we publish is referencing
internal machinery.
I'm adding a pre-publish script that manipulates the Gradle. This is the easiest solution without having to do
crazy setup inside RNGP or having duplicated version codes around in the monorepo.
Fixes https://github.com/facebook/react-native/issues/49112
Changelog:
[Android] [Fixed] - Fix react-native/popup-menu-android not building for 3rd party developers
Reviewed By: cipolleschi
Differential Revision: D69192874
fbshipit-source-id: 9f9e8a0a6e76308e598a09f4c70dbc659c238b00
Summary:
Hey!
Since new architecture introduced View Flattening on iOS, props responsible for disabling this feature on specific views should be defined in cross platform interface.
Reference: https://github.com/reactwg/react-native-new-architecture/discussions/110
## Changelog:
[GENERAL] [CHANGED] - move view flattening props to cross platform type interface
Pull Request resolved: https://github.com/facebook/react-native/pull/49220
Test Plan: N/A
Reviewed By: fabriziocucci
Differential Revision: D69239454
Pulled By: javache
fbshipit-source-id: a89cb9fbaec63bbcb7691df067d5d3a375a8a66e
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/49213
Update the version of Jest used in React Native and Metro's own tests from `^29.6.3` to `^29.7.0`
Changelog: [Internal]
Reviewed By: yungsters
Differential Revision: D69188217
fbshipit-source-id: 0748db5428e422c048454b7d129cbdd4dab6d687
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/49146
Runtime Reference ShadowNode Update is enabled by default and no longer referenced in the RN holdout. This diff:
- removes the feature flag
- removes all references to the feature flag, enabling it
- updates the unit test for RSNRU
Changelog: [Internal]
Reviewed By: javache
Differential Revision: D69061234
fbshipit-source-id: 0dab0b5cae99e83297f34645dee58ae9b3c0dc5f
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/49211
Add more control over view recycling behavior by splitting out each component that currently supports it.
Changelog:[Android][Added] Feature flags for recycling View, Text components separately
Reviewed By: sammy-SC, mdvacca
Differential Revision: D69190841
fbshipit-source-id: 6d85fee7103bf928e4f5bf6946bab3ff4cae4053
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/49184
D65645985 shipped a refactor to `Animated`, so that it would use a custom `useAnimatedPropsMemo` instead of `useMemo`. This significantly improved update performance by no longer invalidating the `AnimatedProps` on effectively every update to `Animated` components.
However, this was measured to increase memory usage. After a few experiments, we identified that use of the in-band state update was responsible for the memory regression. While this requires further root cause investigation, this diff attempts to mitigate the memory regression.
This diff introduces a feature flag that enables an implementation that minimizes duplicated work, such as unnecessarily computing `compositeKey` or creating new instances of `AnimatedProps`. In addition, this implementation strives to do so without significantly degrading when an update is interrupted by a concurrent update.
Changelog:
[General][Changed] - Introduced a feature flag to test an optimization in `Animated` to reduce memory usage.
Reviewed By: rickhanlonii
Differential Revision: D69135223
fbshipit-source-id: a2699a314625e7570698bc41455b139711cfd7e3
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/49141
This diff extends ReactNativeFeatureFlags to support prereleaseChannels, the goal is to be able to configure what release channel each feature flag will be enabled / disabled
changelog: [internal] internal
Reviewed By: rubennorte
Differential Revision: D68583324
fbshipit-source-id: 09fde8511dcf5dff63821f15afe0a2530a0845fd
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/49183
The feature has been released to all for quite some time now and the holdout group has finally been unlinked. This removes all references to the feature flag and a few indicators that the feature is enabled/disabled from RNTester
Changelog: [Internal]
Reviewed By: mdvacca
Differential Revision: D69146787
fbshipit-source-id: 8a7f01016a715e61541910630d8c3ceb84ec5c82
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/49201
There are some leftover references to CircleCI in these scripts. Let's remove it.
## Changelog:
[Internal] - Remove remaining CircleCI references from CI scripts
Reviewed By: huntie
Differential Revision: D69182535
fbshipit-source-id: 4e825b65b5f5ca6ce16f5c7ac2f79088cf2d1ace
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/49200
Changelog: [Internal]
Update to `toBeCalled` and `toBeCalledTimes` aliases - forward them using prototype so number of frames matches when thrown.
Reviewed By: rubennorte
Differential Revision: D69182276
fbshipit-source-id: c20469959dc2e0f5c3686c90e27cd80117ad5fb7
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/49192
Changelog: [internal]
We refactored the public API of Fantom benchmarks in https://github.com/facebook/react-native/pull/49014 but that refactor broke test only mode, as we started overriding the options after setting them. This fixes that.
Reviewed By: javache
Differential Revision: D69176983
fbshipit-source-id: 9afc2d2f27fb2ee0aa452d4b02c28531acf40b8e
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/49188
This allows creating lists of a compound data type, storing each element as a variant of the possible types, instead of as the specified type.
Changelog: [Internal]
Reviewed By: lenaic
Differential Revision: D69142157
fbshipit-source-id: d742d81a6517b24f24827727cd777550f2ad274f
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/49187
`tolower` is not `constexpr`. Share some quick utilities for char to lowercase, and case insensitive comparision that does not create new string.
Changelog: [Internal]
Reviewed By: lenaic
Differential Revision: D69134770
fbshipit-source-id: 57a84f2d1a441e5a4c07c0db96cb6c133770fb51
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/49186
Next up for transforms, and for some future cases, it is convenient to be able to export a single marker type like `CSSTransform`, that can expand to a variant of multiple possible types of different shape (e.g. `CSSMatrix3D` vs `CSSScale`).
It is also best (for code size) to only have a single representation of compound types (e.g. `<CSSLength, CSSPercentage>` generates a separate copy of code compared to `<CSSPercentage, CSSLength>`).
This diff introduces `CSSCompoundDataTypes` which allows composing types, which are then flattened out to discrete types during parsing. For simplicity, `CSSCompoundDataType` cannot currently be nested inside of other `CSSCompoundDataType`, though this could be added in the future.
```
/**
* Marker for the <length-percentage> data type
* https://drafts.csswg.org/css-values/#mixed-percentages
*/
using CSSLengthPercentage = CSSCompoundDataType<CSSLength, CSSPercentage>;
```
Changelog: [Internal]
Reviewed By: lenaic
Differential Revision: D69089416
fbshipit-source-id: 8645009f06eb14b1ac4437a4fc4dd6b9ad3f88a2