Summary:
…th RCTSharedApplication()
Thanks for submitting a PR! Please read these instructions carefully:
- [ ] Explain the **motivation** for making this change.
Using React Native latest version with Cocoapods 1.2.0 causes the following error inside iOS app extensions
> /react-native/React/Modules/RCTAccessibilityManager.m:67:70: ‘sharedApplication’ is unavailable: not available on iOS (App Extension) — Use view controller based solutions where appropriate instead.
Moving the use of [UIApplication sharedApplication] to RCTSharedApplication() which is safe on app extension
- [ ] Provide a **test plan** demonstrating that the code is solid.
I am not sure how to test such that all the features which touch the modified code are tested.
- [ ] Match the **code formatting** of the rest of the codebase.
- [ ] Target the `master` branch, NOT a "stable" branch.
What existing problem does the pull request solve?
Using React Native latest v
Closes https://github.com/facebook/react-native/pull/13227
Differential Revision: D4816338
Pulled By: javache
fbshipit-source-id: e3e3c77882990ad1817b0b633521cff52571ecd0
Summary:
Motivation: When logging to RCTRedBox, if any of the stack frames lacks a line number or a column, the application will crash with `[NSNull integerValue]: unrecognized selector sent to instance`.
Closes https://github.com/facebook/react-native/pull/13242
Differential Revision: D4812185
Pulled By: hramos
fbshipit-source-id: 4b1c3c38f67cf59034a383c95d4280d1b6380300
Summary:
There were some headers that were in the `public` or `private` section instead of `project` this causes headers to be included in archives and prevent it from being able to be uploaded to the app store. This fixes it by using only `project` headers and copy files like we use in other places.
Also fixes a file that was moved and not updated in ReactCxx.xcodeproj.
**Test plan**
Tested that I am now able to upload an archive on the app store.
Closes https://github.com/facebook/react-native/pull/13008
Differential Revision: D4779894
Pulled By: javache
fbshipit-source-id: 6e36e925cc3fc03c095c9f1872eb5a45b7f0d78c
Summary:
This fixes a bug that causes properties to keep stale values because they were not restored to their default after being removed when their value was controlled by native animated.
To fix this we restore default values in `disconnectFromView` by updating views with null values for all props that we modified previously. However this causes another issue where we lose any props that were set by the normal process because NativeAnimated operations are always executed after UIManager operatations. To fix this I added a way to hook into UIManager view updating process to be able to execute NativeAnimated operations either before or after updating native views.
In the case of disconnecting we want to do it before updating views so that it does: Value changed by native animated -> value restored to default -> (optional) value updated by normal prop.
This PR also depends on #10658.
**Test plan**
Tested that this fixed a particular bug in an app that uses ex-navigation + native animations where a navbar w
Closes https://github.com/facebook/react-native/pull/11819
Differential Revision: D4752566
Pulled By: javache
fbshipit-source-id: 68ee28200ffeba859ae1b98ac753bd7dcb8910f0
Summary:
This is enforced for all of our internal iOS code and a common cause of import failures.
cc janicduplessis
Closes https://github.com/facebook/react-native/pull/13124
Differential Revision: D4765016
fbshipit-source-id: 7c8248c98bca0fa6bad24d5a52b666243375e0db
Summary:
Various fixes of xcode projects and cleaning up some warnings
Closes https://github.com/facebook/react-native/pull/13109
Differential Revision: D4762652
Pulled By: lacker
fbshipit-source-id: b452976a58962439de4adecc8e703264af40cb38
Summary:
Motivation: Fixes Xcode warning `Ivar '_websocketExecutorName' which backs the property is not referenced in this property's accessor` which shows up because this property has no setter (and is never set anywhere).
Closes https://github.com/facebook/react-native/pull/12639
Differential Revision: D4745437
Pulled By: javache
fbshipit-source-id: 3ab4b0df62f90adc2b62d891197dc783e07da4e3
Summary:
While working with `RCTEventEmitter` I noticed that if an event is emitted before `_listenerCount` is updated, it will not go through because the listeners count hasn't been updated. Moving the count update before the invokation of `startObserving` and `stopObserving` fixes the issue. Same way if you remove the last listener and an event is fired before the count is updated (while it shouldn't be fired).
**Test plan (required)**
An easy test to demonstrate it is to implement `startObserving` to synchronously fire an event. Without the change, a warning is thrown, with the change, the event is fired. Not very strong on Obj-C here and I didn't know how to mock out the native stuff. Would be glad to write a failing unit test tho :)
Closes https://github.com/facebook/react-native/pull/11907
Differential Revision: D4738965
Pulled By: javache
fbshipit-source-id: cf175051be5b9c5de761d3dcd290560e1639b05e
Summary:
- [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.
The PR #11613 (0.43) removed this missing `toggleElementInspector` event send when `jsLoaded` in DevMenu (Now is DevSettings), it should open the inspector if `isElementInspectorShown` is true when we reload JS.
The dev menu text `Show / Hide Inspector` is dependent on `isElementInspectorShown` bool value.
([This behavior in 0.42](https://github.com/facebook/react-native/blob/0.42-stable/React/Modules/RCTDevMenu.mm#L436-L442))
Manual testing in UIExplorer:
* Open the dev menu and click `Show Inspector`
* Open the dev menu and click `Reload JS`
* The built-in inspector should keep open (dev menu text: `Hide Inspector`)
Closes https://github.com/facebook/react-native/pull/12999
Differential Revision: D4738959
Pulled By: javache
fbshipit-source-id: b3f584db51aa0e1b463c52003967b00bcd81bc99
Summary:
Several things:
* The mess with insets was fixed. Previously we tried to compensate the insets difference with `UITextField` by adjusting `textContainerInset` property, moreover we delegated negative part of this compensation to the view inset. That was terrible because it breaks `contentSize` computation, complicates whole insets consept, complicates everything; it just was not right. Now we are fixing the top and left inset differences in different places. We disable left and right 5pt margin by setting `_textView.textContainer.lineFragmentPadding = 0` and we introduce top 5px inset as a DEFAULT value for top inset for common multiline <TextInput> (this value can be easilly overwritten in Javascript).
* Internal layout and contentSize computations were unified and simplified.
* Now we report `intrinsicContentSize` value to Yoga, one step before auto-expandable TextInput.
Depends on D4640207.
Reviewed By: mmmulani
Differential Revision: D4645921
fbshipit-source-id: da5988ebac50be967caecd71e780c014f6eb257a
Summary: `autoresizingMask` is supposed to be set outside self class, this is UIKit convention.
Reviewed By: mmmulani
Differential Revision: D4697098
fbshipit-source-id: 7e0aa5d3032184de980b3cecafebbc4ce8ef9ada
Summary:
The Math Strikes Back
Several related things:
* When we specify `scale: 0;` style for some view it ends up with calling `CATransform3DScale` with zero scale parameter.
* In this case `CATransform3DScale` returns transform matrix full of zeros. It actually depends on representation and matrix-type (2d or 3d) but in UIView debugger it appears as [0, 0, 0, 0, ...]. And probably it is correct result.
* By default, for hit-testing, UIKit uses specially optimized logic based on GPU/CALayer infrastructure under the hood. And the transform matrix full of zeros breaks this algorithm. I guess, it happens because zero-matrix doesn't quite make sense.
So, `scale: 0;` is a weird edge case, and in this diff, we are trying to illuminate it by replacing with epsilon value.
Related SO issues:
http://stackoverflow.com/questions/25964224/cgaffinetransformscale-not-working-with-zero-scalehttp://stackoverflow.com/questions/7937369/animate-uiview-scale-to-zero
Reviewed By: blairvanderhoof
Differential Revision: D4734475
fbshipit-source-id: 7241cdffa86c05a6552860a25789e2281588ba23
Summary:
The `UIManager` already has a lot of responsibilities and is deeply
tied with React Native's view architecture. This diff separates out a
`DeviceInfo` native module to provide information about screen dimensions and
font scale, etc.
Reviewed By: fkgozali
Differential Revision: D4713834
fbshipit-source-id: f2ee93acf876a4221c29a8c731f5abeffbb97974
Summary:
If user slide picker when picker item is zero, `UIPickerViewDelegate` will call `pickerView:didSelectRow:inComponent` row=0, `_items[row][@"value"]` will crash.
Closes https://github.com/facebook/react-native/pull/12187
Differential Revision: D4709882
Pulled By: mkonicek
fbshipit-source-id: 772c819d4eaef41ac983287877bda2918f40b1a7
Summary:
The ReactCxx project was not updated when RCTMap was removed in 48f30eca7e, this fixes it. It was also missing the systemJSCWrapper.cpp file.
**Test plan**
Tested that UIExplorerCxx now builds
cc mkonicek
Closes https://github.com/facebook/react-native/pull/12919
Differential Revision: D4709498
Pulled By: mkonicek
fbshipit-source-id: 995a1a914ab0a3227b1219c575a84d136800ff19
Summary: Helps mitigate part of https://github.com/facebook/react-native/pull/12245 while we wait for a more comprehensive solution.
Reviewed By: emilsjolander
Differential Revision: D4571776
fbshipit-source-id: 185cd1b0d3af37724136a37471df412c2000dfe4
Summary:
**Motivation**: Fix Apple TV build breakage
**Test plan**: This fixes Travis test that builds tvOS targets.
Closes https://github.com/facebook/react-native/pull/12869
Differential Revision: D4692883
fbshipit-source-id: 3babfe4ab6d80143e15410bff7cae41ada3bf09f
Summary:
We use this version internally.
Closes https://github.com/facebook/react-native/pull/12838
Differential Revision: D4688982
Pulled By: mkonicek
fbshipit-source-id: d8a6f8168b9e71ff4f53a8c18d55dc5a759a9183
Summary:
Moving setting `availableSize` for `RCTRootShadowView` on earlier stage allows to prevent situations where `availableSize` is not specified yet, but Yoga layout is already happening.
Because `availableSize` equals {infinity, infinity} by default (in this case), Yoga returns a lot of nodes with infinit metrics, which confises UIKit.
Reviewed By: mmmulani
Differential Revision: D4672170
fbshipit-source-id: f9d8c84799dcbdb6b9230ddef6284d84df268833
Summary:
A related Android PR is #11008.
Font scale was exposed through:
- The `getContentSizeMultiplier` method
- The `didUpdateContentSizeMultiplier` event
These are now deprecated. The reason is that there was already an API that exposed font scale. However, it was Android only. We now expose font scale through that API on iOS as well. Specifically:
- Font scale is now available as `PixelRatio.getFontScale()`.
- The `change` event on the `Dimensions` object now fires when font scale changes.
This change also adds support for `Dimensions.get('screen')` on iOS. Previously, only `Dimensions.get('window')` was available on iOS. The motivation is that, [according to this comment](https://github.com/facebook/react-native/pull/11008#issuecomment-275123609), we'd like to deprecate `window` dimensions in favor of `screen` dimensions in the future.
**Test plan (required)**
Verified that `PixelRatio.getFontScale()` and the `change` event work properly in a test app.
Adam Comella
Microsoft Corp.
Closes https://github.com/facebook/react-native/pull/12268
Differential Revision: D4673642
Pulled By: mkonicek
fbshipit-source-id: 2602204da6998a96216e06f5321f28f6603e4972
Summary:
MapView has been deprecated in open source for a while: http://facebook.github.io/react-native/docs/mapview.html
We still want to use it internally. Moving it away from the GitHub folder.
Reviewed By: mmmulani
Differential Revision: D4646199
fbshipit-source-id: f469971e448dbca12afe141b43fa8a2518c7d467
Summary:
This prevents someone from only putting `RCT_EXPORT_METHOD(...)` around some of the arguments to a method and generally causing confusion. Yes, before this diff it would still compile correctly if you did something like:
```
RCT_EXPORT_METHOD(lol:(NSNumber *)lol)
blah:(id)blah
{
NSLog(@"%@ %@", lol, blah);
}
```
Reviewed By: fkgozali
Differential Revision: D4660019
fbshipit-source-id: 1829a47e5c8d5e8ce93edca2ac7efd7e2bfdf840
Summary:
Runs the `./ios-install-third-party.sh` script as part of the build process to avoid having to do it manually when building the cxx bridge with xcode. Also added the third-party dir to gitignore.
**Test plan**
Tested that just building works when the third-party dir is missing.
Closes https://github.com/facebook/react-native/pull/12694
Differential Revision: D4658165
Pulled By: ericvicenti
fbshipit-source-id: 9b51b88eb26637b19266bf85deafa41e3a77a645
Summary:
Remove the native iOS sticky headers implementation that has been replaced by the js Animated one. Also remove a line in JS that made sure we passed null to native so it did not use the native implementation.
**Test plan**
Made sure there were no more mentions of sticky / header in native ScrollView related code.
Tested that sticky headers still work :o
Closes https://github.com/facebook/react-native/pull/12696
Differential Revision: D4657391
Pulled By: ericvicenti
fbshipit-source-id: 16324a45ca4ce5cd143293c61394a0fa7ad0c4a1
Summary: RCTDevSettings incorrectly assigned "bad" executor-override class to the executor instead of checking if the class exists before assigning it. It should really check if the class exists, and fallback to defaults otherwise.
Reviewed By: mmmulani, yungsters
Differential Revision: D4655926
fbshipit-source-id: 48c8fe28f22aaa8430752411ce5e6e858dbd4b32