Skip to content

Commit d5d5152

Browse files
author
Michael S. Kazmier
committed
Merge branch 'iOS_packager_port' of https://github.com/DaKaZ/react-native into iOS_packager_port
2 parents a610332 + 6b11001 commit d5d5152

File tree

345 files changed

+43805
-11584
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

345 files changed

+43805
-11584
lines changed

.circleci/config.yml

Lines changed: 16 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -69,11 +69,11 @@ aliases:
6969

7070
- &restore-cache-buck
7171
keys:
72-
- v1-buck-{{ arch }}-v2017.09.04.02
72+
- v1-buck-{{ arch }}-v2017.11.16.01
7373
- &save-cache-buck
7474
paths:
7575
- ~/buck
76-
key: v1-buck-{{ arch }}-v2017.09.04.02
76+
key: v1-buck-{{ arch }}-v2017.11.16.01
7777

7878
- &restore-cache-watchman
7979
keys:
@@ -239,17 +239,22 @@ jobs:
239239
command: |
240240
cd website
241241
npm install --no-package-lock --no-spin --no-progress
242+
# The CIRCLE_PROJECT_USERNAME and CIRCLE_PR_USERNAME checks below
243+
# ensure deploys only happen on projects owned by "facebook",
244+
# never on a forked PR build.
242245
- run:
243246
name: Build and Deploy Static Website
244247
command: |
245-
if [[ $CIRCLE_PROJECT_USERNAME == "facebook" && -z $CI_PULL_REQUEST && -z $CIRCLE_PR_USERNAME ]]; then
248+
if [[ $CIRCLE_PROJECT_USERNAME == "facebook" && -z $CIRCLE_PR_USERNAME ]]; then
246249
git config --global user.email "[email protected]"
247250
git config --global user.name "Website Deployment Script"
248251
echo "machine github.com login reactjs-bot password $GITHUB_TOKEN" > ~/.netrc
249252
echo "Deploying website..."
250253
cd website && GIT_USER=reactjs-bot npm run gh-pages
254+
elif [[ -n $CIRCLE_PR_USERNAME ]]; then
255+
echo "Skipping website deploy, this is a forked PR build."
251256
else
252-
echo "Skipping deploy."
257+
echo "Skipping website deploy."
253258
fi
254259
255260
# Build JavaScript bundle for Android tests
@@ -329,7 +334,7 @@ jobs:
329334
name: Install Buck
330335
command: |
331336
if [[ ! -e ~/buck ]]; then
332-
git clone https://github.com/facebook/buck.git ~/buck --branch v2017.09.04.02 --depth=1
337+
git clone https://github.com/facebook/buck.git ~/buck --branch v2017.11.16.01 --depth=1
333338
fi
334339
cd ~/buck && ant
335340
buck --version
@@ -438,10 +443,12 @@ jobs:
438443
- checkout
439444
- restore-cache: *restore-cache-analysis
440445
- run: *install-node-dependencies
446+
# The CIRCLE_PR_NUMBER checks below ensure
447+
# code analysis only runs on forked PR builds.
441448
- run:
442449
name: Install Dependencies
443450
command: |
444-
if [ -n "$CIRCLE_PULL_REQUEST" ]; then
451+
if [ -n "$CIRCLE_PR_NUMBER" ]; then
445452
npm install [email protected]
446453
cd danger
447454
npm install --no-package-lock --no-spin --no-progress
@@ -453,17 +460,17 @@ jobs:
453460
- run:
454461
name: Analyze Pull Request
455462
command: |
456-
if [ -n "$CIRCLE_PULL_REQUEST" ]; then
463+
if [ -n "$CIRCLE_PR_NUMBER" ]; then
457464
cd danger && DANGER_GITHUB_API_TOKEN="e622517d9f1136ea8900""07c6373666312cdfaa69" npm run danger
458465
else
459466
echo "Skipping pull request analysis."
460467
fi
461468
when: always
462-
# Run eslint
469+
# Run eslint
463470
- run:
464471
name: Analyze Code
465472
command: |
466-
if [ -n "$CIRCLE_PULL_REQUEST" ]; then
473+
if [ -n "$CIRCLE_PR_NUMBER" && -n "$CIRCLE_PROJECT_USERNAME" && -n "$CIRCLE_PROJECT_REPONAME" ]; then
467474
cat <(echo eslint; npm run lint --silent -- --format=json; echo flow; npm run flow --silent -- check --json) | GITHUB_TOKEN="af6ef0d15709bc91d""06a6217a5a826a226fb57b7" CI_USER=$CIRCLE_PROJECT_USERNAME CI_REPO=$CIRCLE_PROJECT_REPONAME PULL_REQUEST_NUMBER=$CIRCLE_PR_NUMBER node bots/code-analysis-bot.js
468475
else
469476
echo "Skipping code analysis."

.flowconfig

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -46,12 +46,12 @@ suppress_type=$FlowFixMeProps
4646
suppress_type=$FlowFixMeState
4747
suppress_type=$FixMe
4848

49-
suppress_comment=\\(.\\|\n\\)*\\$FlowFixMe\\($\\|[^(]\\|(\\(>=0\\.\\(5[0-8]\\|[1-4][0-9]\\|[0-9]\\).[0-9]\\)? *\\(site=[a-z,_]*[react_native_oss|react_native_fb][a-z,_]*\\)?)\\)
50-
suppress_comment=\\(.\\|\n\\)*\\$FlowIssue\\((\\(>=0\\.\\(5[0-8]\\|[1-4][0-9]\\|[0-9]\\).[0-9]\\)? *\\(site=[a-z,_]*[react_native_oss|react_native_fb][a-z,_]*\\)?)\\)?:? #[0-9]+
49+
suppress_comment=\\(.\\|\n\\)*\\$FlowFixMe\\($\\|[^(]\\|(\\(>=0\\.\\(5[0-9]\\|[1-4][0-9]\\|[0-9]\\).[0-9]\\)? *\\(site=[a-z,_]*[react_native_oss|react_native_fb][a-z,_]*\\)?)\\)
50+
suppress_comment=\\(.\\|\n\\)*\\$FlowIssue\\((\\(>=0\\.\\(5[0-9]\\|[1-4][0-9]\\|[0-9]\\).[0-9]\\)? *\\(site=[a-z,_]*[react_native_oss|react_native_fb][a-z,_]*\\)?)\\)?:? #[0-9]+
5151
suppress_comment=\\(.\\|\n\\)*\\$FlowFixedInNextDeploy
5252
suppress_comment=\\(.\\|\n\\)*\\$FlowExpectedError
5353

5454
unsafe.enable_getters_and_setters=true
5555

5656
[version]
57-
^0.58.0
57+
^0.59.0

.github/PULL_REQUEST_TEMPLATE.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ Help reviewers and the release process by writing your own release notes
2727
[----------] TYPE
2828
[ CLI ] [-------------] LOCATION
2929
[ DOCS ] [ BREAKING ] [-------------]
30-
[ GENERAl ] [ BUGFIX ] [-{Component}-]
30+
[ GENERAL ] [ BUGFIX ] [-{Component}-]
3131
[ INTERNAL ] [ ENHANCEMENT ] [ {File} ]
3232
[ IOS ] [ FEATURE ] [ {Directory} ] |-----------|
3333
[ ANDROID ] [ MINOR ] [ {Framework} ] - | {Message} |

CONTRIBUTING.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -96,11 +96,11 @@ Please make sure the following is done when submitting a pull request:
9696

9797
1. Fork [the repository](https://github.com/facebook/react-native) and create your branch from `master`.
9898
2. Add the copyright notice to the top of any new files you've added.
99-
3. Describe your [**test plan**](/react-native/docs/contributing.html#test-plan) in your pull request description. Make sure to [test your changes](/react-native/docs/testing.html)!
99+
3. Describe your [**test plan**](https://facebook.github.io/react-native/docs/contributing.html#test-plan) in your pull request description. Make sure to [test your changes](https://facebook.github.io/react-native/docs/testing.html)!
100100
4. Make sure your code lints (`npm run lint`).
101101
5. If you haven't already, [sign the CLA](https://code.facebook.com/cla).
102102

103-
All pull requests should be opened against the `master` branch. After opening your pull request, ensure [**all tests pass**](/react-native/docs/contributing.html#contrinuous-integration-tests) on Circle CI. If a test fails and you believe it is unrelated to your change, leave a comment on the pull request explaining why.
103+
All pull requests should be opened against the `master` branch. After opening your pull request, ensure [**all tests pass**](https://facebook.github.io/react-native/docs/contributing.html#contrinuous-integration-tests) on Circle CI. If a test fails and you believe it is unrelated to your change, leave a comment on the pull request explaining why.
104104

105105
> **Note:** It is not necessary to keep clicking `Merge master to your branch` on the PR page. You would want to merge master if there are conflicts or tests are failing. The Facebook-GitHub-Bot ultimately squashes all commits to a single one before merging your PR.
106106
@@ -116,7 +116,7 @@ See [What is a Test Plan?](https://medium.com/@martinkonicek/what-is-a-test-plan
116116

117117
#### Continuous integration tests
118118

119-
Make sure all **tests pass** on [Circle CI][circle]. PRs that break tests are unlikely to be merged. Learn more about [testing your changes here](/react-native/docs/testing.html).
119+
Make sure all **tests pass** on [Circle CI][circle]. PRs that break tests are unlikely to be merged. Learn more about [testing your changes here](https://facebook.github.io/react-native/docs/testing.html).
120120

121121
[circle]: http://circleci.com/gh/facebook/react-native
122122

Libraries/ActionSheetIOS/ActionSheetIOS.js

Lines changed: 16 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -16,33 +16,27 @@ var RCTActionSheetManager = require('NativeModules').ActionSheetManager;
1616
var invariant = require('fbjs/lib/invariant');
1717
var processColor = require('processColor');
1818

19+
/**
20+
* Display action sheets and share sheets on iOS.
21+
*
22+
* See http://facebook.github.io/react-native/docs/actionsheetios.html
23+
*/
1924
var ActionSheetIOS = {
2025
/**
21-
* Display an iOS action sheet. The `options` object must contain one or more
22-
* of:
23-
*
26+
* Display an iOS action sheet.
27+
*
28+
* The `options` object must contain one or more of:
29+
*
2430
* - `options` (array of strings) - a list of button titles (required)
2531
* - `cancelButtonIndex` (int) - index of cancel button in `options`
2632
* - `destructiveButtonIndex` (int) - index of destructive button in `options`
2733
* - `title` (string) - a title to show above the action sheet
2834
* - `message` (string) - a message to show below the title
29-
*
35+
*
3036
* The 'callback' function takes one parameter, the zero-based index
3137
* of the selected item.
32-
*
33-
* Minimal example:
3438
*
35-
* ```
36-
* ActionSheetIOS.showActionSheetWithOptions({
37-
* options: ['Remove', 'Cancel'],
38-
* destructiveButtonIndex: 1,
39-
* cancelButtonIndex: 0,
40-
* },
41-
* (buttonIndex) => {
42-
* if (buttonIndex === 1) { // destructive action }
43-
* });
44-
* ```
45-
*
39+
* See http://facebook.github.io/react-native/docs/actionsheetios.html#showactionsheetwithoptions
4640
*/
4741
showActionSheetWithOptions(options: Object, callback: Function) {
4842
invariant(
@@ -67,11 +61,9 @@ var ActionSheetIOS = {
6761
* - `url` (string) - a URL to share
6862
* - `message` (string) - a message to share
6963
* - `subject` (string) - a subject for the message
70-
* - `excludedActivityTypes` (array) - the activities to exclude from the ActionSheet
71-
*
72-
* NOTE: if `url` points to a local file, or is a base64-encoded
73-
* uri, the file it points to will be loaded and shared directly.
74-
* In this way, you can share images, videos, PDF files, etc.
64+
* - `excludedActivityTypes` (array) - the activities to exclude from
65+
* the ActionSheet
66+
* - `tintColor` (color) - tint color of the buttons
7567
*
7668
* The 'failureCallback' function takes one parameter, an error object.
7769
* The only property defined on this object is an optional `stack` property
@@ -81,6 +73,8 @@ var ActionSheetIOS = {
8173
*
8274
* - a boolean value signifying success or failure
8375
* - a string that, in the case of success, indicates the method of sharing
76+
*
77+
* See http://facebook.github.io/react-native/docs/actionsheetios.html#showshareactionsheetwithoptions
8478
*/
8579
showShareActionSheetWithOptions(
8680
options: Object,

Libraries/Alert/Alert.js

Lines changed: 7 additions & 45 deletions
Original file line numberDiff line numberDiff line change
@@ -30,54 +30,16 @@ type Options = {
3030

3131
/**
3232
* Launches an alert dialog with the specified title and message.
33-
*
34-
* Optionally provide a list of buttons. Tapping any button will fire the
35-
* respective onPress callback and dismiss the alert. By default, the only
36-
* button will be an 'OK' button.
37-
*
38-
* This is an API that works both on iOS and Android and can show static
39-
* alerts. To show an alert that prompts the user to enter some information,
40-
* see `AlertIOS`; entering text in an alert is common on iOS only.
41-
*
42-
* ## iOS
43-
*
44-
* On iOS you can specify any number of buttons. Each button can optionally
45-
* specify a style, which is one of 'default', 'cancel' or 'destructive'.
46-
*
47-
* ## Android
48-
*
49-
* On Android at most three buttons can be specified. Android has a concept
50-
* of a neutral, negative and a positive button:
51-
*
52-
* - If you specify one button, it will be the 'positive' one (such as 'OK')
53-
* - Two buttons mean 'negative', 'positive' (such as 'Cancel', 'OK')
54-
* - Three buttons mean 'neutral', 'negative', 'positive' (such as 'Later', 'Cancel', 'OK')
55-
*
56-
* By default alerts on Android can be dismissed by tapping outside of the alert
57-
* box. This event can be handled by providing an optional `options` parameter,
58-
* with an `onDismiss` callback property `{ onDismiss: () => {} }`.
59-
*
60-
* Alternatively, the dismissing behavior can be disabled altogether by providing
61-
* an optional `options` parameter with the `cancelable` property set to `false`
62-
* i.e. `{ cancelable: false }`
63-
*
64-
* Example usage:
65-
* ```
66-
* // Works on both iOS and Android
67-
* Alert.alert(
68-
* 'Alert Title',
69-
* 'My Alert Msg',
70-
* [
71-
* {text: 'Ask me later', onPress: () => console.log('Ask me later pressed')},
72-
* {text: 'Cancel', onPress: () => console.log('Cancel Pressed'), style: 'cancel'},
73-
* {text: 'OK', onPress: () => console.log('OK Pressed')},
74-
* ],
75-
* { cancelable: false }
76-
* )
77-
* ```
33+
*
34+
* See http://facebook.github.io/react-native/docs/alert.html
7835
*/
7936
class Alert {
8037

38+
/**
39+
* Launches an alert dialog with the specified title and message.
40+
*
41+
* See http://facebook.github.io/react-native/docs/alert.html#alert
42+
*/
8143
static alert(
8244
title: ?string,
8345
message?: ?string,

Libraries/Alert/AlertIOS.js

Lines changed: 5 additions & 90 deletions
Original file line numberDiff line numberDiff line change
@@ -77,60 +77,15 @@ export type ButtonsArray = Array<{
7777
}>;
7878

7979
/**
80-
* @description
81-
* `AlertIOS` provides functionality to create an iOS alert dialog with a
82-
* message or create a prompt for user input.
83-
*
84-
* Creating an iOS alert:
85-
*
86-
* ```
87-
* AlertIOS.alert(
88-
* 'Sync Complete',
89-
* 'All your data are belong to us.'
90-
* );
91-
* ```
92-
*
93-
* Creating an iOS prompt:
94-
*
95-
* ```
96-
* AlertIOS.prompt(
97-
* 'Enter a value',
98-
* null,
99-
* text => console.log("You entered "+text)
100-
* );
101-
* ```
102-
*
103-
* We recommend using the [`Alert.alert`](docs/alert.html) method for
104-
* cross-platform support if you don't need to create iOS-only prompts.
80+
* Use `AlertIOS` to display an alert dialog with a message or to create a prompt for user input on iOS. If you don't need to prompt for user input, we recommend using `Alert.alert() for cross-platform support.
10581
*
82+
* See http://facebook.github.io/react-native/docs/alertios.html
10683
*/
10784
class AlertIOS {
10885
/**
10986
* Create and display a popup alert.
110-
* @static
111-
* @method alert
112-
* @param title The dialog's title. Passing null or '' will hide the title.
113-
* @param message An optional message that appears below
114-
* the dialog's title.
115-
* @param callbackOrButtons This optional argument should
116-
* be either a single-argument function or an array of buttons. If passed
117-
* a function, it will be called when the user taps 'OK'.
118-
*
119-
* If passed an array of button configurations, each button should include
120-
* a `text` key, as well as optional `onPress` and `style` keys. `style`
121-
* should be one of 'default', 'cancel' or 'destructive'.
122-
* @param type Deprecated, do not use.
12387
*
124-
* @example <caption>Example with custom buttons</caption>
125-
*
126-
* AlertIOS.alert(
127-
* 'Update available',
128-
* 'Keep your app up to date to enjoy the latest features',
129-
* [
130-
* {text: 'Cancel', onPress: () => console.log('Cancel Pressed'), style: 'cancel'},
131-
* {text: 'Install', onPress: () => console.log('Install Pressed')},
132-
* ],
133-
* );
88+
* See http://facebook.github.io/react-native/docs/alertios.html#alert
13489
*/
13590
static alert(
13691
title: ?string,
@@ -148,48 +103,8 @@ class AlertIOS {
148103

149104
/**
150105
* Create and display a prompt to enter some text.
151-
* @static
152-
* @method prompt
153-
* @param title The dialog's title.
154-
* @param message An optional message that appears above the text
155-
* input.
156-
* @param callbackOrButtons This optional argument should
157-
* be either a single-argument function or an array of buttons. If passed
158-
* a function, it will be called with the prompt's value when the user
159-
* taps 'OK'.
160-
*
161-
* If passed an array of button configurations, each button should include
162-
* a `text` key, as well as optional `onPress` and `style` keys (see
163-
* example). `style` should be one of 'default', 'cancel' or 'destructive'.
164-
* @param type This configures the text input. One of 'plain-text',
165-
* 'secure-text' or 'login-password'.
166-
* @param defaultValue The default text in text input.
167-
* @param keyboardType The keyboard type of first text field(if exists).
168-
* One of 'default', 'email-address', 'numeric', 'phone-pad',
169-
* 'ascii-capable', 'numbers-and-punctuation', 'url', 'number-pad',
170-
* 'name-phone-pad', 'decimal-pad', 'twitter' or 'web-search'.
171-
*
172-
* @example <caption>Example with custom buttons</caption>
173-
*
174-
* AlertIOS.prompt(
175-
* 'Enter password',
176-
* 'Enter your password to claim your $1.5B in lottery winnings',
177-
* [
178-
* {text: 'Cancel', onPress: () => console.log('Cancel Pressed'), style: 'cancel'},
179-
* {text: 'OK', onPress: password => console.log('OK Pressed, password: ' + password)},
180-
* ],
181-
* 'secure-text'
182-
* );
183-
*
184-
* @example <caption>Example with the default button and a custom callback</caption>
185-
*
186-
* AlertIOS.prompt(
187-
* 'Update username',
188-
* null,
189-
* text => console.log("Your username is "+text),
190-
* null,
191-
* 'default'
192-
* );
106+
*
107+
* See http://facebook.github.io/react-native/docs/alertios.html#prompt
193108
*/
194109
static prompt(
195110
title: ?string,

0 commit comments

Comments
 (0)