react-native/scripts
Job Vranish 40a8434bde Removed use of xip.io, as it's not needed.
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
2018-01-25 16:46:46 -08:00
..
versiontemplates Move JS-native version check to its own module + unit tests + prefix Obj-C macro w/RCT 2017-10-16 14:30:34 -07:00
android-e2e-test.js Remove references to Travis 2018-01-24 22:18:34 -08:00
bump-oss-version.js Fix broken releases script 2017-10-11 19:47:03 -07:00
circle-ci-android-setup.sh Migrate to Circle 2.0 2017-09-21 14:01:30 -07:00
ios-configure-glog.sh Removing test-driver symlink in ios third party install script 2017-06-21 07:45:37 -07:00
ios-install-third-party.sh Make ios-install-third-party.sh more robust 2017-09-28 13:03:26 -07:00
launchPackager.bat Update terminal title to 'Metro Bundler' 2018-01-07 22:22:45 -08:00
launchPackager.command Update terminal title to 'Metro Bundler' 2018-01-07 22:22:45 -08:00
objc-test-ios.sh Fix Travis podspec CI for Cxx bridge 2017-07-07 02:32:07 -07:00
objc-test-tvos.sh Fix Travis podspec CI for Cxx bridge 2017-07-07 02:32:07 -07:00
objc-test.sh Install watchman on Travis 2017-07-15 17:15:43 -07:00
packager.sh adds --port option to `react-native run-ios` as well as patches port … 2018-01-04 20:11:10 -08:00
process-podspecs.sh Fix Travis podspec CI for Cxx bridge 2017-07-07 02:32:07 -07:00
publish-npm.js Run eslint --fix 2017-10-09 17:46:44 -07:00
react-native-xcode.sh Removed use of xip.io, as it's not needed. 2018-01-25 16:46:46 -08:00
run-android-ci-instrumentation-tests.js Remove silly exit 2017-07-12 23:37:27 -07:00
run-android-emulator.sh Improve Android testing scripts 2016-12-13 17:13:35 -08:00
run-android-local-integration-tests.sh Skip flaky ScrollView tests 2017-03-13 13:30:31 -07:00
run-android-local-unit-tests.sh Improve Android testing scripts 2016-12-13 17:13:35 -08:00
run-ci-e2e-tests.js Migrate Travis over to Circle 2017-10-13 16:19:36 -07:00
run-instrumentation-tests-via-adb-shell.sh Fix Android comment and docblock typos 2017-12-03 20:16:36 -08:00
sync-css-layout.sh Rename directories 2016-12-07 05:14:12 -08:00
test-manual-e2e.sh Move HelloWorld template to a single index.js entry point 2017-08-03 14:02:43 -07:00
try-n-times.js RN: Cleanup OSS JS & Flow Declarations 2016-11-20 17:58:29 -08:00
validate-android-device-env.sh Improve Android testing scripts 2016-12-13 17:13:35 -08:00
validate-android-sdk.sh Improve Android testing scripts 2016-12-13 17:13:35 -08:00
validate-android-test-env.sh Add helpful examples to Android test env validation failure messages. 2017-10-12 15:33:04 -07:00