Skip to content

Commit 36d6b76

Browse files
authored
Merge pull request #1 from facebook/master
Updating
2 parents 8c9f190 + 857d2b8 commit 36d6b76

File tree

666 files changed

+10958
-15255
lines changed

Some content is hidden

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

666 files changed

+10958
-15255
lines changed

.eslintrc

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@
2121
"__fbBatchedBridgeConfig": false,
2222
"alert": false,
2323
"cancelAnimationFrame": false,
24+
"cancelIdleCallback": false,
2425
"clearImmediate": true,
2526
"clearInterval": false,
2627
"clearTimeout": false,
@@ -40,6 +41,7 @@
4041
"process": false,
4142
"Promise": true,
4243
"requestAnimationFrame": true,
44+
"requestIdleCallback": true,
4345
"require": false,
4446
"Set": true,
4547
"setImmediate": true,

.flowconfig

Lines changed: 20 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,21 @@
99
# Ignore malformed json
1010
.*/node_modules/y18n/test/.*\.json
1111

12+
# Ignore the website subdir
13+
<PROJECT_ROOT>/website/.*
14+
15+
# Ignore BUCK generated dirs
16+
<PROJECT_ROOT>/\.buckd/
17+
18+
# Ignore unexpected extra @providesModule
19+
.*/node_modules/commoner/test/source/widget/share.js
20+
21+
# Ignore duplicate module providers
22+
# For RN Apps installed via npm, "Libraries" folder is inside node_modules/react-native but in the source repo it is in the root
23+
.*/Libraries/react-native/React.js
24+
.*/Libraries/react-native/ReactNative.js
25+
.*/node_modules/jest-runtime/build/__tests__/.*
26+
1227
[include]
1328

1429
[libs]
@@ -32,9 +47,11 @@ suppress_type=$FlowIssue
3247
suppress_type=$FlowFixMe
3348
suppress_type=$FixMe
3449

35-
suppress_comment=\\(.\\|\n\\)*\\$FlowFixMe\\($\\|[^(]\\|(\\(>=0\\.\\(2[0-7]\\|1[0-9]\\|[0-9]\\).[0-9]\\)? *\\(site=[a-z,_]*react_native[a-z,_]*\\)?)\\)
36-
suppress_comment=\\(.\\|\n\\)*\\$FlowIssue\\((\\(>=0\\.\\(2[0-7]\\|1[0-9]\\|[0-9]\\).[0-9]\\)? *\\(site=[a-z,_]*react_native[a-z,_]*\\)?)\\)?:? #[0-9]+
50+
suppress_comment=\\(.\\|\n\\)*\\$FlowFixMe\\($\\|[^(]\\|(\\(>=0\\.\\(2[0-9]\\|1[0-9]\\|[0-9]\\).[0-9]\\)? *\\(site=[a-z,_]*react_native[a-z,_]*\\)?)\\)
51+
suppress_comment=\\(.\\|\n\\)*\\$FlowIssue\\((\\(>=0\\.\\(2[0-9]\\|1[0-9]\\|[0-9]\\).[0-9]\\)? *\\(site=[a-z,_]*react_native[a-z,_]*\\)?)\\)?:? #[0-9]+
3752
suppress_comment=\\(.\\|\n\\)*\\$FlowFixedInNextDeploy
3853

54+
unsafe.enable_getters_and_setters=true
55+
3956
[version]
40-
^0.27.0
57+
^0.29.0

.github/PULL_REQUEST_TEMPLATE.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
Thanks for submitting a pull request! Please provide enough information so that others can review your pull request:
22

3+
> **Unless you are a React Native release maintainer and cherry-picking an *existing* commit into a current release, ensure your pull request is targeting the `master` React Native branch.**
4+
35
(You can skip this if you're fixing a typo or adding an app to the Showcase.)
46

57
Explain the **motivation** for making this change. What existing problem does the pull request solve?

CONTRIBUTING.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ We will do our best to keep `master` in good shape, with tests passing at all ti
1414

1515
The core team will be monitoring for pull requests. When we get one, we'll run some Facebook-specific integration tests on it first. From here, we'll need to get another person to sign off on the changes and then merge the pull request. For API changes we may need to fix internal uses, which could cause some delay. We'll do our best to provide updates and feedback throughout the process.
1616

17-
Please submit your pull request on the *master* branch. If the fix is critical and should be included in a stable branch please mention it and it will be cherry picked into it.
17+
**Please submit your pull request on the `master` branch**. If the fix is critical and should be included in a stable branch please mention it and it will be cherry picked into it.
1818

1919
*Before* submitting a pull request, please make sure the following is done…
2020

@@ -101,7 +101,7 @@ Facebook has a [bounty program](https://www.facebook.com/whitehat/) for the safe
101101

102102
#### JSX
103103

104-
* Prefer `'` over `"` for string literal props
104+
* Prefer `"` over `'` for string literal props
105105
* When wrapping opening tags over multiple lines, place one prop per line
106106
* `{}` of props should hug their values (no spaces)
107107
* Place the closing `>` of opening tags on the same line as the last prop

Examples/2048/2048.xcodeproj/project.pbxproj

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -143,6 +143,7 @@
143143
13B07F871A680F5B00A75B9A /* Sources */,
144144
13B07F8C1A680F5B00A75B9A /* Frameworks */,
145145
13B07F8E1A680F5B00A75B9A /* Resources */,
146+
68ACCCD51D2BE2D2008E368A /* Run Script */,
146147
);
147148
buildRules = (
148149
);
@@ -230,6 +231,23 @@
230231
};
231232
/* End PBXResourcesBuildPhase section */
232233

234+
/* Begin PBXShellScriptBuildPhase section */
235+
68ACCCD51D2BE2D2008E368A /* Run Script */ = {
236+
isa = PBXShellScriptBuildPhase;
237+
buildActionMask = 2147483647;
238+
files = (
239+
);
240+
inputPaths = (
241+
);
242+
name = "Run Script";
243+
outputPaths = (
244+
);
245+
runOnlyForDeploymentPostprocessing = 0;
246+
shellPath = /bin/sh;
247+
shellScript = "export NODE_BINARY=node\n$SRCROOT/../../packager/react-native-xcode.sh Examples/2048/Game2048.js\n";
248+
};
249+
/* End PBXShellScriptBuildPhase section */
250+
233251
/* Begin PBXSourcesBuildPhase section */
234252
13B07F871A680F5B00A75B9A /* Sources */ = {
235253
isa = PBXSourcesBuildPhase;

Examples/2048/2048/AppDelegate.m

Lines changed: 2 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -14,41 +14,14 @@
1414

1515
#import "AppDelegate.h"
1616

17+
#import "RCTBundleURLProvider.h"
1718
#import "RCTRootView.h"
1819

1920
@implementation AppDelegate
2021

2122
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
2223
{
23-
NSURL *jsCodeLocation;
24-
25-
/**
26-
* Loading JavaScript code - uncomment the one you want.
27-
*
28-
* OPTION 1
29-
* Load from development server. Start the server from the repository root:
30-
*
31-
* $ npm start
32-
*
33-
* To run on device, change `localhost` to the IP address of your computer
34-
* (you can get this by typing `ifconfig` into the terminal and selecting the
35-
* `inet` value under `en0:`) and make sure your computer and iOS device are
36-
* on the same Wi-Fi network.
37-
*/
38-
39-
jsCodeLocation = [NSURL URLWithString:@"http://localhost:8081/Examples/2048/Game2048.bundle?platform=ios&dev=true"];
40-
41-
/**
42-
* OPTION 2
43-
* Load from pre-bundled file on disk. To re-generate the static bundle, `cd`
44-
* to your Xcode project folder in the terminal, and run
45-
*
46-
* $ curl 'http://localhost:8081/Examples/2048/Game2048.bundle?platform=ios' -o main.jsbundle
47-
*
48-
* then add the `main.jsbundle` file to your project and uncomment this line:
49-
*/
50-
51-
// jsCodeLocation = [[NSBundle mainBundle] URLForResource:@"main" withExtension:@"jsbundle"];
24+
NSURL *jsCodeLocation = [[RCTBundleURLProvider sharedSettings] jsBundleURLForBundleRoot:@"Examples/2048/Game2048" fallbackResource:nil];
5225

5326
RCTRootView *rootView = [[RCTRootView alloc] initWithBundleURL:jsCodeLocation
5427
moduleName:@"Game2048"

Examples/Movies/Movies.xcodeproj/project.pbxproj

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -200,6 +200,7 @@
200200
13B07F871A680F5B00A75B9A /* Sources */,
201201
13B07F8C1A680F5B00A75B9A /* Frameworks */,
202202
13B07F8E1A680F5B00A75B9A /* Resources */,
203+
68ACCCEE1D2BE57F008E368A /* ShellScript */,
203204
);
204205
buildRules = (
205206
);
@@ -320,6 +321,22 @@
320321
};
321322
/* End PBXResourcesBuildPhase section */
322323

324+
/* Begin PBXShellScriptBuildPhase section */
325+
68ACCCEE1D2BE57F008E368A /* ShellScript */ = {
326+
isa = PBXShellScriptBuildPhase;
327+
buildActionMask = 2147483647;
328+
files = (
329+
);
330+
inputPaths = (
331+
);
332+
outputPaths = (
333+
);
334+
runOnlyForDeploymentPostprocessing = 0;
335+
shellPath = /bin/sh;
336+
shellScript = "export NODE_BINARY=node\n$SRCROOT/../../packager/react-native-xcode.sh Examples/Movies/MoviesApp.ios.js\n";
337+
};
338+
/* End PBXShellScriptBuildPhase section */
339+
323340
/* Begin PBXSourcesBuildPhase section */
324341
13B07F871A680F5B00A75B9A /* Sources */ = {
325342
isa = PBXSourcesBuildPhase;

Examples/Movies/Movies/AppDelegate.m

Lines changed: 2 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -14,42 +14,15 @@
1414

1515
#import "AppDelegate.h"
1616

17+
#import "RCTBundleURLProvider.h"
1718
#import "RCTLinkingManager.h"
1819
#import "RCTRootView.h"
1920

2021
@implementation AppDelegate
2122

2223
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
2324
{
24-
NSURL *jsCodeLocation;
25-
26-
/**
27-
* Loading JavaScript code - uncomment the one you want.
28-
*
29-
* OPTION 1
30-
* Load from development server. Start the server from the repository root:
31-
*
32-
* $ npm start
33-
*
34-
* To run on device, change `localhost` to the IP address of your computer
35-
* (you can get this by typing `ifconfig` into the terminal and selecting the
36-
* `inet` value under `en0:`) and make sure your computer and iOS device are
37-
* on the same Wi-Fi network.
38-
*/
39-
40-
jsCodeLocation = [NSURL URLWithString:@"http://localhost:8081/Examples/Movies/MoviesApp.ios.bundle?platform=ios&dev=true"];
41-
42-
/**
43-
* OPTION 2
44-
* Load from pre-bundled file on disk. To re-generate the static bundle, `cd`
45-
* to your Xcode project folder in the terminal, and run
46-
*
47-
* $ curl 'http://localhost:8081/Examples/Movies/MoviesApp.ios.bundle?platform=ios&dev=true' -o main.jsbundle
48-
*
49-
* then add the `main.jsbundle` file to your project and uncomment this line:
50-
*/
51-
52-
// jsCodeLocation = [[NSBundle mainBundle] URLForResource:@"main" withExtension:@"jsbundle"];
25+
NSURL *jsCodeLocation = [[RCTBundleURLProvider sharedSettings] jsBundleURLForBundleRoot:@"Examples/Movies/MoviesApp.ios" fallbackResource:nil];
5326

5427
RCTRootView *rootView = [[RCTRootView alloc] initWithBundleURL:jsCodeLocation
5528
moduleName:@"MoviesApp"

Examples/TicTacToe/TicTacToe.xcodeproj/project.pbxproj

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -181,6 +181,7 @@
181181
13B07F871A680F5B00A75B9A /* Sources */,
182182
13B07F8C1A680F5B00A75B9A /* Frameworks */,
183183
13B07F8E1A680F5B00A75B9A /* Resources */,
184+
681C70ED1D2BE73C00E71791 /* ShellScript */,
184185
);
185186
buildRules = (
186187
);
@@ -290,6 +291,22 @@
290291
};
291292
/* End PBXResourcesBuildPhase section */
292293

294+
/* Begin PBXShellScriptBuildPhase section */
295+
681C70ED1D2BE73C00E71791 /* ShellScript */ = {
296+
isa = PBXShellScriptBuildPhase;
297+
buildActionMask = 2147483647;
298+
files = (
299+
);
300+
inputPaths = (
301+
);
302+
outputPaths = (
303+
);
304+
runOnlyForDeploymentPostprocessing = 0;
305+
shellPath = /bin/sh;
306+
shellScript = "export NODE_BINARY=node\n$SRCROOT/../../packager/react-native-xcode.sh Examples/TicTacToe/TicTacToeApp.js\n";
307+
};
308+
/* End PBXShellScriptBuildPhase section */
309+
293310
/* Begin PBXSourcesBuildPhase section */
294311
13B07F871A680F5B00A75B9A /* Sources */ = {
295312
isa = PBXSourcesBuildPhase;

Examples/TicTacToe/TicTacToe/AppDelegate.m

Lines changed: 2 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -14,41 +14,14 @@
1414

1515
#import "AppDelegate.h"
1616

17+
#import "RCTBundleURLProvider.h"
1718
#import "RCTRootView.h"
1819

1920
@implementation AppDelegate
2021

2122
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
2223
{
23-
NSURL *jsCodeLocation;
24-
25-
/**
26-
* Loading JavaScript code - uncomment the one you want.
27-
*
28-
* OPTION 1
29-
* Load from development server. Start the server from the repository root:
30-
*
31-
* $ npm start
32-
*
33-
* To run on device, change `localhost` to the IP address of your computer
34-
* (you can get this by typing `ifconfig` into the terminal and selecting the
35-
* `inet` value under `en0:`) and make sure your computer and iOS device are
36-
* on the same Wi-Fi network.
37-
*/
38-
39-
jsCodeLocation = [NSURL URLWithString:@"http://localhost:8081/Examples/TicTacToe/TicTacToeApp.bundle?platform=ios&dev=true"];
40-
41-
/**
42-
* OPTION 2
43-
* Load from pre-bundled file on disk. To re-generate the static bundle, `cd`
44-
* to your Xcode project folder in the terminal, and run
45-
*
46-
* $ curl 'http://localhost:8081/Examples/TicTacToe/TicTacToeApp.bundle?platform=ios' -o main.jsbundle
47-
*
48-
* then add the `main.jsbundle` file to your project and uncomment this line:
49-
*/
50-
51-
// jsCodeLocation = [[NSBundle mainBundle] URLForResource:@"main" withExtension:@"jsbundle"];
24+
NSURL *jsCodeLocation = [[RCTBundleURLProvider sharedSettings] jsBundleURLForBundleRoot:@"Examples/TicTacToe/TicTacToeApp" fallbackResource:nil];
5225

5326
RCTRootView *rootView = [[RCTRootView alloc] initWithBundleURL:jsCodeLocation
5427
moduleName:@"TicTacToeApp"

0 commit comments

Comments
 (0)