Skip to content

Commit cad5cde

Browse files
committed
Updates from Wed 6 May
2 parents 4eece85 + ee44930 commit cad5cde

19 files changed

Lines changed: 270 additions & 145 deletions

File tree

Examples/SampleApp/SampleApp.xcodeproj/project.pbxproj

Lines changed: 32 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@
1717
00C302EA1ABCBA2D00DB3ED1 /* libRCTVibration.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 00C302E41ABCB9EE00DB3ED1 /* libRCTVibration.a */; };
1818
00E356F31AD99517003FC87E /* SampleAppTests.m in Sources */ = {isa = PBXBuildFile; fileRef = 00E356F21AD99517003FC87E /* SampleAppTests.m */; };
1919
133E29F31AD74F7200F7D852 /* libRCTLinking.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 78C398B91ACF4ADC00677621 /* libRCTLinking.a */; };
20+
139105C61AF99C1200B5F7CC /* libRCTSettings.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 139105C11AF99BAD00B5F7CC /* libRCTSettings.a */; };
2021
13B07FBC1A68108700A75B9A /* AppDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = 13B07FB01A68108700A75B9A /* AppDelegate.m */; };
2122
13B07FBD1A68108700A75B9A /* LaunchScreen.xib in Resources */ = {isa = PBXBuildFile; fileRef = 13B07FB11A68108700A75B9A /* LaunchScreen.xib */; };
2223
13B07FBF1A68108700A75B9A /* Images.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 13B07FB51A68108700A75B9A /* Images.xcassets */; };
@@ -82,6 +83,13 @@
8283
remoteGlobalIDString = 13B07F861A680F5B00A75B9A;
8384
remoteInfo = SampleApp;
8485
};
86+
139105C01AF99BAD00B5F7CC /* PBXContainerItemProxy */ = {
87+
isa = PBXContainerItemProxy;
88+
containerPortal = 139105B61AF99BAD00B5F7CC /* RCTSettings.xcodeproj */;
89+
proxyType = 2;
90+
remoteGlobalIDString = 134814201AA4EA6300B7C361;
91+
remoteInfo = RCTSettings;
92+
};
8593
146834031AC3E56700842450 /* PBXContainerItemProxy */ = {
8694
isa = PBXContainerItemProxy;
8795
containerPortal = 146833FF1AC3E56700842450 /* React.xcodeproj */;
@@ -117,6 +125,7 @@
117125
00E356EE1AD99517003FC87E /* SampleAppTests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = SampleAppTests.xctest; sourceTree = BUILT_PRODUCTS_DIR; };
118126
00E356F11AD99517003FC87E /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = "<group>"; };
119127
00E356F21AD99517003FC87E /* SampleAppTests.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = SampleAppTests.m; sourceTree = "<group>"; };
128+
139105B61AF99BAD00B5F7CC /* RCTSettings.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = RCTSettings.xcodeproj; path = ../../Libraries/Settings/RCTSettings.xcodeproj; sourceTree = "<group>"; };
120129
13B07F961A680F5B00A75B9A /* SampleApp.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = SampleApp.app; sourceTree = BUILT_PRODUCTS_DIR; };
121130
13B07FAF1A68108700A75B9A /* AppDelegate.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = AppDelegate.h; path = iOS/AppDelegate.h; sourceTree = "<group>"; };
122131
13B07FB01A68108700A75B9A /* AppDelegate.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = AppDelegate.m; path = iOS/AppDelegate.m; sourceTree = "<group>"; };
@@ -142,6 +151,7 @@
142151
buildActionMask = 2147483647;
143152
files = (
144153
146834051AC3E58100842450 /* libReact.a in Frameworks */,
154+
139105C61AF99C1200B5F7CC /* libRCTSettings.a in Frameworks */,
145155
00481BE81AC0C86700671115 /* libRCTWebSocketDebugger.a in Frameworks */,
146156
00C302E51ABCBA2D00DB3ED1 /* libRCTActionSheet.a in Frameworks */,
147157
00C302E61ABCBA2D00DB3ED1 /* libRCTAdSupport.a in Frameworks */,
@@ -230,6 +240,14 @@
230240
name = "Supporting Files";
231241
sourceTree = "<group>";
232242
};
243+
139105B71AF99BAD00B5F7CC /* Products */ = {
244+
isa = PBXGroup;
245+
children = (
246+
139105C11AF99BAD00B5F7CC /* libRCTSettings.a */,
247+
);
248+
name = Products;
249+
sourceTree = "<group>";
250+
};
233251
13B07FAE1A68108700A75B9A /* SampleApp */ = {
234252
isa = PBXGroup;
235253
children = (
@@ -263,14 +281,15 @@
263281
832341AE1AAA6A7D00B99B32 /* Libraries */ = {
264282
isa = PBXGroup;
265283
children = (
266-
78C398B01ACF4ADC00677621 /* RCTLinking.xcodeproj */,
267284
146833FF1AC3E56700842450 /* React.xcodeproj */,
268-
832341B01AAA6A8300B99B32 /* RCTText.xcodeproj */,
269285
00C302A71ABCB8CE00DB3ED1 /* RCTActionSheet.xcodeproj */,
270286
00C302AF1ABCB8E700DB3ED1 /* RCTAdSupport.xcodeproj */,
271287
00C302B51ABCB90400DB3ED1 /* RCTGeolocation.xcodeproj */,
272288
00C302BB1ABCB91800DB3ED1 /* RCTImage.xcodeproj */,
289+
78C398B01ACF4ADC00677621 /* RCTLinking.xcodeproj */,
273290
00C302D31ABCB9D200DB3ED1 /* RCTNetwork.xcodeproj */,
291+
139105B61AF99BAD00B5F7CC /* RCTSettings.xcodeproj */,
292+
832341B01AAA6A8300B99B32 /* RCTText.xcodeproj */,
274293
00C302DF1ABCB9EE00DB3ED1 /* RCTVibration.xcodeproj */,
275294
00481BDB1AC0C7FA00671115 /* RCTWebSocketDebugger.xcodeproj */,
276295
);
@@ -395,6 +414,10 @@
395414
ProductGroup = 00C302D41ABCB9D200DB3ED1 /* Products */;
396415
ProjectRef = 00C302D31ABCB9D200DB3ED1 /* RCTNetwork.xcodeproj */;
397416
},
417+
{
418+
ProductGroup = 139105B71AF99BAD00B5F7CC /* Products */;
419+
ProjectRef = 139105B61AF99BAD00B5F7CC /* RCTSettings.xcodeproj */;
420+
},
398421
{
399422
ProductGroup = 832341B11AAA6A8300B99B32 /* Products */;
400423
ProjectRef = 832341B01AAA6A8300B99B32 /* RCTText.xcodeproj */;
@@ -470,6 +493,13 @@
470493
remoteRef = 00C302E31ABCB9EE00DB3ED1 /* PBXContainerItemProxy */;
471494
sourceTree = BUILT_PRODUCTS_DIR;
472495
};
496+
139105C11AF99BAD00B5F7CC /* libRCTSettings.a */ = {
497+
isa = PBXReferenceProxy;
498+
fileType = archive.ar;
499+
path = libRCTSettings.a;
500+
remoteRef = 139105C01AF99BAD00B5F7CC /* PBXContainerItemProxy */;
501+
sourceTree = BUILT_PRODUCTS_DIR;
502+
};
473503
146834041AC3E56700842450 /* libReact.a */ = {
474504
isa = PBXReferenceProxy;
475505
fileType = archive.ar;

Examples/SampleApp/index.ios.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ var SampleApp = React.createClass({
2424
</Text>
2525
<Text style={styles.instructions}>
2626
Press Cmd+R to reload,{'\n'}
27-
Cmd+Control+Z for dev menu
27+
Cmd+D or shake for dev menu
2828
</Text>
2929
</View>
3030
);

Libraries/Components/View/ViewStylePropTypes.js

Lines changed: 2 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -13,12 +13,14 @@
1313

1414
var LayoutPropTypes = require('LayoutPropTypes');
1515
var ReactPropTypes = require('ReactPropTypes');
16+
var TransformPropTypes = require('TransformPropTypes');
1617

1718
/**
1819
* Warning: Some of these properties may not be supported in all releases.
1920
*/
2021
var ViewStylePropTypes = {
2122
...LayoutPropTypes,
23+
...TransformPropTypes,
2224
backgroundColor: ReactPropTypes.string,
2325
borderColor: ReactPropTypes.string,
2426
borderTopColor: ReactPropTypes.string,
@@ -34,15 +36,6 @@ var ViewStylePropTypes = {
3436
),
3537
shadowOpacity: ReactPropTypes.number,
3638
shadowRadius: ReactPropTypes.number,
37-
transform: ReactPropTypes.arrayOf(ReactPropTypes.object),
38-
transformMatrix: ReactPropTypes.arrayOf(ReactPropTypes.number),
39-
40-
// DEPRECATED
41-
rotation: ReactPropTypes.number,
42-
scaleX: ReactPropTypes.number,
43-
scaleY: ReactPropTypes.number,
44-
translateX: ReactPropTypes.number,
45-
translateY: ReactPropTypes.number,
4639
};
4740

4841
module.exports = ViewStylePropTypes;

Libraries/CustomComponents/Navigator/Navigator.js

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -227,15 +227,17 @@ var Navigator = React.createClass({
227227
renderScene: PropTypes.func.isRequired,
228228

229229
/**
230-
* Provide a single "route" to start on. A route is an arbitrary object
231-
* that the navigator will use to identify each scene before rendering.
232-
* Either initialRoute or initialRouteStack is required.
230+
* Specify a route to start on. A route is an object that the navigator
231+
* will use to identify each scene to render. `initialRoute` must be
232+
* a route in the `initialRouteStack` if both props are provided. The
233+
* `initialRoute` will default to the last item in the `initialRouteStack`.
233234
*/
234235
initialRoute: PropTypes.object,
235236

236237
/**
237-
* Provide a set of routes to initially mount the scenes for. Required if no
238-
* initialRoute is provided
238+
* Provide a set of routes to initially mount. Required if no initialRoute
239+
* is provided. Otherwise, it will default to an array containing only the
240+
* `initialRoute`
239241
*/
240242
initialRouteStack: PropTypes.arrayOf(PropTypes.object),
241243

@@ -295,21 +297,18 @@ var Navigator = React.createClass({
295297
},
296298

297299
getInitialState: function() {
298-
var routeStack = this.props.initialRouteStack || [];
299-
var initialRouteIndex = 0;
300-
if (this.props.initialRoute && routeStack.length) {
300+
var routeStack = this.props.initialRouteStack || [this.props.initialRoute];
301+
invariant(
302+
routeStack.length >= 1,
303+
'Navigator requires props.initialRoute or props.initialRouteStack.'
304+
);
305+
var initialRouteIndex = routeStack.length - 1;
306+
if (this.props.initialRoute) {
301307
initialRouteIndex = routeStack.indexOf(this.props.initialRoute);
302308
invariant(
303309
initialRouteIndex !== -1,
304310
'initialRoute is not in initialRouteStack.'
305311
);
306-
} else if (this.props.initialRoute) {
307-
routeStack = [this.props.initialRoute];
308-
} else {
309-
invariant(
310-
routeStack.length >= 1,
311-
'Navigator requires props.initialRoute or props.initialRouteStack.'
312-
);
313312
}
314313
return {
315314
sceneConfigStack: routeStack.map(
@@ -689,7 +688,8 @@ var Navigator = React.createClass({
689688
var enabledSceneNativeProps = {
690689
left: sceneStyle.left,
691690
};
692-
if (sceneIndex !== this.state.transitionFromIndex) {
691+
if (sceneIndex !== this.state.transitionFromIndex &&
692+
sceneIndex !== this.state.presentedIndex) {
693693
// If we are not in a transition from this index, make sure opacity is 0
694694
// to prevent the enabled scene from flashing over the presented scene
695695
enabledSceneNativeProps.opacity = 0;

Libraries/Image/ImageStylePropTypes.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,9 +14,11 @@
1414
var ImageResizeMode = require('ImageResizeMode');
1515
var LayoutPropTypes = require('LayoutPropTypes');
1616
var ReactPropTypes = require('ReactPropTypes');
17+
var TransformPropTypes = require('TransformPropTypes');
1718

1819
var ImageStylePropTypes = {
1920
...LayoutPropTypes,
21+
...TransformPropTypes,
2022
resizeMode: ReactPropTypes.oneOf(Object.keys(ImageResizeMode)),
2123
backgroundColor: ReactPropTypes.string,
2224
borderColor: ReactPropTypes.string,

Libraries/Network/XMLHttpRequestBase.js

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ class XMLHttpRequestBase {
6666

6767
getResponseHeader(header: string): ?string {
6868
if (this.responseHeaders) {
69-
var value = this.responseHeaders[header];
69+
var value = this.responseHeaders[header.toLowerCase()];
7070
return value !== undefined ? value : null;
7171
}
7272
return null;
@@ -132,7 +132,12 @@ class XMLHttpRequestBase {
132132
return;
133133
}
134134
this.status = status;
135-
this.responseHeaders = responseHeaders || {};
135+
// Headers should be case-insensitive
136+
var lcResponseHeaders = {};
137+
for (var header in responseHeaders) {
138+
lcResponseHeaders[header.toLowerCase()] = responseHeaders[header];
139+
}
140+
this.responseHeaders = lcResponseHeaders;
136141
this.responseText = responseText;
137142
this._setReadyState(this.DONE);
138143
this._sendLoad();

Libraries/Settings/RCTSettingsManager.m

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212
#import "RCTBridge.h"
1313
#import "RCTConvert.h"
1414
#import "RCTEventDispatcher.h"
15+
#import "RCTUtils.h"
1516

1617
@implementation RCTSettingsManager
1718
{
@@ -53,13 +54,15 @@ - (void)userDefaultsDidChange:(NSNotification *)note
5354
return;
5455
}
5556

56-
[_bridge.eventDispatcher sendDeviceEventWithName:@"settingsUpdated" body:[_defaults dictionaryRepresentation]];
57+
[_bridge.eventDispatcher
58+
sendDeviceEventWithName:@"settingsUpdated"
59+
body:RCTJSONClean([_defaults dictionaryRepresentation])];
5760
}
5861

5962
- (NSDictionary *)constantsToExport
6063
{
6164
return @{
62-
@"settings": [_defaults dictionaryRepresentation]
65+
@"settings": RCTJSONClean([_defaults dictionaryRepresentation])
6366
};
6467
}
6568

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
/**
2+
* Copyright (c) 2015-present, Facebook, Inc.
3+
* All rights reserved.
4+
*
5+
* This source code is licensed under the BSD-style license found in the
6+
* LICENSE file in the root directory of this source tree. An additional grant
7+
* of patent rights can be found in the PATENTS file in the same directory.
8+
*
9+
* @providesModule TransformPropTypes
10+
* @flow
11+
*/
12+
'use strict';
13+
14+
var ReactPropTypes = require('ReactPropTypes');
15+
16+
var TransformPropTypes = {
17+
transform: ReactPropTypes.arrayOf(ReactPropTypes.object),
18+
transformMatrix: ReactPropTypes.arrayOf(ReactPropTypes.number),
19+
20+
// DEPRECATED
21+
rotation: ReactPropTypes.number,
22+
scaleX: ReactPropTypes.number,
23+
scaleY: ReactPropTypes.number,
24+
translateX: ReactPropTypes.number,
25+
translateY: ReactPropTypes.number,
26+
};
27+
28+
module.exports = TransformPropTypes;

React/Base/RCTConvert.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,7 @@
3939
+ (NSString *)NSString:(id)json;
4040
+ (NSNumber *)NSNumber:(id)json;
4141
+ (NSData *)NSData:(id)json;
42+
+ (NSIndexSet *)NSIndexSet:(id)json;
4243

4344
+ (NSURL *)NSURL:(id)json;
4445
+ (NSURLRequest *)NSURLRequest:(id)json;
@@ -76,6 +77,7 @@
7677
+ (UIImage *)UIImage:(id)json;
7778
+ (CGImageRef)CGImage:(id)json;
7879

80+
+ (UIFont *)UIFont:(id)json;
7981
+ (UIFont *)UIFont:(UIFont *)font withSize:(id)json;
8082
+ (UIFont *)UIFont:(UIFont *)font withWeight:(id)json;
8183
+ (UIFont *)UIFont:(UIFont *)font withStyle:(id)json;

0 commit comments

Comments
 (0)