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
Summary:
This is a problem that is discussed in issue #21092
Related issues: #21851#19717
Found the code to eventually fix this issue [here](899b155746/fetch.js (L486))
- [x] Fetching an image locally and check if the blob is there, as well as its size > 0.
___
Help reviewers and the release process by writing your own release notes. See below for an example.
[GENERAL] [ENHANCEMENT] [whatwg-fetch] - set blob as default XMLHttpRequest header response type if supported
Pull Request resolved: https://github.com/facebook/react-native/pull/22063
Differential Revision: D13408797
Pulled By: cpojer
fbshipit-source-id: 9822d5a7e24bacd72838f3fc9a61b1a97b44484b
Summary:
Fixes#22578
Currently the only `textContentType` values that work are: `username`, `password`, `location`, `name` and `nickname`. This is due to the strings provided by React Native not matching up with the underlying string constants used in iOS (with the exception of the aforementioned types). Issue #22578 has more detail examples/explanation.
Pull Request resolved: https://github.com/facebook/react-native/pull/22579
Differential Revision: D13402177
Pulled By: shergin
fbshipit-source-id: 55f4a2029cd3ea1fb4834e9f56d2df5a05b31b4e
Summary:
Adds some initial tests for Touchable*. It only tests the first screen worth of examples; in a separate PR I'll work on an alternate way to "scroll" to individual examples in tests, before I add tests for the rest of the Touchable examples.
On the live stream where I began writing these tests, I reorganized the "Touchable feedback examples" to the top of the list so it would be on-screen for testing. I didn't include this reorganization or test in this PR; that can be added in once the "alternative to scrolling" is added in, to avoid having to reorganize.
Changelog:
----------
[General] [Added] - Add E2E tests for Touchable
Pull Request resolved: https://github.com/facebook/react-native/pull/22570
Differential Revision: D13400348
Pulled By: TheSavior
fbshipit-source-id: 821af135296049090427a16472cc14dabeb10ab4
Summary:
I've noticed that when a child's size is determined by `align-items: stretch` in combination with `aspect-ratio` its size is wrongly calculated to account for margin in the main axis when there is more than enough space.
See playground: https://goo.gl/tgW6cD
I've yet to figure out exactly how to solve this but i've started by writing a failing test when can be seen in the first commit here.
I assumed I had found the bug here https://github.com/facebook/yoga/blob/master/yoga/Yoga.cpp#L1838 where margin is being subtracted from the desired width even though the measure mode tells it to measure to exactly that size. However, if we don't remove this margin from the available width then 15 tests fail (including the one I just added) not quite figured out why yet. I'm also a bit confused at to why this would only happen for nodes with `aspect-ratio` and not for nodes where an explicit height and width is set.
Pull Request resolved: https://github.com/facebook/yoga/pull/834
Reviewed By: astreet
Differential Revision: D13223579
Pulled By: davidaurelio
fbshipit-source-id: 6970e6072e79f3bb6f9097355ab6e441441bfd88
Summary:
This diff ignores the `react-native-local-cli` from being used internally.
Unfortunately, since `react-native-local-cli` has its own dependency on Metro, and using `yarn` selective resolutions causes some issues with `flow` rechecks that have not been resolved (https://fb.facebook.com/groups/flow/permalink/2220467474668522/), the easiest way to move forward is to just not install the `react-native-local-cli` package internally (we don't need it since we have our own cli).
Reviewed By: pvdz
Differential Revision: D13377495
fbshipit-source-id: 6d6edbd947104e050ad1c31a657fc21fe6848692
Summary:
Promise semantics per JS should allow calling resolve or reject repeatedly without crashing. Only the first one should do anything, but others should be allowed. This change fixes the Java bridge for Android. A separate change is needed for iOS.
Issue #20262
Pull Request resolved: https://github.com/facebook/react-native/pull/20303
Differential Revision: D13396975
Pulled By: cpojer
fbshipit-source-id: 81f14f73654fa7c44e043f574a39fda481ace44b
Summary:
Adds a Detox configuration and instructions for running the app in development mode in Detox. This speeds up developing tests, because changes to production code don't require a full rebuild.
Pull Request resolved: https://github.com/facebook/react-native/pull/22572
Differential Revision: D13396883
Pulled By: cpojer
fbshipit-source-id: 186cc8d75eccae411b602cb0f68f0e11856e0743
Summary: There are some versions of babel 7's flow support that cause problems with property initializers. I changed this code to use class properties to fix the issue. See https://github.com/facebook/react-native/issues/20588
Reviewed By: TheSavior
Differential Revision: D13396959
fbshipit-source-id: a76266ac0c8a6a19a1c45f7136de4aba9c72581d
Summary:
Thank you for sending the PR! We appreciate you spending the time to work on these changes.
Help us understand your motivation by explaining why you decided to make this change.
If this PR fixes an issue, type "Fixes #issueNumber" to automatically close the issue when the PR is merged.
Pull Request resolved: https://github.com/facebook/react-native/pull/20867
Differential Revision: D13396488
Pulled By: cpojer
fbshipit-source-id: 971ac7b5f2e795280b94be78dce0fe44a065b942
Summary:
Metro and react-native now have first-class support to Typescript with Babel 7, but react-native Jest preset needs specific settings to work with .ts and .tsx files.
This PR updates react-native Jest preset to use Typescript out of the box.
Pull Request resolved: https://github.com/facebook/react-native/pull/22217
Differential Revision: D13396206
Pulled By: cpojer
fbshipit-source-id: aa4e4163e555c6b213457755bc13432fa1cddf5e
Summary:
This PR adds e2e tests for the Picker and DatePicker components.
While writing these tests, I also found and fixed two bugs where we wern't passing the `testID` down to the native components, so detox couldn't look them up. This confirms what was mentioned by rotemmiz [here](https://github.com/wix/Detox/issues/798#issuecomment-401412276)
Pull Request resolved: https://github.com/facebook/react-native/pull/22537
Reviewed By: cpojer
Differential Revision: D13371307
Pulled By: rickhanlonii
fbshipit-source-id: a4dfcdb5913645bceca0c7353328eeb9ad0f6558
Summary:
This fixes app crashes on opening android search assistant when a RN modal is visible. The root cause is that ViewGroup.dispatchProvideStructure() method uses the private variable 'mChildren' to access the children of a view group instead of the publicApi.
This fixes the top crash for the react_MarketplaceProductDetailsNonIPadRoute route.
This also fixes github issues:
https://github.com/facebook/react-native/issues/15932https://github.com/facebook/react-native/issues/13201https://github.com/facebook/react-native/issues/15440
that were closed without a fix
Reviewed By: PeteTheHeat
Differential Revision: D13375993
fbshipit-source-id: d603cb4ef65a423c63a6ef2b51235702c7dbffcb
Summary: This diff moves the React Native template from `local-cli/templates/HelloWorld` to `template`. Keeping it in the react-native repo will allow us to make changes to the template and version it together with react-native, instead of moving it out into a separate repo and trying to keep the template in sync with RN.
Reviewed By: TheSavior
Differential Revision: D13372949
fbshipit-source-id: e68e267b4dcf6384535d7b48fc11e297a12e9676
Summary: This cleans up various configurations after the removal of this folder.
Reviewed By: hramos
Differential Revision: D13338515
fbshipit-source-id: 9d6877921e15a183e46861626af831231333f42a
Summary:
This diff removes all files from the local-cli from react-native-github. The only leftover is the `cli.js` which redirects to `react-native-local-cli` and the templates folder which I'll move in a follow-up.
This diff simply removes all files, it makes no code changes. There will be a cleanup diff on top of this one.
Reviewed By: TheSavior
Differential Revision: D13338367
fbshipit-source-id: 1afabdb34202596fb13186d728df74482c9bc609
Summary:
Experienced a `TouchableOpacity` releasing the `PanResponder` without invoking `onPress` due to a missing a direction key in the `hitSlop` prop; The missing key caused the corresponding pressExpand to become NaN which causes `isTouchWithinActive` to become falsey, when it should be truthy.
If defaulting to 0 is undesired behavior, I'm happy to take a different approach.
Pull Request resolved: https://github.com/facebook/react-native/pull/22281
Differential Revision: D13374335
Pulled By: cpojer
fbshipit-source-id: f9d28e51b9d9c45aed42bea2df3d844a799fa827
Summary:
Fixes#16304
The standard format for origin HTTP headers does not allow a trailing slash. In order to not get warnings when connecting a websocket, I removed the trailing slash when generating the default origin HTTP header for the websocket connect request.
Release Notes:
----------
[Android] [Fixed] - Fixed default origin header for websocket connections to match the standard format (https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Origin) in WebSocketModule
Pull Request resolved: https://github.com/facebook/react-native/pull/22290
Differential Revision: D13374345
Pulled By: cpojer
fbshipit-source-id: 1173241f2b6912fd6df5e196053a950bb42ff01b
Summary:
Update reference to property in code comment in `RCTImageLoader`. There is no protocol named `RCTImageCacheDelegate` in the codebase. Its just `RCTImageCache` and it exists [here](f2894e58cf/Libraries/Image/RCTImageLoader.h (L22)).
Pull Request resolved: https://github.com/facebook/react-native/pull/22406
Differential Revision: D13373793
Pulled By: cpojer
fbshipit-source-id: b5edf18ebad626bf09648c079299e5acd14ba48a
Summary:
Since #18470, the default focus behaviour of `TouchableHighlight` and `TouchableOpacity` has been missing on tvOS. This uses the new `touchableHandleFocus` and `touchableHandleBlur` functions to restore the behaviour. Fixes#21295.
Pull Request resolved: https://github.com/facebook/react-native/pull/21478
Differential Revision: D13372959
Pulled By: cpojer
fbshipit-source-id: a5fa9d45214ac48a14a6573ccf014bba1ee0a103
Summary:
This PR allows Android projects that use `apply plugin: "com.android.library"` to build successfully. A recent regression caused by https://github.com/facebook/react-native/pull/20526 means that building one of these projects always fails with this error:
```
FAILURE: Build failed with an exception.
* Where:
Script '/Users/james/src/SampleLibrary/node_modules/react-native/react.gradle' line: 15
* What went wrong:
A problem occurred configuring project ':app'.
> Could not get unknown property 'applicationVariants' for object of type com.android.build.gradle.LibraryExtension.
* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.
* Get more help at https://help.gradle.org
BUILD FAILED in 0s
```
This change updates `react.gradle` to cater to both application and library projects by selectively using `android.applicationVariants` or `android.libraryVariants`.
Fixes https://github.com/facebook/react-native/issues/22310.
Pull Request resolved: https://github.com/facebook/react-native/pull/22312
Differential Revision: D13373742
Pulled By: cpojer
fbshipit-source-id: 64c35ab7a6d5d0d840a43729123e70dd8e0d36e0
Summary:
Fixes#22530
As described in the issue, the previous behavior for the `RCTFatal` macro was to truncate the `reason` on the resulting `NSException` to 75 characters. This would ensure the reason would fit on a single line, but resulted in issues debugging errors that occurred in the wild, as many crash logging tools (like Sentry) discard the `name` value of the exception and use the `reason` as their primary identifier. At 75 characters, useful information like the location of the error would usually be truncated.
- [x] This extends the truncation threshold to 175 characters, which should be short enough to prevent full-screen-takeover length errors, but long enough to provide useful context to the error.
- [x] This adds a `userInfo` value to the resulting `NSException`. It copies over the `userInfo` from the `NSError` passed to the macro, and adds an "untruncated message" value that contains the untruncated version of the `NSException`'s reason.
[iOS] [Changed] - RCTFatalExceptions now include more information in their reason and a userInfo.
<!--
CATEGORY may be:
- [General]
- [iOS]
- [Android]
TYPE may be:
- [Added] for new features.
- [Changed] for changes in existing functionality.
- [Deprecated] for soon-to-be removed features.
- [Removed] for now removed features.
- [Fixed] for any bug fixes.
- [Security] in case of vulnerabilities.
For more detail, see https://keepachangelog.com/en/1.0.0/#how
MESSAGE may answer "what and why" on a feature level. Use this to briefly tell React Native users about notable changes.
EXAMPLES:
[General] [Added] - Add snapToOffsets prop to ScrollView component
[General] [Fixed] - Fix various issues in snapToInterval on ScrollView component
[iOS] [Fixed] - Fix crash in RCTImagePicker
-->
Pull Request resolved: https://github.com/facebook/react-native/pull/22532
Differential Revision: D13373469
Pulled By: cpojer
fbshipit-source-id: ac140d14ce76e1664869437c2c178bdd65ab6e0e
Summary: These files are used by `js1 run`. By copying them close to `runServer.js` we can soon remove `local-cli`.
Reviewed By: TheSavior
Differential Revision: D13337487
fbshipit-source-id: ef80317580d5a9b3e560ad1f27b681887cf50b6b
Summary: This module now lives outside of the React Native repo.
Reviewed By: TheSavior
Differential Revision: D13337412
fbshipit-source-id: 548868e5f1f3812574fda3d235eb9d47c81d6522
Summary:
These files are some of the few standalone files from the `local-cli` that are used internally. This diff copies them into the one place where they are used. Note that I am leaving the old files in `local-cli`. Even if they are unused, moving them would break flow (require module verification).
This diff also moves the `assetPathUtils` file into `Libraries/Image`, which is where it is used. This was previously part of D13337412 but I had to squash them to make buck happy.
Reviewed By: TheSavior
Differential Revision: D13337304
fbshipit-source-id: 2d501109ba7d4ba94ca7e8f2953258221947b90e
Summary:
This PR only contains README updates.
1. Adds roadmap link
2. Adds releases repo link
3. Adds discussions and proposals repo link
4. Fixes the help link (pointed to abandoned forum)
Pull Request resolved: https://github.com/facebook/react-native/pull/22548
Differential Revision: D13372704
Pulled By: cpojer
fbshipit-source-id: 3c04d00ae08281298a851ddd6ec38ff67c6add30
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: D13233687
fbshipit-source-id: 218a7d5edb489b43a66c8c9d6156f74feefd2227
Summary:
@public
`YGFloatOptional` is a 32bit type now, and can be passed by value efficiently.
Reviewed By: SidharthGuglani
Differential Revision: D13209150
fbshipit-source-id: c7b937a640258256c97e082ba2f832754e191b9a