Compare commits

...
8 Commits
Author SHA1 Message Date
Martin Konicek bf74d8f93a [0.38.1] Bump version numbers 2016-12-05 00:13:56 +00:00
Yann PringaultandMartin Konicek 9a13def8b6 Call handleUpdateLayout even if the content didn't change
Summary:
This PR fixes #11096.

I don't know enough the ReactAndroid's source code so I don't know if this is correct but I hope it is.

In a recent commit (https://github.com/facebook/react-native/commit/d4b8ae7a8a3de314b5813e0bfcdf5fb265129d43), the `dispatchUpdates` method now returns a boolean to dispatch or not the `onLayout` event. This works well but if the content is unchanged, the line `nativeViewHierarchyOptimizer.handleUpdateLayout(this);` is never called. I don't know if it was intended but it was this which introduces my issue. I called this again even if the content didn't change. This was the behaviour before 0.38 so I guess I didn't break anything.

**Test plan (required)**

I tested my pretty big app with this fix and every screen is ok.
Closes https://github.com/facebook/react-native/pull/11222

Differential Revision: D4252101

Pulled By: astreet

fbshipit-source-id: 551559234631ac37245a854d81ba568f0ddb02dd
2016-12-05 00:13:09 +00:00
Mike Grabowski fd2313f098 [0.38.0] Bump version numbers 2016-11-22 22:05:21 -08:00
Joel ArvidssonandMike Grabowski 7b2ee7119a Unbreak custom animated components
Summary:
Commit https://github.com/facebook/react-native/commit/c9960817eea008b2703657066212002557e0d939 broke `Animated.createAnimatedComponent()` for most components outside of the standard ones. This is because it will throw an exception for any component without a `viewConfig` defined, which basically no composition style component has AFAIK.

Related issues: https://github.com/facebook/react-native/issues/10825, https://github.com/oblador/react-native-vector-icons/issues/337, https://github.com/oblador/react-native-animatable/issues/70

This PR removes the check which is more treating the symptoms really – but shouldn't `setNativeProps` duck typing be enough?
Closes https://github.com/facebook/react-native/pull/10827

Differential Revision: D4178183

Pulled By: ericvicenti

fbshipit-source-id: b85cc78ed6d84dada4d476caa243332eaadb003f
2016-11-22 22:04:35 -08:00
npomfretandMike Grabowski 9661d726d3 Ensure notification payload is passed to completion handler
Summary:
Fixes #10863
Closes https://github.com/facebook/react-native/pull/10860

Differential Revision: D4175834

Pulled By: hramos

fbshipit-source-id: 5cf317eb675528c647425c70eff939a9db9728fa
2016-11-22 22:04:23 -08:00
Martin Konicek 9de1d4f2dd [0.38.0-rc.1] Bump version numbers 2016-11-21 15:00:55 +00:00
Martin Konicek 8b3fe666aa Add deprecation warning to MapView 2016-11-21 15:00:00 +00:00
Mike Grabowski 3c9d26e618 [0.38.0-rc.0] Bump version numbers 2016-11-08 18:13:52 +01:00
8 changed files with 28 additions and 28 deletions
@@ -1735,12 +1735,6 @@ function createAnimatedComponent(Component: any): any {
var callback = () => {
if (this._component.setNativeProps) {
if (!this._propsAnimated.__isNative) {
if (this._component.viewConfig == null) {
var ctor = this._component.constructor;
var componentName = ctor.displayName || ctor.name || '<Unknown Component>';
throw new Error(componentName + ' "viewConfig" is not defined.');
}
this._component.setNativeProps(
this._propsAnimated.__getAnimatedValue()
);
+13
View File
@@ -86,6 +86,19 @@ export type AnnotationDragState = $Enum<{
const MapView = React.createClass({
componentWillMount: function() {
console.warn(
'MapView is now deprecated and will be removed from React Native in version 0.42. ' +
'Please use the react-native-maps module which is more feature complete ' +
'and works on Android too: https://github.com/airbnb/react-native-maps\n' +
'It is actively maintained and widely used.\n\n' +
'Once MapView is removed from React Native in v0.42, we will release the ' +
'code as deprecated-react-native-ios-mapview. You will be able to ' +
'continue using that and migrate to react-native-maps your own pace later.\n\n' +
'For more info, check out https://github.com/facebook/react-native/pull/10500'
);
},
mixins: [NativeMethodsMixin],
propTypes: {
@@ -219,7 +219,7 @@ RCT_EXPORT_MODULE()
self.remoteNotificationCallbacks[notificationId] = completionHandler;
}
[self sendEventWithName:@"remoteNotificationReceived" body:notification.userInfo];
[self sendEventWithName:@"remoteNotificationReceived" body:remoteNotification];
}
- (void)handleRemoteNotificationsRegistered:(NSNotification *)notification
@@ -139,6 +139,12 @@ var NativeMethodsMixin = {
* Manipulation](docs/direct-manipulation.html)).
*/
setNativeProps: function(nativeProps: Object) {
if (!this.viewConfig) {
var ctor = this.constructor;
var componentName = ctor.displayName || ctor.name || '<Unknown Component>';
invariant(false, componentName + ' "viewConfig" is not defined.');
}
if (__DEV__) {
warnForStyleProps(nativeProps, this.viewConfig.validAttributes);
}
+1 -1
View File
@@ -4,7 +4,7 @@ package = JSON.parse(File.read(File.join(__dir__, 'package.json')))
Pod::Spec.new do |s|
s.name = "React"
s.version = package['version']
s.version = "0.38.1"
s.summary = package['description']
s.description = <<-DESC
React Native apps are built using the React JS
+1 -1
View File
@@ -1,4 +1,4 @@
VERSION_NAME=1000.0.0-master
VERSION_NAME=0.38.1
GROUP=com.facebook.react
POM_NAME=ReactNative
@@ -250,23 +250,10 @@ public class ReactShadowNode extends CSSNodeDEPRECATED {
}
if (hasNewLayout()) {
float newLeft = Math.round(absoluteX + getLayoutX());
float newTop = Math.round(absoluteY + getLayoutY());
float newRight = Math.round(absoluteX + getLayoutX() + getLayoutWidth());
float newBottom = Math.round(absoluteY + getLayoutY() + getLayoutHeight());
if (newLeft == mAbsoluteLeft &&
newRight == mAbsoluteRight &&
newTop == mAbsoluteTop &&
newBottom == mAbsoluteBottom) {
return false;
}
mAbsoluteLeft = newLeft;
mAbsoluteTop = newTop;
mAbsoluteRight = newRight;
mAbsoluteBottom = newBottom;
mAbsoluteLeft = Math.round(absoluteX + getLayoutX());
mAbsoluteTop = Math.round(absoluteY + getLayoutY());
mAbsoluteRight = Math.round(absoluteX + getLayoutX() + getLayoutWidth());
mAbsoluteBottom = Math.round(absoluteY + getLayoutY() + getLayoutHeight());
nativeViewHierarchyOptimizer.handleUpdateLayout(this);
return true;
} else {
+2 -2
View File
@@ -1,6 +1,6 @@
{
"name": "react-native",
"version": "1000.0.0",
"version": "0.38.1",
"description": "A framework for building native apps using React",
"license": "BSD-3-Clause",
"repository": {
@@ -228,4 +228,4 @@
"shelljs": "0.6.0",
"sinon": "^2.0.0-pre.2"
}
}
}