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.
You can learn more about contributing to React Native here: http://facebook.github.io/react-native/docs/contributing.html
Happy contributing!
-->
Fixes#16000
see [Issue #16000](https://github.com/facebook/react-native/issues/16000)
fix a null pointer exception while using higher version 'com.android.support:appcompat-v7'
N/A
[ANDROID][BUGFIX][Switch] - Fix NPE in Android Switch during measure
Closes https://github.com/facebook/react-native/pull/16064
Differential Revision: D6816122
Pulled By: hramos
fbshipit-source-id: ba9a6febad4884b8ab142d8c7142085367006904
Summary:
By default, when a react-native app launches in development mode on a physical iOS device, it attempts to load the JS bundle from a packager at `http://_your-local-ip-address_.xip.io:8081/`.
This change removes the use of `xip.io`, which changes that url to: `http://_your-local-ip-address_:8081/`
<!--
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!
-->
Background:
The automatic IP detection feature (introduced [here](https://github.com/facebook/react-native/pull/8091)) is super handy. However, it’s use of `xip.io` has caused myself and others much grief. Some routers do not allow or have intermittent errors when trying to resolve DNS names to local IP addresses. This prompted the introduction of a [DISABLE_XIP feature](https://github.com/facebook/react-native/pull/13326), which helps.
However, I don’t believe the use of `xip.io` is needed at all.
Based on [this comment](8c29a52c54 (commitcomment-18224788)), it appears the original reason for using `xip.io` was to “circumvent the numeric IP address limitation in ATS”.
But, the reason you can’t create ATS exceptions for raw IP addresses is that ATS is not enforced for raw IP addresses _at all_. You can read the Apple documentation [here](https://developer.apple.com/library/content/documentation/General/Reference/InfoPlistKeyReference/Articles/CocoaKeys.html), the relevant portion is:
> App Transport Security (ATS) applies only to connections made to public host names. The system does not provide ATS protection to connections made to:
> * Internet protocol (IP) addresses
> * Unqualified host names
> * Local hosts employing the .local top-level domain (TLD)
For example, in iOS, if you attempt to make an http request (note: _not_ https) to `http://www.google.com` you will get an error due to ATS.
However, you can make the same request to `http://172.217.6.14/` (which for me is the same server) and the request will succeed.
And in fact, if an ATS exception _was_ needed, the DISABLE_XIP feature shouldn’t work at all, but it does.
In short, using `xip.io` with ATS exceptions is unnecessary, causes some very annoying problems for some people, and I think it should just be removed.
Run the app on a physical iOS device and verify that it can load the JS bundle from the host computer's IP.
[Implemented automatic IP detection for iOS #8091](https://github.com/facebook/react-native/pull/8091)
[Added option to disable xip #13326](https://github.com/facebook/react-native/pull/13326)
<!--
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
-->
[INTERNAL] [BUGFIX] [./scripts] - Removed use of xip.io
Closes https://github.com/facebook/react-native/pull/17642
Differential Revision: D6814609
Pulled By: hramos
fbshipit-source-id: f2faebd6a29b0b211d78cdfe8e195906307ab552
Summary:
Now, in the new model, we transfer text attributes with actual text via attributed text to a native text component,
so previous text-only comparsion is not sufficient anymore.
Depends on D6600685.
Differential Revision: D6809833
fbshipit-source-id: 475b7426cf3c6694781790d99ef32466606da2f2
Summary: Releasing a new version of metro with an executable CLI
Reviewed By: davidaurelio
Differential Revision: D6808207
fbshipit-source-id: 68f6522924ea8ad7b6f9aaa3e952ebcf23d2cf8b
Summary:
This is a complete rewrite of RCTText, the part of React Native which manages Text and TextInput components.
Key points:
* It's understandable now. It follows a simple architectural pattern, and it's easy to debug and iterate. Text flow layout is a first-class citizen in React Native layout system now, not just a wired special case. It also brings entirely new possibilities such as nested interleaving <Text> and <View> components.
* All <Text>-specific APIs were removed from UIManager and co (it's about ~16 public methods which were used exclusively only by <Text>).
* It relies on new Yoga measurement/cloning API and on-dirty handler. So, it removes built-in dirty propagation subsystem from RN completely.
* It caches string fragments properly and granularly on a per-node basis which makes updating text-containing components more performant.
* It does not instantiate UIView for virtual components which reduces memory utilization.
* It drastically improves <TextInput> capabilities (e.g. rich text inside single line <TextInput> is now supported).
Screenshots:
https://cl.ly/2j3r1V0L0324https://cl.ly/3N2V3C3d3q3R
Reviewed By: mmmulani
Differential Revision: D6617326
fbshipit-source-id: 35d4d81b35c9870e9557d0211c0e934e6072a41e
Summary:
The showPopup method has an error callback. For some reason, it is asserting in case the wrong tagId is passed instead of calling the error callback on Android.
Pass not existing tagId to showPopup method and make sure it is receiving an error in js instead of crashing in native on Android.
[ANDROID] [MINOR] showPopup method calls error callback instead of crashing on errors.
Closes https://github.com/facebook/react-native/pull/17550
Differential Revision: D6776014
Pulled By: hramos
fbshipit-source-id: 1d97b762818d1591018fd43556eb41c3fb491eb9
Summary:
ClassCastException fix: getText() returns CharSequence not Spanned.
From the other hand, EditTexts getText method returns Editable which extends Spanned.
This commit fixes two similar bugs one in flat TextView and another in standard TextView.
Also, it removes redundant checks in the ReactEditText.
Application without this change sporadically crashes with the following stack trace:
```
java.lang.ClassCastException: java.lang.String cannot be cast to android.text.Spanned
at com.facebook.react.views.text.ReactTextView.reactTagForTouch(ReactTextView.java:195)
at com.facebook.react.uimanager.TouchTargetHelper.getTouchTargetForView(TouchTargetHelper.java:269)
at com.facebook.react.uimanager.TouchTargetHelper.findTargetTagAndCoordinatesForTouch$58866680(TouchTargetHelper.java:101)
at com.facebook.react.uimanager.JSTouchDispatcher.handleTouchEvent(JSTouchDispatcher.java:77)
at com.facebook.react.ReactRootView.dispatchJSTouchEvent(ReactRootView.java:151)
at com.facebook.react.ReactRootView.onInterceptTouchEvent(ReactRootView.java:127)
at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2110)
```
Closes https://github.com/facebook/react-native/pull/15452
Differential Revision: D6775986
Pulled By: hramos
fbshipit-source-id: 6de929937cbbb3e7bd98a708a40700f883cbaef0
Summary:
Originally added in #17551 by dryganets but lost when an internal diff consolidated files into ReactNative/DEFS
Closes https://github.com/facebook/react-native/pull/17710
Differential Revision: D6778242
Pulled By: hramos
fbshipit-source-id: 22bd3348feccf1ecb53d897c84e1ca704e51fc33
Summary:
Current setup prevents Android signal from being obtained when JavaScript environment is affected.
Proposed setup will configure Android build environment, surfacing any issues affecting Android even when a JavaScript bundle cannot be built.
We cannot proceed with unit tests and instrumentation tests if JavaScript is affected, but we will at least still get some signal from running BUCK.
Closes https://github.com/facebook/react-native/pull/17709
Differential Revision: D6775966
Pulled By: hramos
fbshipit-source-id: e50916c39060ed4e8ca880fcecc2830a51539bbd
Summary:
* remove redundant version code, name, miniSdk, targetSdk, they now are configed in build.gradle
* allowbackup = true is not a secure config
<!--
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!
-->
Clean up redundant config and remove security risk config.
test android template still works.
none
<!--
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
-->
Closes https://github.com/facebook/react-native/pull/17596
Differential Revision: D6768292
Pulled By: hramos
fbshipit-source-id: 9f32f17aebb9c1857d8b64d6687efe7c22e7bc79
Summary:
Builds off of cae7179c94
- Make the prop a dictionary for more configuration options
- Rename `maintainPositionAtOrBeyondIndex` -> `maintainVisibleContentPosition` + `minIndexForVisible`
- Add autoscroll threshold feature
Given the async native of RN JS and background layout, there is no way to trigger the scrollTo from JS without risking a delay, so we add the feature in native code.
== Test Plan ==
ScrollViewExample:
https://youtu.be/pmY8pxC9PRs
Reviewed By: shergin
Differential Revision: D6729160
fbshipit-source-id: 70f9bae460ce84567857a4f696da78ce9b3b834c
Summary:
Some of the classes of RCTText are now in the subfolders, this will fix pod integration for texts
<!--
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 have integrated React Native into my project with [this guide](https://facebook.github.io/react-native/docs/integration-with-existing-apps.html) and got the error `No component found for view with name RCTText`. Searching in the web did not give any useful information so I started to dig into the code and found out that there is now subfolders and pod taking only root classes. After making this change project started to compile again.
Create empty project with pods integrated add `RCTText` subspec and in `.js` file add some `<Text>` element
Fixed `RCTText` subspec integration.
Closes https://github.com/facebook/react-native/pull/17655
Differential Revision: D6751039
Pulled By: hramos
fbshipit-source-id: f4538d1125af2b45f36e2fa535382e032dbc8f4e