Summary: Small changes to get Profile build working. Compiler errors or immediate crashes occur without these lines, when running a profile build on device.
Reviewed By: fkgozali
Differential Revision: D13823136
fbshipit-source-id: a1777d5337d8bd78ef3eb11bbeeb7e23c383ab83
Summary: Simple diff that adds QPL marker to track time it takes to load .so file from RN
Reviewed By: fkgozali
Differential Revision: D13845379
fbshipit-source-id: 6c2272605ba3fb08ab8ebce867f84c6a488438d0
Summary:
Reverting this change since it broke some initial scroll positions. It seems the proper API to use to limit overscrolling should be overScrollMode='never'
Original commit changeset: 2ec5787218ec
Reviewed By: olegbl
Differential Revision: D13845053
fbshipit-source-id: 673aa529ef5171f26ce138573ee36f31f5d9799e
Summary:
… suffix for asset
Better informational error message on getting Android drawable folder suffix error using the asset name scale.
<!--
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.
You can learn more about contributing to React Native here: http://facebook.github.io/react-native/docs/contributing.html
Happy contributing!
-->
I've got an not well described error when trying to bundle my React Native project package.
You can test the React Native bundle command like this:
node node_modules/react-native/local-cli/cli.js bundle --platform android --dev false --reset-cache --entry-file index.android.js --bundle-output /project/android/app/build/intermediates/assets/release/index.android.bundle --assets-dest /project/android/app/build
(If this PR adds or changes functionality, please take some time to update the docs at https://github.com/facebook/react-native-website, and link to your PR here.)
<!--
Help reviewers and the release process by writing your own release notes
**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 ] [ {File} ]
[ IOS ] [ FEATURE ] [ {Directory} ] |-----------|
[ ANDROID ] [ MINOR ] [ {Framework} ] - | {Message} |
[----------] [-------------] [-------------] |-----------|
[CATEGORY] [TYPE] [LOCATION] - 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/17751
Differential Revision: D13840597
Pulled By: cpojer
fbshipit-source-id: f755ef665b76ce3dd9c96e575fbc71e9aaf43a44
Summary:
For most cases, people saw this error when they are running a debug version. So they should check metro server first. However, they were misled to search for "bundle" keywords and finally they executed "react-native bundle" command and got an app that can never reload.
Pull Request resolved: https://github.com/facebook/react-native/pull/17055
Differential Revision: D13421737
Pulled By: cpojer
fbshipit-source-id: 8e108df06b7d416a74c33581457f3213b28306c1
Summary:
Right now you can choose to show Videos OR Photos.
This PR allows to show both in the same time.
[ANDROID][ENHANCEMENT] - Can show videos and photos from CameraRoll in the same time
Pull Request resolved: https://github.com/facebook/react-native/pull/16429
Differential Revision: D13839638
Pulled By: cpojer
fbshipit-source-id: 5edc039552888c3ba8a40f39e262919fa7c00b39
Summary:
This is a new attempt to get #11251 merged. I just cherry-picked the relevant commits. TextInputs are set to always ignore responder termination requests, which is not desirable when they are enclosed inside a swipeable area like a ListView
Create a TextInput inside a ListView and set the `rejectResponderTermination` prop to false. Otherwise, all TextInputs should have the same behavior they do now.
[IOS] [ENHANCEMENT] [TextInput] - Add `rejectResponderTermination` prop to to TextInput. This enables TextInputs inside Swipeables to function properly.
Pull Request resolved: https://github.com/facebook/react-native/pull/16755
Differential Revision: D7846365
Pulled By: cpojer
fbshipit-source-id: eb21140061ae1f475fbd83fc63a23819e931787d
Summary:
This method was originally intended to replace the OkHttp client used by React Native's networking library. However it has effectively been a noop since 0a71f48b13 (diff-177100ae5a977e4060b54cc2b34c79a7), when the Networking library was modified to create a new client rather than use the reference provided by OkHttpClientProvider.
Leaving this code in place is dangerous. There is no indication to users upgrading React Native that the method is no longer replacing the OkHttpClient used by the Networking library. Any functionality reliant on overriding the client will silently break. This caused us some problems internally.
There's been a PR out for some time that seeks to reintroduce this functionality: https://github.com/facebook/react-native/pull/14068
I've also put up a new PR that adds an interface for replacing the client without introducing breaking changes: https://github.com/facebook/react-native/pull/17237
Do our unit tests continue to pass? Should be safe as this method is not used anywhere inside React Native.
[ANDROID] [BREAKING] [Networking] - removed replaceOkHttpClient method in OkHttpClientProvider.
Pull Request resolved: https://github.com/facebook/react-native/pull/16972
Differential Revision: D13838805
Pulled By: cpojer
fbshipit-source-id: 43606d1d141afb9b5dda4dd64e5ac5448771b45c
Summary:
We have a million of inline styles in RNTester which causes a lot of noise with the lint bot in PRs. The rule makes sense for the main libraries but for RNTester it usually makes examples easier to read to just use inline styles. Also reduces lint warnings from 357 to 77.
Changelog:
----------
[General] [Changed] - Disable no-inline-styles lint rule for RNTester
Pull Request resolved: https://github.com/facebook/react-native/pull/23169
Differential Revision: D13838529
Pulled By: cpojer
fbshipit-source-id: 474e159e0b0c07bce42878db2b214b8903b49c08
Summary:
`Animated.event` not work with direct events and not bubbling events, which means it does not work with `PanResponder`, please see [Animation Caveats](https://facebook.github.io/react-native/docs/animations#caveats)
Changelog:
----------
[General] [Fixed] - Disable animation native driver in AnimatedGratuisousApp of RNTester.
Pull Request resolved: https://github.com/facebook/react-native/pull/23172
Differential Revision: D13838555
Pulled By: cpojer
fbshipit-source-id: 866bc83e780d6712ffae5964615af44a72bf998c
Summary:
In RNTester, previously the MaskedViewExample was returned as a single example record. However, within that one example there were several sub-examples. Now that we've implemented example filtering, filtering didn't really work for MaskedViewExample because it only operates on top-level examples.
There was no benefit to grouping MaskedViewExample into a single example, so this PR splits it into separate examples.
Changelog:
----------
Help reviewers and the release process by writing your own changelog entry. See http://facebook.github.io/react-native/docs/contributing#changelog for an example.
[General] [Fixed] - Fix filtering of MaskedViewExample by splitting into separate example records.
Pull Request resolved: https://github.com/facebook/react-native/pull/23168
Differential Revision: D13838524
Pulled By: cpojer
fbshipit-source-id: 21ae8228e4ce5bfc06fb1ea230163da9261cb36a
Summary: Use a folly LRU implementation to cache results of ParagraphShadowNode::measure, which Yoga asks for repeatedly. Should have a substantial speed improvement on Android and iOS, or at least that's the dream.
Reviewed By: mdvacca
Differential Revision: D13795808
fbshipit-source-id: 5716af0fe0517a72716e48113c8125bb788735d7
Summary:
This will allow the bot to more easily target issues that circumvent the bug report template.
Pull Request resolved: https://github.com/facebook/react-native/pull/23162
Differential Revision: D13827908
Pulled By: hramos
fbshipit-source-id: 712e0fba7b9b33f8b05cbd9294c6725f677fdb09
Summary: Folly promises/futures have been replaced by an observer model which keeps track of loading state. This resolves at least one crash that I can no longer repro and simplifies the code a bit (IMO).
Reviewed By: shergin
Differential Revision: D13743393
fbshipit-source-id: 2b650841525db98b2f67add85f2097f24259c6cf
Summary:
On Android `textTransform` breaks other styles applied to the text. It seems related to the usage of `ReplacementSpan` which allows drawing the text manually but seems to throw away some changes made by other span applied to the text.
To fix it I removed the usage of `ReplacementSpan` and simply transform the text before appending it to the `Spannable` string. To make sure textTransform is inherited correctly I added it to TextAttributes which handles this.
Pull Request resolved: https://github.com/facebook/react-native/pull/22670
Differential Revision: D13494819
Pulled By: cpojer
fbshipit-source-id: 1c69591084aa906c2d3b10153b354d39c0936340
Summary:
Add suport to gradle 4.10.1 or high!
The new version of android studio 3.3 recommendete to update gradle project to 4.10.1
> To take advantage of the latest features, improvements, and security fixes, we strongly recommend that you update the Android Gradle plugin to version 3.3.0 and Gradle to version 4.10.1. [Release notes ](https://developer.android.com/studio/releases/gradle-plugin)
>Android plugin 3.2.0 and higher now support building the Android App Bundle—a new upload format that defers APK generation and signing to compatible app stores, such as Google Play. With app bundles, you no longer have to build, sign, and manage multiple APKs, and users get smaller, more optimized downloads. [Learn more](https://developer.android.com/guide/app-bundle/?utm_source=android-studio)
but if the upgrade to the new Android gradle many warnings come up, becouse meny things was obsoleted
> WARNING: API 'variant.getMergeResources()' is obsolete and has been replaced with 'variant.getMergeResourcesProvider()'.
> WARNING: API 'variant.getPackageApplication()' is obsolete and has been replaced with 'variant.getPackageApplicationProvider()'.
> WARNING: API 'variant.getMergeAssets()' is obsolete and has been replaced with 'variant.getMergeAssetsProvider()'.
> It will be removed at the end of 2019.
> For more information, [see ](https://d.android.com/r/tools/task-configuration-avoidance.)
> To determine what is calling variant.getMergeAssets(), use -Pandroid.debug.obsoleteApi=true on the command line to display a stack trace.
Changelog:
----------
[Android] [Deprecated] - fix warinings obsolete to update to gradle 4.10.1 or high
Pull Request resolved: https://github.com/facebook/react-native/pull/23103
Differential Revision: D13817123
Pulled By: cpojer
fbshipit-source-id: 9816e20145a5fded2702cf9317cfb6862f3ebd8b
Summary:
Instead of using ~/.rncache use the special Caches directory designed for caching files. This fixes#21780.
Changelog:
----------
[iOS] [Changed] - Moved iOS build cache directory from ~/.rncache to ~/Library/Caches/com.facebook.ReactNativeBuild
Pull Request resolved: https://github.com/facebook/react-native/pull/22688
Differential Revision: D13817171
Pulled By: cpojer
fbshipit-source-id: af03dda66f9d49f4fe88bd050b359ccb7abb889a
Summary:
This change is required to make `yarn test` work in newly initialized project.
`Jest@23` doesn't play well with new babel, so we need to install `babel-core@^7.0.0-bridge.0` and change `.babelrc` to `babel.config.js` to make it work. This is a temporary change till `jest` releases stable `24` version.
Pull Request resolved: https://github.com/facebook/react-native/pull/23150
Differential Revision: D13811428
Pulled By: hramos
fbshipit-source-id: 8db6b9177cd31d4a1213fb44964b05f26982bdf2
Summary: LayoutAnimation is one source of flakiness in SSTs. Disable it globally in the SST apps.
Reviewed By: ejanzer
Differential Revision: D13791987
fbshipit-source-id: 0ebfd79fb31d235680c0d84f4b06d5a98c35260a
Summary:
This is a recreation of #13924, rebased on top of master, as the former PR wasn't re-reviewed and automatically closed by the bot.
iOS [Action Sheets docs](https://developer.apple.com/ios/human-interface-guidelines/ui-views/action-sheets/) say
> Make destructive choices prominent. Use red for buttons that perform destructive or dangerous actions, and display these buttons at the top of an action sheet.
Currently ActionSheetIOS's showActionSheetWithOptions only supports a single destructive button via the prop `destructiveButtonIndex`.
This PR maintains backwards compatibility with `destructiveButtonIndex` while simultaneously supporting `destructiveButtonIndexes` allowing developers to pass an array of destructive indexes
```js
ActionSheetIOS.showActionSheetWithOptions({
options: ['one', 'two', 'three'],
destructiveButtonIndexes: [0, 1],
}, () => {});
```
<img width="282" alt="actionsheet" src="https://cloud.githubusercontent.com/assets/3091143/25963211/1c211a16-3646-11e7-9b7c-c9a2dbea7832.png">
Some additional tests, all working as expected (item only red if it is a matching index).
```js
ActionSheetIOS.showActionSheetWithOptions({
options: ['one', 'two', 'three'],
destructiveButtonIndexes: [0, 19],
}, () => {});
```
```js
ActionSheetIOS.showActionSheetWithOptions({
options: ['one', 'two', 'three'],
destructiveButtonIndexes: [],
}, () => {});
```
```js
ActionSheetIOS.showActionSheetWithOptions({
options: ['one', 'two', 'three'],
destructiveButtonIndexes: undefined,
}, () => {});
```
```js
ActionSheetIOS.showActionSheetWithOptions({
options: ['one', 'two', 'three'],
}, () => {});
```
```js
ActionSheetIOS.showActionSheetWithOptions({
options: ['one', 'two', 'three'],
destructiveButtonIndexes: [0, 5, 0, 0],
}, () => {});
```
```js
ActionSheetIOS.showActionSheetWithOptions({
options: ['one', 'two', 'three'],
destructiveButtonIndexes: [0, 5, 0, 0, 'non numeric', 12.34],
}, () => {});
```
The following will crash the app but I believe this is expected
```js
ActionSheetIOS.showActionSheetWithOptions({
options: ['one', 'two', 'three'],
destructiveButtonIndexes: 'not an array',
}, () => {});
```
```js
ActionSheetIOS.showActionSheetWithOptions({
options: ['one', 'two', 'three'],
destructiveButtonIndexes: null,
}, () => {});
```
- [x] Explain the **motivation** for making this change.
- [x] Provide a **test plan** demonstrating that the code is solid.
- [x] Match the **code formatting** of the rest of the codebase.
- [x] Target the `master` branch, NOT a "stable" branch.
Pull Request resolved: https://github.com/facebook/react-native/pull/18254
Differential Revision: D13680516
Pulled By: hramos
fbshipit-source-id: ac183cdcf5e1daef8e3c584dcf6a921bbecad475
Summary:
This PR addresses TODO left in _AppState.js_
The goal is to align AppState module implementation between iOS and Android. iOS native module exposes _initialAppState_ constant that AppState.js relies on, while Android doesn't expose that constant and js implementation uses a fallback. This PR aims to remove a need for a fallback
Pull Request resolved: https://github.com/facebook/react-native/pull/19935
Reviewed By: hramos
Differential Revision: D13774044
Pulled By: ejanzer
fbshipit-source-id: 05d27e702cb9aeedf14293158bfd50004df4726b
Summary:
Changelog:
----------
[General] [Fixed] - After using React's `<StricMode>` it was discovered that a string ref was set, which is bad practice.
Pull Request resolved: https://github.com/facebook/react-native/pull/23146
Differential Revision: D13802397
Pulled By: cpojer
fbshipit-source-id: c2744877b25ad59eb1e4e9ce48a45e762f227b56
Summary:
@public
Removes `YGNodeInsertSharedChild` / `addSharedChildAt`.
This functionality is unused, and can cause memory leaks.
Reviewed By: SidharthGuglani
Differential Revision: D13711105
fbshipit-source-id: 86206c05393b3f1a497e6b046006f94ead88c6ce
Summary:
Update `xcode` package from 1.0.0 to 2.0.0 due to vulnerability issues affecting `plist`. Please, find below excerpt of the Snyk report.
> LOW SEVERITY
> Regular Expression Denial of Service (ReDoS)
> **Vulnerable module**: plist
> **Introduced through**: react-native@0.57.5
> **Introduced through**: learner-tools-miniapp@0.0.1 › react-native@0.57.5 › xcode@1.0.0 › simple-plist@0.2.1 › plist@2.0.1
>
> **Overview**
> plist is a Mac OS X Plist parser/builder for Node.js and browsers
>
> Affected versions of this package are vulnerable to Regular Expression Denial of Service (ReDoS) attacks due to bundling a vulnerable version of the XMLBuilder package. This can cause an impact of about 10 seconds matching time for data 60 characters long.
Pull Request resolved: https://github.com/facebook/react-native/pull/23051
Differential Revision: D13716882
Pulled By: hramos
fbshipit-source-id: 8aa91c8ac85d31b72302b7d24e76bd61623bbbda
Summary:
Equivalent of this iOS PR: https://github.com/facebook/react-native/pull/20915
Motivation:
----------
Whenever a user changes the system font size to its maximum allowable setting, React Native apps that allow font scaling can become unusable because the text gets too big. Experimenting with a native app like iMessage on iOS, the font size used for non-body text (e.g. header, navigational elements) is capped while the body text (e.g. text in the message bubbles) is allowed to grow.
This PR introduces a new prop on `<Text>` and `<TextInput>` called `maxFontSizeMultiplier`. This enables devs to set the maximum allowed text scale factor on a Text/TextInput. The default is 0 which means no limit.
Pull Request resolved: https://github.com/facebook/react-native/pull/23069
Differential Revision: D13748513
Pulled By: mdvacca
fbshipit-source-id: 8dd5d6d97bf79387d9a2236fa2e586ccb01afde9
Summary:
On Android, resources with the same name from different libraries conflict, so it's encouraged to have prefixes for resource names.
This is one case where the settings menu preferences file in firefox for android is called `preferences.xml` so it conflicts with the dev support settings menu for react native.
when integrating react-native to the firefox project, react native dev settings menu never shows, and the one from firefox shows up instead.
This a link to a file from a fork project that I'm working on:
https://github.com/ghostery/browser-android/blob/master/mozilla-release/mobile/android/app/src/main/res/xml/preferences.xml
Please, let me know, if anything more needs to be changed
Changelog:
-----------
[Android] [Fixed] Rename dev settings menu preferences file with a RN prefix.
Pull Request resolved: https://github.com/facebook/react-native/pull/23123
Differential Revision: D13781836
Pulled By: cpojer
fbshipit-source-id: f27483d4eca5aa4148759b94b601673985c5aa91
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:
Changelog:
----------
Help reviewers and the release process by writing your own changelog entry. See http://facebook.github.io/react-native/docs/contributing#changelog for an example.
[General] [Fixed] - Same style was applied twice to SwipeableQuickActionButton in a recent commit causing problems with the buttons layout.
Pull Request resolved: https://github.com/facebook/react-native/pull/23113
Differential Revision: D13781896
Pulled By: cpojer
fbshipit-source-id: 659ddaed32b6a1e90080344ea3b0b42088fd9783
Summary:
Fix crash similar to #22410
react-native: 0.51.0
react: 16.0.0
Changelog:
----------
[iOS] [Changed] - Use onw serial queue to execute invalidate and send request action in RCTHTTPRequestHandler.mm.
Message:
--------
```
- (void)invalidate
{
[_session invalidateAndCancel];
_session = nil;
}
- (NSURLSessionDataTask *)sendRequest:(NSURLRequest *)request
withDelegate:(id<RCTURLRequestDelegate>)delegate
{
// Lazy setup
if (!_session && [self isValid]) {
NSOperationQueue *callbackQueue = [NSOperationQueue new];
callbackQueue.maxConcurrentOperationCount = 1;
callbackQueue.underlyingQueue = [[_bridge networking] methodQueue];
NSURLSessionConfiguration *configuration = [NSURLSessionConfiguration defaultSessionConfiguration];
[configuration setHTTPShouldSetCookies:YES];
[configuration setHTTPCookieAcceptPolicy:NSHTTPCookieAcceptPolicyAlways];
[configuration setHTTPCookieStorage:[NSHTTPCookieStorage sharedHTTPCookieStorage]];
_session = [NSURLSession sessionWithConfiguration:configuration
delegate:self
delegateQueue:callbackQueue];
std::lock_guard<std::mutex> lock(_mutex);
_delegates = [[NSMapTable alloc] initWithKeyOptions:NSPointerFunctionsStrongMemory
valueOptions:NSPointerFunctionsStrongMemory
capacity:0];
}
NSURLSessionDataTask *task = [_session dataTaskWithRequest:request];
{
std::lock_guard<std::mutex> lock(_mutex);
[_delegates setObject:delegate forKey:task];
}
[task resume];
return task;
}
```
now the invalidate function is called by the RCTBridge.invalidate->RCTCxxBridge.invalidate->[moduleData.instance invalidate] , this is on the "com.facebook.react.HTTPRequestHandlerQueue".
the sendRequest:withDelegate function is called by RCTImageLoader and is on the "com.facebook.react.imageLoaderURLRequestQueue".
when one thread step in invalidate and execute [_session invalidateAndCancel] and the another thread step in sendRequest:withDelegate and execute [_session dataTaskWithRequest:request], the _session is invalidate, so there will be a crash "Task created in a session that has been invalidated"
Pull Request resolved: https://github.com/facebook/react-native/pull/22746
Differential Revision: D13781512
Pulled By: cpojer
fbshipit-source-id: bd5fd1edf593e2bcdcc18596a29e906882bac8a4
Summary:
PR Related to: #22990
Changelog:
[Android][Changed] - All the imports connected to requireNativeComponent in ActivityIndicator was moved to a seperate file.
Pull Request resolved: https://github.com/facebook/react-native/pull/23104
Differential Revision: D13781451
Pulled By: cpojer
fbshipit-source-id: 7204976d59a96abdaa81cdd7fd54fd001f7d1ee9