From 4d6733d86ebe511f181c67c06913a27482149243 Mon Sep 17 00:00:00 2001 From: Dimitar Topuzov Date: Thu, 23 May 2019 04:48:07 -0700 Subject: [PATCH 1/3] release: cut the 5.4.1 release (#7278) * release: cut the 5.4.1 release * chore: bump widgets version * chore: refer widget 5.4.1 --- CHANGELOG.md | 11 +++++++++++ tns-core-modules-widgets/package.json | 2 +- tns-core-modules/package.json | 4 ++-- tns-platform-declarations/package.json | 2 +- 4 files changed, 15 insertions(+), 4 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 0537ba975..c30d94d43 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,14 @@ +## [5.4.1](https://github.com/NativeScript/NativeScript/compare/5.4.0...5.4.1) (2019-05-23) + + +### Bug Fixes + +* **android:** CommonLayoutParams measure/layout child guard ([#7271](https://github.com/NativeScript/NativeScript/issues/7271)) ([333ab36](https://github.com/NativeScript/NativeScript/commit/333ab36)) +* **android:** elevation should not require explicit dynamic elevation offset ([#7250](https://github.com/NativeScript/NativeScript/issues/7250)) ([be6e408](https://github.com/NativeScript/NativeScript/commit/be6e408)) +* **hmr:** quick fade upon replace navigation ([#7251](https://github.com/NativeScript/NativeScript/issues/7251)) ([0aca087](https://github.com/NativeScript/NativeScript/commit/0aca087)) + + + # [5.4.0](https://github.com/NativeScript/NativeScript/compare/5.3.2...5.4.0) (2019-05-14) diff --git a/tns-core-modules-widgets/package.json b/tns-core-modules-widgets/package.json index 50ed097f7..591764a8c 100644 --- a/tns-core-modules-widgets/package.json +++ b/tns-core-modules-widgets/package.json @@ -1,6 +1,6 @@ { "name": "tns-core-modules-widgets", - "version": "5.4.0", + "version": "5.4.1", "description": "Native widgets used in the NativeScript framework.", "scripts": { "test": "echo \"Error: no test specified\" && exit 1" diff --git a/tns-core-modules/package.json b/tns-core-modules/package.json index ca4282a73..fee480304 100644 --- a/tns-core-modules/package.json +++ b/tns-core-modules/package.json @@ -1,7 +1,7 @@ { "name": "tns-core-modules", "description": "Telerik NativeScript Core Modules", - "version": "5.4.0", + "version": "5.4.1", "homepage": "https://www.nativescript.org", "repository": { "type": "git", @@ -26,7 +26,7 @@ "license": "Apache-2.0", "typings": "tns-core-modules.d.ts", "dependencies": { - "tns-core-modules-widgets": "5.4.0", + "tns-core-modules-widgets": "5.4.1", "tslib": "^1.9.3" }, "devDependencies": { diff --git a/tns-platform-declarations/package.json b/tns-platform-declarations/package.json index b74919c3d..1757200b4 100644 --- a/tns-platform-declarations/package.json +++ b/tns-platform-declarations/package.json @@ -1,6 +1,6 @@ { "name": "tns-platform-declarations", - "version": "5.4.0", + "version": "5.4.1", "description": "Platform-specific TypeScript declarations for NativeScript for accessing native objects", "main": "", "scripts": { From 3604df81632fddcaba628b57b79a2f1f403ab14c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Morten=20Sj=C3=B8gren?= Date: Fri, 31 May 2019 13:16:54 +0200 Subject: [PATCH 2/3] fix: register layout child for nested custom components (#7230) --- tns-core-modules/ui/layouts/grid-layout/grid-layout-common.ts | 4 ++-- tns-core-modules/ui/layouts/grid-layout/grid-layout.ios.ts | 4 ++++ .../ui/proxy-view-container/proxy-view-container.ts | 4 ++-- 3 files changed, 8 insertions(+), 4 deletions(-) diff --git a/tns-core-modules/ui/layouts/grid-layout/grid-layout-common.ts b/tns-core-modules/ui/layouts/grid-layout/grid-layout-common.ts index e9f2f5009..b48f3c925 100644 --- a/tns-core-modules/ui/layouts/grid-layout/grid-layout-common.ts +++ b/tns-core-modules/ui/layouts/grid-layout/grid-layout-common.ts @@ -5,7 +5,7 @@ export * from "../layout-base"; function validateArgs(element: View): View { if (!element) { - throw new Error("element cannot be null or undefinied."); + throw new Error("element cannot be null or undefined."); } return element; } @@ -291,7 +291,7 @@ export class GridLayoutBase extends LayoutBase implements GridLayoutDefinition { } protected invalidate(): void { - // handled natively in android and overriden in ios. + // handled natively in android and overridden in ios. } set rows(value: string) { diff --git a/tns-core-modules/ui/layouts/grid-layout/grid-layout.ios.ts b/tns-core-modules/ui/layouts/grid-layout/grid-layout.ios.ts index 6d2b153b8..d6db74646 100644 --- a/tns-core-modules/ui/layouts/grid-layout/grid-layout.ios.ts +++ b/tns-core-modules/ui/layouts/grid-layout/grid-layout.ios.ts @@ -136,6 +136,10 @@ export class GridLayout extends GridLayoutBase { this.eachLayoutChild((child, last) => { let measureSpecs = this.map.get(child); + if (!measureSpecs) { + return; + } + this.updateMeasureSpecs(child, measureSpecs); this.helper.addMeasureSpec(measureSpecs); }); diff --git a/tns-core-modules/ui/proxy-view-container/proxy-view-container.ts b/tns-core-modules/ui/proxy-view-container/proxy-view-container.ts index 7f65749c1..621bf57f3 100644 --- a/tns-core-modules/ui/proxy-view-container/proxy-view-container.ts +++ b/tns-core-modules/ui/proxy-view-container/proxy-view-container.ts @@ -131,12 +131,12 @@ export class ProxyViewContainer extends LayoutBase implements ProxyViewContainer const oldLayout = oldParent; if (addingToParent && newLayout instanceof LayoutBase) { - this.eachChildView((child) => { + this.eachLayoutChild((child) => { newLayout._registerLayoutChild(child); return true; }); } else if (oldLayout instanceof LayoutBase) { - this.eachChildView((child) => { + this.eachLayoutChild((child) => { oldLayout._unregisterLayoutChild(child); return true; }); From 1c22a730424196c971a734e4936ce27d8f59406e Mon Sep 17 00:00:00 2001 From: Manol Donev Date: Mon, 3 Jun 2019 18:36:57 +0300 Subject: [PATCH 3/3] fix(ios): potential memory leak with propertybag implementation (#7298) --- .../TNSWidgets.xcodeproj/project.pbxproj | 16 ++++++------- .../TNSWidgets/UIView+PassThroughParent.m | 4 ++-- ...ect+PropertyBag.h => UIView+PropertyBag.h} | 5 ++-- ...ect+PropertyBag.m => UIView+PropertyBag.m} | 24 +++++++++++++------ 4 files changed, 30 insertions(+), 19 deletions(-) rename tns-core-modules-widgets/ios/TNSWidgets/TNSWidgets/{NSObject+PropertyBag.h => UIView+PropertyBag.h} (76%) rename tns-core-modules-widgets/ios/TNSWidgets/TNSWidgets/{NSObject+PropertyBag.m => UIView+PropertyBag.m} (76%) diff --git a/tns-core-modules-widgets/ios/TNSWidgets/TNSWidgets.xcodeproj/project.pbxproj b/tns-core-modules-widgets/ios/TNSWidgets/TNSWidgets.xcodeproj/project.pbxproj index d98948fbe..05f34d003 100644 --- a/tns-core-modules-widgets/ios/TNSWidgets/TNSWidgets.xcodeproj/project.pbxproj +++ b/tns-core-modules-widgets/ios/TNSWidgets/TNSWidgets.xcodeproj/project.pbxproj @@ -11,8 +11,8 @@ 8B7321D01D097ECD00884AC6 /* TNSLabel.m in Sources */ = {isa = PBXBuildFile; fileRef = 8B7321CE1D097ECD00884AC6 /* TNSLabel.m */; }; B8E76F52212C2DA2009CFCE2 /* NSObject+Swizzling.h in Headers */ = {isa = PBXBuildFile; fileRef = B8E76F50212C2DA2009CFCE2 /* NSObject+Swizzling.h */; settings = {ATTRIBUTES = (Private, ); }; }; B8E76F53212C2DA2009CFCE2 /* NSObject+Swizzling.m in Sources */ = {isa = PBXBuildFile; fileRef = B8E76F51212C2DA2009CFCE2 /* NSObject+Swizzling.m */; }; - B8E76F5A212C2F4E009CFCE2 /* NSObject+PropertyBag.h in Headers */ = {isa = PBXBuildFile; fileRef = B8E76F58212C2F4E009CFCE2 /* NSObject+PropertyBag.h */; settings = {ATTRIBUTES = (Private, ); }; }; - B8E76F5B212C2F4E009CFCE2 /* NSObject+PropertyBag.m in Sources */ = {isa = PBXBuildFile; fileRef = B8E76F59212C2F4E009CFCE2 /* NSObject+PropertyBag.m */; }; + B8E76F5A212C2F4E009CFCE2 /* UIView+PropertyBag.h in Headers */ = {isa = PBXBuildFile; fileRef = B8E76F58212C2F4E009CFCE2 /* UIView+PropertyBag.h */; settings = {ATTRIBUTES = (Private, ); }; }; + B8E76F5B212C2F4E009CFCE2 /* UIView+PropertyBag.m in Sources */ = {isa = PBXBuildFile; fileRef = B8E76F59212C2F4E009CFCE2 /* UIView+PropertyBag.m */; }; B8E76F5E212C3134009CFCE2 /* UIView+PassThroughParent.h in Headers */ = {isa = PBXBuildFile; fileRef = B8E76F5C212C3134009CFCE2 /* UIView+PassThroughParent.h */; settings = {ATTRIBUTES = (Public, ); }; }; B8E76F5F212C3134009CFCE2 /* UIView+PassThroughParent.m in Sources */ = {isa = PBXBuildFile; fileRef = B8E76F5D212C3134009CFCE2 /* UIView+PassThroughParent.m */; }; F915D3551EC9EF5E00071914 /* TNSProcess.m in Sources */ = {isa = PBXBuildFile; fileRef = F915D3531EC9EF5E00071914 /* TNSProcess.m */; }; @@ -39,8 +39,8 @@ 8B7321CE1D097ECD00884AC6 /* TNSLabel.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = TNSLabel.m; sourceTree = ""; }; B8E76F50212C2DA2009CFCE2 /* NSObject+Swizzling.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "NSObject+Swizzling.h"; sourceTree = ""; }; B8E76F51212C2DA2009CFCE2 /* NSObject+Swizzling.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = "NSObject+Swizzling.m"; sourceTree = ""; }; - B8E76F58212C2F4E009CFCE2 /* NSObject+PropertyBag.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "NSObject+PropertyBag.h"; sourceTree = ""; }; - B8E76F59212C2F4E009CFCE2 /* NSObject+PropertyBag.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = "NSObject+PropertyBag.m"; sourceTree = ""; }; + B8E76F58212C2F4E009CFCE2 /* UIView+PropertyBag.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "UIView+PropertyBag.h"; sourceTree = ""; }; + B8E76F59212C2F4E009CFCE2 /* UIView+PropertyBag.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = "UIView+PropertyBag.m"; sourceTree = ""; }; B8E76F5C212C3134009CFCE2 /* UIView+PassThroughParent.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "UIView+PassThroughParent.h"; sourceTree = ""; }; B8E76F5D212C3134009CFCE2 /* UIView+PassThroughParent.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = "UIView+PassThroughParent.m"; sourceTree = ""; }; F915D3531EC9EF5E00071914 /* TNSProcess.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = TNSProcess.m; path = ../TNSProcess.m; sourceTree = ""; }; @@ -105,8 +105,8 @@ F98F5CB41CD0EFEA00978308 /* Info.plist */, B8E76F50212C2DA2009CFCE2 /* NSObject+Swizzling.h */, B8E76F51212C2DA2009CFCE2 /* NSObject+Swizzling.m */, - B8E76F58212C2F4E009CFCE2 /* NSObject+PropertyBag.h */, - B8E76F59212C2F4E009CFCE2 /* NSObject+PropertyBag.m */, + B8E76F58212C2F4E009CFCE2 /* UIView+PropertyBag.h */, + B8E76F59212C2F4E009CFCE2 /* UIView+PropertyBag.m */, B8E76F5C212C3134009CFCE2 /* UIView+PassThroughParent.h */, B8E76F5D212C3134009CFCE2 /* UIView+PassThroughParent.m */, ); @@ -134,7 +134,7 @@ B8E76F5E212C3134009CFCE2 /* UIView+PassThroughParent.h in Headers */, F98F5CCB1CD0F09E00978308 /* UIImage+TNSBlocks.h in Headers */, B8E76F52212C2DA2009CFCE2 /* NSObject+Swizzling.h in Headers */, - B8E76F5A212C2F4E009CFCE2 /* NSObject+PropertyBag.h in Headers */, + B8E76F5A212C2F4E009CFCE2 /* UIView+PropertyBag.h in Headers */, 8B7321CF1D097ECD00884AC6 /* TNSLabel.h in Headers */, ); runOnlyForDeploymentPostprocessing = 0; @@ -239,7 +239,7 @@ F915D3551EC9EF5E00071914 /* TNSProcess.m in Sources */, F98F5CCC1CD0F09E00978308 /* UIImage+TNSBlocks.m in Sources */, B8E76F53212C2DA2009CFCE2 /* NSObject+Swizzling.m in Sources */, - B8E76F5B212C2F4E009CFCE2 /* NSObject+PropertyBag.m in Sources */, + B8E76F5B212C2F4E009CFCE2 /* UIView+PropertyBag.m in Sources */, B8E76F5F212C3134009CFCE2 /* UIView+PassThroughParent.m in Sources */, ); runOnlyForDeploymentPostprocessing = 0; diff --git a/tns-core-modules-widgets/ios/TNSWidgets/TNSWidgets/UIView+PassThroughParent.m b/tns-core-modules-widgets/ios/TNSWidgets/TNSWidgets/UIView+PassThroughParent.m index 1afefd84e..8a89b5dd1 100644 --- a/tns-core-modules-widgets/ios/TNSWidgets/TNSWidgets/UIView+PassThroughParent.m +++ b/tns-core-modules-widgets/ios/TNSWidgets/TNSWidgets/UIView+PassThroughParent.m @@ -6,9 +6,9 @@ // Copyright © 2018 Telerik A D. All rights reserved. // -#import "UIView+PassThroughParent.h" #import "NSObject+Swizzling.h" -#import "NSObject+PropertyBag.h" +#import "UIView+PassThroughParent.h" +#import "UIView+PropertyBag.h" NSString * const TLKPassThroughParentKey = @"passThroughParent"; diff --git a/tns-core-modules-widgets/ios/TNSWidgets/TNSWidgets/NSObject+PropertyBag.h b/tns-core-modules-widgets/ios/TNSWidgets/TNSWidgets/UIView+PropertyBag.h similarity index 76% rename from tns-core-modules-widgets/ios/TNSWidgets/TNSWidgets/NSObject+PropertyBag.h rename to tns-core-modules-widgets/ios/TNSWidgets/TNSWidgets/UIView+PropertyBag.h index d759a03a0..65ccdf02d 100644 --- a/tns-core-modules-widgets/ios/TNSWidgets/TNSWidgets/NSObject+PropertyBag.h +++ b/tns-core-modules-widgets/ios/TNSWidgets/TNSWidgets/UIView+PropertyBag.h @@ -1,5 +1,5 @@ // -// NSObject+PropertyBag.h +// UIView+PropertyBag.h // TNSWidgets // // Created by Manol Donev on 21.08.18. @@ -7,9 +7,10 @@ // #import +#import -@interface NSObject (PropertyBag) +@interface UIView (PropertyBag) - (id) propertyValueForKey:(NSString*) key; - (void) setPropertyValue:(id) value forKey:(NSString*) key; diff --git a/tns-core-modules-widgets/ios/TNSWidgets/TNSWidgets/NSObject+PropertyBag.m b/tns-core-modules-widgets/ios/TNSWidgets/TNSWidgets/UIView+PropertyBag.m similarity index 76% rename from tns-core-modules-widgets/ios/TNSWidgets/TNSWidgets/NSObject+PropertyBag.m rename to tns-core-modules-widgets/ios/TNSWidgets/TNSWidgets/UIView+PropertyBag.m index d4a232ca2..827da992a 100644 --- a/tns-core-modules-widgets/ios/TNSWidgets/TNSWidgets/NSObject+PropertyBag.m +++ b/tns-core-modules-widgets/ios/TNSWidgets/TNSWidgets/UIView+PropertyBag.m @@ -1,22 +1,23 @@ // -// NSObject+PropertyBag.m +// UIView+PropertyBag.m // TNSWidgets // // Created by Manol Donev on 21.08.18. // Copyright © 2018 Telerik A D. All rights reserved. // -#import "NSObject+PropertyBag.h" #import "NSObject+Swizzling.h" +#import "UIView+PropertyBag.h" +#import -@implementation NSObject (PropertyBag) +@implementation UIView (PropertyBag) -+ (void) load{ ++ (void) load { [self loadPropertyBag]; } -+ (void) loadPropertyBag{ ++ (void) loadPropertyBag { @autoreleasepool { static dispatch_once_t onceToken; dispatch_once(&onceToken, ^{ @@ -36,7 +37,10 @@ __strong NSMutableDictionary *_propertyBagHolder; // Properties for every class } - (NSMutableDictionary*) propertyBag { - if (_propertyBagHolder == nil) _propertyBagHolder = [[NSMutableDictionary alloc] initWithCapacity:100]; + if (_propertyBagHolder == nil) { + _propertyBagHolder = [[NSMutableDictionary alloc] initWithCapacity:100]; + } + NSMutableDictionary *propBag = [_propertyBagHolder valueForKey:[[NSString alloc] initWithFormat:@"%p", self]]; if (propBag == nil) { propBag = [NSMutableDictionary dictionary]; @@ -54,8 +58,14 @@ __strong NSMutableDictionary *_propertyBagHolder; // Properties for every class [_propertyBagHolder setValue:propertyBag forKey:[[NSString alloc] initWithFormat:@"%p", self]]; } +- (void) removePropertyBag { + if (_propertyBagHolder != nil) { + [_propertyBagHolder removeObjectForKey:[[NSString alloc] initWithFormat:@"%p", self]]; + } +} + - (void)propertyBag_dealloc { - [self setPropertyBag:nil]; + [self removePropertyBag]; [self propertyBag_dealloc]; // swizzled }