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
Summary:
@public
`YGFloatOptional::getValue()` has the unfortunate property of calling `std::exit` if the wrapped value is undefined.
That forces `x.isUndefined() ? fallback : x.getValue()` as access pattern.
Here, we replace that by introducing `YGFloatOptional::orElse(float)` which encapsulates that pattern. Other additions are `orElseGet([] { … })` and some extra operators.
Reviewed By: SidharthGuglani
Differential Revision: D13209152
fbshipit-source-id: 4e5deceaaaaf8eaed44846a8c152cc8b235e815c
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: D13209157
fbshipit-source-id: 21b83c837a78f924a4ec23a9236ca2440b3c8606
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: D13172444
fbshipit-source-id: 4250dbcf8fe15ec3ecdee3913360a73bab633ce3
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: SidharthGuglani
Differential Revision: D13119110
fbshipit-source-id: 4e6964240bf74ebc22d8783107b89d536a1a0842
Summary: This change adds type information for `Platform.select` to make sure things are properly typed. This is the last diff in a stack that actually enables the newly fixed/added annotations and it will only land once all the type errors (320+) are fixed.
Reviewed By: sahrens
Differential Revision: D13318805
fbshipit-source-id: af0475d1a2f1e5ace4d513be48827e3659bd7f62
Summary: This diff adds or fixes type annotations on a variety of files around RN.
Reviewed By: sahrens
Differential Revision: D13318808
fbshipit-source-id: dc466938167fda1ed7d6c9423c6cafe8040602e6
Summary: This diff ensures that Events delivered from the C++ side are actually processed. This is done forcing the execution of AsyncEventBeat.beat() in these cases
Reviewed By: shergin
Differential Revision: D13313955
fbshipit-source-id: b2785647913a640c2d557f4fa08d447845a540e9
Summary:
This check is too aggressive. We will consider putting it back once we are
more certain nothing will trigger it.
Differential Revision: D13350907
fbshipit-source-id: 6033bdbfe7adb2a18bdf889c090cf271497605e5
Summary:
In some setup, buck cxx test for android runs with `NDEBUG` set, hence we can't call debug symbols in the test cases. So guard those callsites with `#ifndef NDEBUG`.
Also, some dependencies for this test target depend on Android specific symbols, so we have to mark it as instrumentation test for now (FB-specific).
Reviewed By: sahrens
Differential Revision: D13337637
fbshipit-source-id: 02ff152df9937f2b0b8596f53789cdee8ee8a539
Summary: For configuration purpose, pass down config object from the hosting app and use it in UITemplateProcessor.
Reviewed By: sahrens
Differential Revision: D13290322
fbshipit-source-id: 8bb6d7f5a3f977b873e548e15603259876b46dc8
Summary: Each app may provide different impl for its runtime specific behaviors, then Fabric and other new infra can share the same config instance to configure stuffs.
Reviewed By: sahrens
Differential Revision: D13290319
fbshipit-source-id: 30e3eeedc6ff6ef250ed233b27e38cb7c1062b55
Summary:
The code analysis script takes the results of `eslint .` and filters out any messages for filepaths outside of what is modified in a given pull request. This diff fixes an issue where the bot will fail to post warnings if a pull request contains multiple commits, where the most recent commit is a rebase (e.g. 63c00f20a7 in https://github.com/facebook/react-native/pull/22470). This happens because the script looks for files changed in the most recent commit in a PR.
In this diff, we switch to a new GitHub API that returns the list of all files changed by a PR, obviating the need to go through individual commits in a PR to look for changed files.
Reviewed By: TheSavior
Differential Revision: D13324154
fbshipit-source-id: f9f50028439d1969b0feea65f0b3e8bf75ac1a33
Summary: I want the same instrumentation we did for the JS thread for the NM thread. This diff adds thread cpu time.
Reviewed By: alexeylang
Differential Revision: D13328876
fbshipit-source-id: 7b310956c52907ffbd881f864e1f8e774853d7f5
Summary:
A recent PR was merged with changes to appveyor.yml, but that file recently moved to .appveyor/config.yml
Pull Request resolved: https://github.com/facebook/react-native/pull/22529
Differential Revision: D13342085
Pulled By: hramos
fbshipit-source-id: d243e233ef769ab279dacdd48444248fbdec9417
Summary:
There is a problem that the `mediaPlaybackRequiresUserAction` property does not work in WKWebView(`useWebKit`) under iOS 10.
I fully know you are currently working to migrate the core's WebView to the standalone `react-native-webview` project. This has already been submitted to PR in `react-native-webview` and will be merged soon. I hope this fix applies to `react-native` before your migration is done.
Pull Request resolved: https://github.com/facebook/react-native/pull/22208
Differential Revision: D13334868
Pulled By: cpojer
fbshipit-source-id: f2a811a477054155ed5fe62ab31e4d63f70e7848
Summary:
Related to #22100
Enhance ViewPropTypes flow types.
- I had some troubles with a TODO left for `onResponderGrant` hence the return type.
- I wasn't able to properly type `nativeBackgroundAndroid` and `nativeForegroundAndroid` at the moment.
Pull Request resolved: https://github.com/facebook/react-native/pull/22504
Reviewed By: cpojer
Differential Revision: D13334024
Pulled By: TheSavior
fbshipit-source-id: cada236e0d716ae78cb663172e5315cf11c6406a
Summary:
`instance.hasOwnProperty` has potential danger because of some object could be eliminate own prototype chain. Update code be more reliable.
This PR is solution of #22308 issue. (Fixes#22308)
Pull Request resolved: https://github.com/facebook/react-native/pull/22348
Differential Revision: D13334882
Pulled By: cpojer
fbshipit-source-id: 9b9310a972e933af1962666d7b0c683ff43cc5b2
Summary:
Related to #22100
Enhance TouchableWithoutFeedback with press and target event types.
There are still work to do to update `UNSAFE_componentWillReceiveProps` and `touchableGetHitSlop` to make Flow not complain about `DeprecatedEdgeInsetsPropType` inexact type.
Pull Request resolved: https://github.com/facebook/react-native/pull/22479
Reviewed By: RSNara
Differential Revision: D13310764
Pulled By: TheSavior
fbshipit-source-id: 9002e542378491fb800c8e81c63f4fbe125b563c