Summary:
Fixes two types of warnings that occur when running E2E tests:
1. A deprecation warning from Jest: 'Option "setupTestFrameworkScriptFile" was replaced by configuration "setupFilesAfterEnv", which supports multiple paths.'
2. YellowBox warnings when running the app in debug mode, about components that are deprecated and that require main queue setup.
By fixing these warnings, we increase contributors' confidence that things are working correctly, and draw attention to any warnings that they _should_ pay attention to, if and when they arise.
I feel confident that we should hide the deprecated-component warnings; we _want_ to use these components because we want them to be tested, until they're removed entirely.
For the warning "Module RCTImagePickerManager requires main queue setup", if that's something that can be fixed with reasonable effort in the RNTester code then I think it would be better to do so. Otherwise, I think it is good to hide the warning, because this is a condition we expect: it's not something a contributor should pay attention to.
Pull Request resolved: https://github.com/facebook/react-native/pull/22621
Differential Revision: D13468553
Pulled By: hramos
fbshipit-source-id: 1a5952087dd6fcc9ba08ff7a60ad9f5b075bef57
Summary:
@public
When switching to `CompactValue`, casting edges or dimensions to `std::array<YGValue, ...>` will do actual work.
In order to avoid that from happening implicitely, we remove the casting operator.
Reviewed By: SidharthGuglani
Differential Revision: D13464292
fbshipit-source-id: 217065b001a63cfa8adde715063682c583007a4d
Summary:
@public
Enforce more encapsulation of arrays of `YGValue` in `YGSty;e`.
This will allow us to use `CompactValue` in `YGStyle` while (mostly) retaining API compatibility.
Reviewed By: SidharthGuglani
Differential Revision: D13452042
fbshipit-source-id: 382b1c7245c4bea4280126ab1413e7e931b62eaa
Summary:
@public
`CompactValue` represents a `YGValue` in 32bits instead of 64. This comes at the cost of a range limitation, as one exponent bit is borrowed for the unit.
*Undefined* and *Auto* have no magnitude, and are represented as *NaN* values.
The data structure is meant to be used as a field type on `YGStyle` to save memory.
This is header-only for efficient inlining.
Reviewed By: jackerghan, aCorrado
Differential Revision: D13187211
fbshipit-source-id: 16e3ffad592e38e2493e4f7c8b952d372e449846
Summary:
This diff removes the dependency of `metro` on `react-native` by using the newly created `metro-react-native-babel-transformer` package.
This package does not depend on any other internal metro logic and this will decouple RN from metro a bit more.
Reviewed By: cpojer
Differential Revision: D13434949
fbshipit-source-id: a02a3b327c71cef53111514b797f7d6bc9f9d71c
Summary: Some logic to check for surface stage should've done bitwise `&` operation instead of equality check, because we do bitwise `|` whenever we "set stage".
Reviewed By: shergin
Differential Revision: D13459156
fbshipit-source-id: 94e2f5279fb1a31060beb7d6195953b25ce603c9
Summary:
This diff fixes a style property that was incorrectly mapped as `textDecorationLineType` in Fabric
This was correctly mapped in classic here: diffusion/FBS/browse/master/xplat/js/react-native-github/Libraries/Text/BaseText/RCTBaseTextViewManager.m;10b92f1847cdec8a3f0a996f218989766516f805$48
Reviewed By: mdvacca
Differential Revision: D13443921
fbshipit-source-id: 7fafaf2492d8c3b938f2e433a983303958e5c578
Summary:
@public
removes the `default` case from an already exhaustive switch.
Reviewed By: SidharthGuglani
Differential Revision: D13451869
fbshipit-source-id: 32727330c7fce013963f5c83c95a73b230d5c938
Summary:
@public
Replaces the `StyleProp` template with a simple setter macro / inlined getter code.
The template was introduced to replace more extensive macros that would generate function signatures, too.
Here, we keep the spirit of that change by only generating function bodies.
Reviewed By: SidharthGuglani
Differential Revision: D13439612
fbshipit-source-id: 36f6a86917d035be6891cb736d1f288d8e02f5cf
Summary:
@public
`YGFloatOptional` is a 32bit type now, and can be passed by value efficiently.
Reviewed By: SidharthGuglani
Differential Revision: D13439603
fbshipit-source-id: e12539ad5b3cccbd5bc27869866ca66c023b24a7
Summary:
@public
Replace `YGFloatOptional::getValue()` with `YGFloatOptional::unwrap()`.
`YGFloatOptional::getValue()` has the unfortunate property of calling `std::exit` if the wrapped value is undefined.
Here, we eliminate the method, and just call `.unwrap()` everywhere.
Reviewed By: shergin
Differential Revision: D13439608
fbshipit-source-id: 5ae82b170537d0a10c301412567a7a66fd50bab4
Summary:
Replaces `YGUnwrapFloatOptional` with `YGFloatOptional::unwrap`.
This leads to more idiomatic C++, and to less function call nesting, thus increasing readability.
Reviewed By: SidharthGuglani
Differential Revision: D13439604
fbshipit-source-id: 33b43c08d725c253c359959e7cbbd83fd6bd9ba4
Summary:
@public
After removing `-ffast-math`, `NaN` can again be used to represent `undefined`. That allows us to remove the additional flag from `YGFloatOptional`, and reduce memory usage.
Reviewed By: SidharthGuglani
Differential Revision: D13439611
fbshipit-source-id: 93e90f72f0415edb228b4e7d145e1fae35cc6b43
Summary:
@public
Creates a single header file for `YGValue`. This is in preparation of a more compact representation of `YGValue` within `YGStyle`.
Also fixes the incorrect definition of NAN.
Reviewed By: SidharthGuglani
Differential Revision: D13439602
fbshipit-source-id: 68eef2c391b6c9810f3c995b86fff7204ebe6511
Summary:
@public
`-ffast-math` does not have measurable performance benefits.
By using `NaN` for *undefined* values again, we can squeeze `YGFloatOptional` into 32 bits.
This will also enable us to store `YGValue` (or a variant of it) in 32 bits.
Reviewed By: astreet
Differential Revision: D13403925
fbshipit-source-id: b13d026bf556f24ab4699e65fb450af13a70961b
Summary: In TurboModules, we need to call into WritableArray and ReadableArray interfaces, not their implementations. By adding these interfaces, we can invoke the corresponding Java classes directly.
Reviewed By: fkgozali
Differential Revision: D6981870
fbshipit-source-id: 12b12b204a7d38b24363452ab574d88b827c907f
Summary: The current version of react-test-renderer is throwing an error when we use hooks. Upgrading to 16.7.0-alpha.2 fixes it.
Reviewed By: sahrens
Differential Revision: D13104634
fbshipit-source-id: ac7f8d603293907c8653e247563a4d12413b10b9
Summary: Android scrolling performance is very poor with this disabled. iOS has some KP with this enabled, so disable it for iOS.
Reviewed By: sahrens
Differential Revision: D13363494
fbshipit-source-id: efab77b5db9676dd0521ae4193465d45ac34dda3
Summary: In ReactNative, Native Modules usually use `ReadableMap` interface to take in arguments to methods, not `ReadableNativeMap`. Adding this interface defination to C++, so that with TurboModules, we could use it with `getMethod` definations.
Reviewed By: fkgozali
Differential Revision: D6721049
fbshipit-source-id: cb6e82d618338e54199c7dd066a846e71e742bc6
Summary:
By having this package we can remove the dependency from `react-native` to `metro` and then unblock the releases of metro to npm.
We cannot use this package yet from `react-native` since it hasn't been published, what I'm gonna do here is the following:
1. Land this diff
2. Publish manually a version of `metro-react-native-babel-transformer@0.50.0` once this diff lands.
3. Update the RN repo to depend on `metro-react-native-babel-transformer` instead of `metro`.
Then we should be able to publish versions of metro :)
Differential Revision: D13432231
fbshipit-source-id: 522152e32162cc5fc40aea2fa4c8fd53c528e2e3
Summary:
This diff fixes a bug in Touchable and Pressability where a long delay setting would unwillingly trigger presses by the user.
The cause of this bug is that we were not calculating the responder region until _after_ the delay. If you were to lift up outside of the press rect _before_ we calculate the responder region, we wouldn't be able to calculate that you're outside of the region (i.e. never transitioned to an "out" state) and would register the press
The fix is to start the calculation as soon as you transition into the initial state, so the calculation is available by the time we need to check if you're in an out state
Reviewed By: TheSavior
Differential Revision: D13412934
fbshipit-source-id: 55d1c2a9e70d4e3ce268f92075d7d09dd842a81e
Summary: easy diff to auto format ReactWebViewManager using our current java code guidelines
Reviewed By: fkgozali
Differential Revision: D13425320
fbshipit-source-id: e59407751c324896e9d6aea8a356949e7cadccaa
Summary:
This diff exposes a new prop for WebView in Android to disable HardwareAcceleration.
Disabling hardware acceleration is sometimes required to workaround chromium bugs: https://bugs.chromium.org/p/chromium/issues/detail?id=501901
Reviewed By: fkgozali
Differential Revision: D13425243
fbshipit-source-id: e3cd53c72d01f74624b60834496f3cc44076b6b5
Summary:
Fixed a typo in function doc.
Release Notes:
--------------
[INTERNAL][MINOR][CompositeReactPackage.java] - Updated a function documentation.
<!--
**INTERNAL and MINOR tagged notes will not be included in the next version's final release notes.**
CATEGORY
[----------] TYPE
[ CLI ] [-------------] LOCATION
[ DOCS ] [ BREAKING ] [-------------]
[ GENERAL ] [ BUGFIX ] [ {Component} ]
[ INTERNAL ] [ ENHANCEMENT ] [ {Filename} ]
[ IOS ] [ FEATURE ] [ {Directory} ] |-----------|
[ ANDROID ] [ MINOR ] [ {Framework} ] - | {Message} |
[----------] [-------------] [-------------] |-----------|
EXAMPLES:
[IOS] [BREAKING] [FlatList] - Change a thing that breaks other things
[ANDROID] [BUGFIX] [TextInput] - Did a thing to TextInput
[CLI] [FEATURE] [local-cli/info/info.js] - CLI easier to do things with
[DOCS] [BUGFIX] [GettingStarted.md] - Accidentally a thing/word
[GENERAL] [ENHANCEMENT] [Yoga] - Added new yoga thing/position
[INTERNAL] [FEATURE] [./scripts] - Added thing to script that nobody will see
-->
Pull Request resolved: https://github.com/facebook/react-native/pull/21421
Differential Revision: D13422878
Pulled By: hramos
fbshipit-source-id: ce08080d67652159c7f8bbb1ac8b0bfada814b4b
Summary:
Adds two additional UIBarStyles to RCTConvert
- [x] UIBarStyleBlackOpaque
- [x] UIBarStyleBlackTranslucent
Does not affect any tests or current usage of this conversion.
Pull Request resolved: https://github.com/facebook/react-native/pull/20102
Differential Revision: D13421942
Pulled By: hramos
fbshipit-source-id: 1e609eca0fdea2b56b9f6ac87e759c661bdee12b
Summary:
Fix#20991 - use name from `app.json` if available, instead of using `package.json`.
Pull Request resolved: https://github.com/facebook/react-native/pull/20992
Differential Revision: D13422928
Pulled By: hramos
fbshipit-source-id: 72dd07e82a366439f663508b07c1de5ca59b9dbf
Summary:
This diff disables the StateListAnimator for the ReactSlider component in Android 6 and 7
This is this is a hack to prevent T37452851 and https://github.com/facebook/react-native/issues/9979
Reviewed By: yungsters
Differential Revision: D13404685
fbshipit-source-id: d4c4f8796664c890f6a6b3502d3493370e17c300
Summary: If a children of a root node is being removed and the Root Node is empty, it was likely already removed and cleaned previously, likely due to a race condition caused by RN's async nature. In those cases, let's avoid crashing the app and instead silently ignore the root view removal.
Reviewed By: fkgozali
Differential Revision: D13405817
fbshipit-source-id: 0179d10a88a2d19f1db5ea35b48cb83d9d7429a6
Summary: Currently, bridge delegate can provide extra modules during bridge start up path. For TurboModules, we don't need this mechanism (if we need eager init, it will be done in a different way). So, let's ignore modules marked as RCTTurboModule if they are supplied as "extra native modules".
Reviewed By: axe-fb
Differential Revision: D13383710
fbshipit-source-id: c88d32739be9f66e0daf07ef5465ea6457f8d1c6
Summary:
Previously the RNTester app saved what screen you were on and what filter text was entered into the initial screen. This made e2e testing complex, as each test needed to manually restore the state to the home screen. If the state ever got out of sync with the test's expectations, it could lead to multiple failed tests.
There is still one specific component that uses persistence: `RNTesterSettingSwitchRow`. Persistence can be removed from this component next time tests for it are updated. As a result, `RNTesterStatePersister` is not yet entirely removed from the app.
Pull Request resolved: https://github.com/facebook/react-native/pull/22596
Differential Revision: D13413457
Pulled By: cpojer
fbshipit-source-id: 3faa26a94139397b4bce6b62ff43e9c2f870b145
Summary:
Any failures in `test_objc` within the objc-test.sh script have been kept hidden as `xcpretty` was swallowing the exit code from xcodebuild.
Fixes the issue TheSavior brought up in #22470 where failing snapshot tests were not reflected on Circle.
Run on Circle CI and confirm `test_objc` fails (iOS tests *are* broken on master).
Pull Request resolved: https://github.com/facebook/react-native/pull/22562
Differential Revision: D13406987
Pulled By: hramos
fbshipit-source-id: 3f3da01ab4c0ad87077813b06d2fdf788f32f6b8
Summary: This removes the remaining references to `local-cli`. We already have a `cli.js` file on the root that was just forwarding to the local-cli folder, so I removed that. It also seems that `setupBabel.js` is no longer necessary in RN.
Reviewed By: TheSavior
Differential Revision: D13396218
fbshipit-source-id: a945cb91dae39c4b58c5cabcca6b0f0328fc4717
Summary: We are using babel 7 and should not be using babel 6 any longer, this removes some references to babel 6 modules.
Reviewed By: yungsters
Differential Revision: D13137326
fbshipit-source-id: 4a2db84522e5613f72a8005f0b1e9943e815f9ec
Summary:
Previously the e2e test for Butto looked up elements by label. This can be fragile, and based on my understanding from TheSavior we would prefer to use testIDs. This also sets a consistent pattern we can point future contributors to, to follow.
Note that we are still looking up elements in the alerts shown by label. I haven't yet looked into whether it would be possible to add testIDs to alerts; it might be too complex to be worth it.
Pull Request resolved: https://github.com/facebook/react-native/pull/22593
Differential Revision: D13410799
Pulled By: TheSavior
fbshipit-source-id: 4bda80f4b8e7fe3ef17cd33209ec86d9183fd5e9
Summary:
Add key prop to renderHeader and renderFooter in ListViewMock.
Fix unique key error when using jest snapshots.
It closes#12762
Pull Request resolved: https://github.com/facebook/react-native/pull/14894
Reviewed By: TheSavior
Differential Revision: D13396721
Pulled By: cpojer
fbshipit-source-id: 5bbcb8157e3cd98fe07f2a037e1dbc06ab599c87
Summary:
Fixes#20935
Added UTFSequence module to React-Native exports. Put it under // APIs but I'm not certain if it belongs there.
Pull Request resolved: https://github.com/facebook/react-native/pull/20955
Differential Revision: D13396903
Pulled By: cpojer
fbshipit-source-id: 29cb2ee1431132bd7ca4973fecb0025cd6303a14