diff --git a/Libraries/ReactIOS/ReactIOSMount.js b/Libraries/ReactIOS/ReactIOSMount.js index bae4306c7..4e29be92f 100644 --- a/Libraries/ReactIOS/ReactIOSMount.js +++ b/Libraries/ReactIOS/ReactIOSMount.js @@ -8,6 +8,7 @@ var RKUIManager = require('NativeModulesDeprecated').RKUIManager; var ReactIOSTagHandles = require('ReactIOSTagHandles'); +var ReactPerf = require('ReactPerf'); var instantiateReactComponent = require('instantiateReactComponent'); var invariant = require('invariant'); @@ -47,7 +48,7 @@ var ReactIOSMount = { TOP_ROOT_NODE_IDS[topRootNodeID] = true; var childRootNodeID = instanceNumberToChildRootID( - topRootNodeID, + topRootNodeID, ReactIOSMount.instanceCount++ ); ReactIOSMount._instancesByContainerID[topRootNodeID] = instance; @@ -113,4 +114,10 @@ var ReactIOSMount = { } }; +ReactIOSMount.renderComponent = ReactPerf.measure( + 'ReactMount', + '_renderNewRootComponent', + ReactIOSMount.renderComponent +); + module.exports = ReactIOSMount; diff --git a/Libraries/react-native/react-native.js b/Libraries/react-native/react-native.js index b483534e1..74dd38283 100644 --- a/Libraries/react-native/react-native.js +++ b/Libraries/react-native/react-native.js @@ -5,49 +5,27 @@ */ 'use strict'; -var Bundler = require('Bundler'); -var ExpandingText = require('ExpandingText'); -var Image = require('Image'); -var ListView = require('ListView'); -var ListViewDataSource = require('ListViewDataSource'); -var NavigatorIOS = require('NavigatorIOS'); -var StatusBarIOS = require('StatusBarIOS'); -var PixelRatio = require('PixelRatio'); -var React = require('React'); -var ScrollView = require('ScrollView'); -var SpinnerIOS = require('SpinnerIOS'); -var StyleSheet = require('StyleSheet'); -var Text = require('Text'); -var TextInput = require('TextInput'); -var TimerMixin = require('TimerMixin'); -var TouchableHighlight = require('TouchableHighlight'); -var TouchableWithoutFeedback = require('TouchableWithoutFeedback'); -var View = require('View'); - -var invariant = require('invariant'); -var ix = require('ix'); - var ReactNative = { - ...React, - Bundler, - ExpandingText, - Image, - ListView, - ListViewDataSource, - NavigatorIOS, - StatusBarIOS, - PixelRatio, - ScrollView, - SpinnerIOS, - StyleSheet, - Text, - TextInput, - TimerMixin, - TouchableHighlight, - TouchableWithoutFeedback, - View, - invariant, - ix, + ...require('React'), + Bundler: require('Bundler'), + ExpandingText: require('ExpandingText'), + Image: require('Image'), + ListView: require('ListView'), + ListViewDataSource: require('ListViewDataSource'), + NavigatorIOS: require('NavigatorIOS'), + PixelRatio: require('PixelRatio'), + ScrollView: require('ScrollView'), + SpinnerIOS: require('SpinnerIOS'), + StatusBarIOS: require('StatusBarIOS'), + StyleSheet: require('StyleSheet'), + Text: require('Text'), + TextInput: require('TextInput'), + TimerMixin: require('TimerMixin'), + TouchableHighlight: require('TouchableHighlight'), + TouchableWithoutFeedback: require('TouchableWithoutFeedback'), + View: require('View'), + invariant: require('invariant'), + ix: require('ix'), }; module.exports = ReactNative; diff --git a/ReactKit/Views/RCTText.h b/ReactKit/Views/RCTText.h index ddd99cece..80ba3f234 100644 --- a/ReactKit/Views/RCTText.h +++ b/ReactKit/Views/RCTText.h @@ -6,7 +6,7 @@ @property (nonatomic, copy) NSAttributedString *attributedText; @property (nonatomic, assign) NSLineBreakMode lineBreakMode; -@property (nonatomic, assign) NSInteger numberOfLines; +@property (nonatomic, assign) NSUInteger numberOfLines; - (NSNumber *)reactTagAtPoint:(CGPoint)point; diff --git a/ReactKit/Views/RCTText.m b/ReactKit/Views/RCTText.m index 5055cd8ac..f0b913879 100644 --- a/ReactKit/Views/RCTText.m +++ b/ReactKit/Views/RCTText.m @@ -40,16 +40,18 @@ - (void)setAttributedText:(NSAttributedString *)attributedText { [_textStorage setAttributedString:attributedText]; + [self setNeedsDisplay]; } -- (NSInteger)numberOfLines +- (NSUInteger)numberOfLines { return _textContainer.maximumNumberOfLines; } -- (void)setNumberOfLines:(NSInteger)numberOfLines +- (void)setNumberOfLines:(NSUInteger)numberOfLines { - _textContainer.maximumNumberOfLines = MAX(0, numberOfLines); + _textContainer.maximumNumberOfLines = numberOfLines; + [self setNeedsDisplay]; } - (NSLineBreakMode)lineBreakMode @@ -60,6 +62,7 @@ - (void)setLineBreakMode:(NSLineBreakMode)lineBreakMode { _textContainer.lineBreakMode = lineBreakMode; + [self setNeedsDisplay]; } - (void)layoutSubviews diff --git a/packager/packager.js b/packager/packager.js index 9d9491acc..4fcee0a3c 100644 --- a/packager/packager.js +++ b/packager/packager.js @@ -67,7 +67,7 @@ function openStackFrameInEditor(req, res, next) { } function getAppMiddleware(options) { - return ReactPackager.catalystMiddleware({ + return ReactPackager.middleware({ dev: true, projectRoot: options.projectRoot, blacklistRE: blacklist(false),