From 5370c4d142b9869f4e4db7cdac5a5bdfa9cabf1c Mon Sep 17 00:00:00 2001 From: erha19 Date: Thu, 9 Aug 2018 15:39:24 +0800 Subject: [PATCH 01/23] update devtool version --- WXDevtool.podspec | 2 +- sdk/WXDevTool/Source/WXHeader/WXDevTool.m | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/WXDevtool.podspec b/WXDevtool.podspec index 03b70b9..701b9eb 100644 --- a/WXDevtool.podspec +++ b/WXDevtool.podspec @@ -30,7 +30,7 @@ Pod::Spec.new do |s| s.ios.deployment_target = "8.0" # cocoapods - s.source = { :git => "https://github.com/weexteam/weex-devtool-iOS.git", :tag => "0.16.0" } + s.source = { :git => "https://github.com/weexteam/weex-devtool-iOS.git", :tag => "0.17.0" } s.source_files = "sdk/WXDevTool/Source/**/*.{h,m,mm,c}" s.requires_arc = true diff --git a/sdk/WXDevTool/Source/WXHeader/WXDevTool.m b/sdk/WXDevTool/Source/WXHeader/WXDevTool.m index 8829da4..da7b6f3 100644 --- a/sdk/WXDevTool/Source/WXHeader/WXDevTool.m +++ b/sdk/WXDevTool/Source/WXHeader/WXDevTool.m @@ -11,7 +11,7 @@ #import "WXDevToolType.h" #import -#define WXDevtool_VERSION @"0.16.0" +#define WXDevtool_VERSION @"0.17.0" @implementation WXDevTool From dc90371f91a725e8f79b88feae069909e828d686 Mon Sep 17 00:00:00 2001 From: erha19 Date: Fri, 10 Aug 2018 14:35:45 +0800 Subject: [PATCH 02/23] formate response data for recyclelist --- sdk/WXDevTool/Source/PonyDebugger/WXDebugger.m | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/sdk/WXDevTool/Source/PonyDebugger/WXDebugger.m b/sdk/WXDevTool/Source/PonyDebugger/WXDebugger.m index 59674fe..7cc24a4 100644 --- a/sdk/WXDevTool/Source/PonyDebugger/WXDebugger.m +++ b/sdk/WXDevTool/Source/PonyDebugger/WXDebugger.m @@ -613,7 +613,7 @@ - (void)resetEnvironment - (JSValue *)callJSMethod:(NSString *)method args:(NSArray *)args { NSMutableDictionary *params = [[NSMutableDictionary alloc] init]; - NSString *nonullMethod = method ? : @""; + NSString *nonullMethod = method? [method isEqualToString:@"callJS"] ? @"__WEEX_CALL_JAVASCRIPT__" : method : @""; NSArray *nonullArgs = args ? : [NSArray array]; [params setObject:nonullMethod forKey:@"method"]; [params setObject:nonullArgs forKey:@"args"]; @@ -630,17 +630,16 @@ - (JSValue *)callJSMethod:(NSString *)method args:(NSArray *)args { [request setHTTPBody:data]; [request setValue:@"application/json" forHTTPHeaderField:@"Content-Type"]; - __block NSData *receivedData = nil; + __block NSDictionary *receivedData = nil; NSOperationQueue *queue = [[NSOperationQueue alloc] init]; dispatch_semaphore_t signal = dispatch_semaphore_create(0); - [NSURLConnection sendAsynchronousRequest:request queue:queue completionHandler:^(NSURLResponse * _Nullable response, NSData * _Nullable data, NSError * _Nullable connectionError) { - receivedData = data; + [NSURLConnection sendAsynchronousRequest:request queue:queue completionHandler:^(NSURLResponse * _Nonnull response, NSData * _Nullable data, NSError * _Nullable connectionError) { + NSArray *dict = [NSJSONSerialization JSONObjectWithData:data options:kNilOptions error:nil]; + receivedData = @{@"0": dict[0]}; dispatch_semaphore_signal(signal); }]; dispatch_semaphore_wait(signal, DISPATCH_TIME_FOREVER); - NSDictionary *dict = [NSJSONSerialization JSONObjectWithData:receivedData - options:NSJSONReadingAllowFragments - error:nil]; + NSDictionary *dict = receivedData; return (JSValue *)dict; } else From 77323c1f49b2605ef0197b3d184c170a1ea6c707 Mon Sep 17 00:00:00 2001 From: erha19 Date: Fri, 10 Aug 2018 14:37:50 +0800 Subject: [PATCH 03/23] release v0.16.1 --- WXDevtool.podspec | 2 +- sdk/WXDevTool/Source/WXHeader/WXDevTool.m | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/WXDevtool.podspec b/WXDevtool.podspec index 701b9eb..8adc295 100644 --- a/WXDevtool.podspec +++ b/WXDevtool.podspec @@ -30,7 +30,7 @@ Pod::Spec.new do |s| s.ios.deployment_target = "8.0" # cocoapods - s.source = { :git => "https://github.com/weexteam/weex-devtool-iOS.git", :tag => "0.17.0" } + s.source = { :git => "https://github.com/weexteam/weex-devtool-iOS.git", :tag => "0.16.1" } s.source_files = "sdk/WXDevTool/Source/**/*.{h,m,mm,c}" s.requires_arc = true diff --git a/sdk/WXDevTool/Source/WXHeader/WXDevTool.m b/sdk/WXDevTool/Source/WXHeader/WXDevTool.m index da7b6f3..cecb0f1 100644 --- a/sdk/WXDevTool/Source/WXHeader/WXDevTool.m +++ b/sdk/WXDevTool/Source/WXHeader/WXDevTool.m @@ -11,7 +11,7 @@ #import "WXDevToolType.h" #import -#define WXDevtool_VERSION @"0.17.0" +#define WXDevtool_VERSION @"0.16.1" @implementation WXDevTool From 24b9f0a4f42c498e906dd376e4a3664fe9eb5f13 Mon Sep 17 00:00:00 2001 From: erha19 Date: Fri, 10 Aug 2018 16:27:08 +0800 Subject: [PATCH 04/23] update podspec --- WXDevtool.podspec | 2 +- sdk/WXDevTool/Source/PonyDebugger/WXDebugger.m | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/WXDevtool.podspec b/WXDevtool.podspec index 8adc295..269c98e 100644 --- a/WXDevtool.podspec +++ b/WXDevtool.podspec @@ -3,7 +3,7 @@ Pod::Spec.new do |s| s.name = "WXDevtool" - s.version = "0.16.0" + s.version = "0.16.1" s.summary = "WXDevtool Source." diff --git a/sdk/WXDevTool/Source/PonyDebugger/WXDebugger.m b/sdk/WXDevTool/Source/PonyDebugger/WXDebugger.m index 7cc24a4..e1d678b 100644 --- a/sdk/WXDevTool/Source/PonyDebugger/WXDebugger.m +++ b/sdk/WXDevTool/Source/PonyDebugger/WXDebugger.m @@ -634,8 +634,8 @@ - (JSValue *)callJSMethod:(NSString *)method args:(NSArray *)args { NSOperationQueue *queue = [[NSOperationQueue alloc] init]; dispatch_semaphore_t signal = dispatch_semaphore_create(0); [NSURLConnection sendAsynchronousRequest:request queue:queue completionHandler:^(NSURLResponse * _Nonnull response, NSData * _Nullable data, NSError * _Nullable connectionError) { - NSArray *dict = [NSJSONSerialization JSONObjectWithData:data options:kNilOptions error:nil]; - receivedData = @{@"0": dict[0]}; + NSArray *array = [NSJSONSerialization JSONObjectWithData:data options:kNilOptions error:nil]; + receivedData = @{@"0": array[0]}; dispatch_semaphore_signal(signal); }]; dispatch_semaphore_wait(signal, DISPATCH_TIME_FOREVER); From cf4db7c62a7faefb4751ec9f286897ed7ac3a715 Mon Sep 17 00:00:00 2001 From: erha19 Date: Fri, 10 Aug 2018 17:23:57 +0800 Subject: [PATCH 05/23] update scheme --- .../xcshareddata/xcschemes/WXDevTool.xcscheme | 82 +++++++++++++++++++ 1 file changed, 82 insertions(+) create mode 100644 sdk/WXDevTool.xcodeproj/xcshareddata/xcschemes/WXDevTool.xcscheme diff --git a/sdk/WXDevTool.xcodeproj/xcshareddata/xcschemes/WXDevTool.xcscheme b/sdk/WXDevTool.xcodeproj/xcshareddata/xcschemes/WXDevTool.xcscheme new file mode 100644 index 0000000..a734e34 --- /dev/null +++ b/sdk/WXDevTool.xcodeproj/xcshareddata/xcschemes/WXDevTool.xcscheme @@ -0,0 +1,82 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + From 1b9f0a481566cfa893a28ab0f6858de4e40171b5 Mon Sep 17 00:00:00 2001 From: erha19 Date: Fri, 10 Aug 2018 20:29:22 +0800 Subject: [PATCH 06/23] rename TBWXDevTool to WXDevTool --- sdk/WXDevTool.xcodeproj/project.pbxproj | 44 +++++-------------- .../xcshareddata/xcschemes/WXDevTool.xcscheme | 6 +-- .../{TBWXDevTool.pch => WXDevTool.pch} | 0 3 files changed, 14 insertions(+), 36 deletions(-) rename sdk/WXDevTool/Source/Supporting Files/{TBWXDevTool.pch => WXDevTool.pch} (100%) diff --git a/sdk/WXDevTool.xcodeproj/project.pbxproj b/sdk/WXDevTool.xcodeproj/project.pbxproj index 4c76c91..aba1276 100644 --- a/sdk/WXDevTool.xcodeproj/project.pbxproj +++ b/sdk/WXDevTool.xcodeproj/project.pbxproj @@ -21,7 +21,6 @@ 0A0103211D35E25300F0D592 /* WXDevTool.m in Sources */ = {isa = PBXBuildFile; fileRef = 0A01029C1D35E25300F0D592 /* WXDevTool.m */; }; 0A0298541D4B402400B4BC95 /* WXDevToolType.h in Headers */ = {isa = PBXBuildFile; fileRef = 0A0298521D4B402400B4BC95 /* WXDevToolType.h */; }; 0A0298551D4B402400B4BC95 /* WXDevToolType.m in Sources */ = {isa = PBXBuildFile; fileRef = 0A0298531D4B402400B4BC95 /* WXDevToolType.m */; }; - 0A1DCE3A1D4F004C005E87C7 /* TBWXDevTool.pch in Headers */ = {isa = PBXBuildFile; fileRef = 0A1DCE391D4F004C005E87C7 /* TBWXDevTool.pch */; }; 0A37BCA21E1A521F00C5542E /* WXDebuggerUtility.h in Headers */ = {isa = PBXBuildFile; fileRef = 0A37BCA01E1A521F00C5542E /* WXDebuggerUtility.h */; }; 0A37BCA31E1A521F00C5542E /* WXDebuggerUtility.m in Sources */ = {isa = PBXBuildFile; fileRef = 0A37BCA11E1A521F00C5542E /* WXDebuggerUtility.m */; }; 0ABDFC6F1D3C7B6900206418 /* WXDebugDomain.h in Headers */ = {isa = PBXBuildFile; fileRef = 0ABDFC6D1D3C7B6900206418 /* WXDebugDomain.h */; }; @@ -157,7 +156,6 @@ 0AFA10141D2CEC49006E30BB /* CoreData.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 0AFA10131D2CEC49006E30BB /* CoreData.framework */; }; 0AFE81D61D8102B800C99208 /* WXPageDomainUtility.h in Headers */ = {isa = PBXBuildFile; fileRef = 0AFE81D41D8102B800C99208 /* WXPageDomainUtility.h */; }; 0AFE81D71D8102B800C99208 /* WXPageDomainUtility.m in Sources */ = {isa = PBXBuildFile; fileRef = 0AFE81D51D8102B800C99208 /* WXPageDomainUtility.m */; }; - 15C5AF763645AC346A190397 /* libPods-TBWXDevTool.a in Frameworks */ = {isa = PBXBuildFile; fileRef = C50EBFCEBD547BE8303CEC8F /* libPods-TBWXDevTool.a */; }; 36E050F3DFBCF2724B0320CE /* libPods-WXDevTool.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 74BF27120E6548831B0E4FB7 /* libPods-WXDevTool.a */; }; C42545FD1F27461000B93B0D /* WXNetworkRecorder.h in Headers */ = {isa = PBXBuildFile; fileRef = C42545BB1F27461000B93B0D /* WXNetworkRecorder.h */; }; C42545FE1F27461000B93B0D /* WXNetworkRecorder.m in Sources */ = {isa = PBXBuildFile; fileRef = C42545BC1F27461000B93B0D /* WXNetworkRecorder.m */; }; @@ -168,6 +166,7 @@ C42546091F27461000B93B0D /* WXTracingUtility.h in Headers */ = {isa = PBXBuildFile; fileRef = C42545C71F27461000B93B0D /* WXTracingUtility.h */; }; C425460A1F27461000B93B0D /* WXTracingUtility.m in Sources */ = {isa = PBXBuildFile; fileRef = C42545C81F27461000B93B0D /* WXTracingUtility.m */; }; C49207731F28927D002EF9D7 /* ImageIO.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = C49207721F28927D002EF9D7 /* ImageIO.framework */; }; + C866F7E1211DBC67007E3B47 /* WXDevTool.pch in Headers */ = {isa = PBXBuildFile; fileRef = C866F7E0211DBC66007E3B47 /* WXDevTool.pch */; }; /* End PBXBuildFile section */ /* Begin PBXFileReference section */ @@ -185,11 +184,8 @@ 0A01029C1D35E25300F0D592 /* WXDevTool.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = WXDevTool.m; sourceTree = ""; }; 0A0298521D4B402400B4BC95 /* WXDevToolType.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WXDevToolType.h; sourceTree = ""; }; 0A0298531D4B402400B4BC95 /* WXDevToolType.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = WXDevToolType.m; sourceTree = ""; }; - 0A1DCE391D4F004C005E87C7 /* TBWXDevTool.pch */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = TBWXDevTool.pch; sourceTree = ""; }; 0A37BCA01E1A521F00C5542E /* WXDebuggerUtility.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WXDebuggerUtility.h; sourceTree = ""; }; 0A37BCA11E1A521F00C5542E /* WXDebuggerUtility.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = WXDebuggerUtility.m; sourceTree = ""; }; - 0ABB39F01D3F37700091332E /* TBWXDevTool_MTL.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = TBWXDevTool_MTL.h; sourceTree = ""; }; - 0ABB39F21D3F37700091332E /* TBWXDevTool_MTL.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = TBWXDevTool_MTL.m; sourceTree = ""; }; 0ABDFC6D1D3C7B6900206418 /* WXDebugDomain.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WXDebugDomain.h; sourceTree = ""; }; 0ABDFC6E1D3C7B6900206418 /* WXDebugDomain.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = WXDebugDomain.m; sourceTree = ""; }; 0ABDFC711D3C7C1F00206418 /* WXDebugDomainController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WXDebugDomainController.h; sourceTree = ""; }; @@ -315,8 +311,7 @@ 0ADE98341D767BB7005781C1 /* WXWebGLTypes.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = WXWebGLTypes.m; sourceTree = ""; }; 0ADE98351D767BB7005781C1 /* WXWorkerDomain.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WXWorkerDomain.h; sourceTree = ""; }; 0ADE98361D767BB7005781C1 /* WXWorkerDomain.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = WXWorkerDomain.m; sourceTree = ""; }; - 0AFA0ECB1D2CE79E006E30BB /* TBWXDevTool.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = TBWXDevTool.framework; sourceTree = BUILT_PRODUCTS_DIR; }; - 0AFA0ECE1D2CE79E006E30BB /* TBWXDevTool.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = TBWXDevTool.h; sourceTree = ""; }; + 0AFA0ECB1D2CE79E006E30BB /* WXDevTool.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = WXDevTool.framework; sourceTree = BUILT_PRODUCTS_DIR; }; 0AFA0ED01D2CE79E006E30BB /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; 0AFA0FE51D2CEB39006E30BB /* Security.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Security.framework; path = System/Library/Frameworks/Security.framework; sourceTree = SDKROOT; }; 0AFA100B1D2CEC2A006E30BB /* CFNetwork.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CFNetwork.framework; path = System/Library/Frameworks/CFNetwork.framework; sourceTree = SDKROOT; }; @@ -328,9 +323,7 @@ 0AFE81D41D8102B800C99208 /* WXPageDomainUtility.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WXPageDomainUtility.h; sourceTree = ""; }; 0AFE81D51D8102B800C99208 /* WXPageDomainUtility.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = WXPageDomainUtility.m; sourceTree = ""; }; 165DA532BBD5D3B8738062C5 /* Pods-WXDevTool.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-WXDevTool.release.xcconfig"; path = "Pods/Target Support Files/Pods-WXDevTool/Pods-WXDevTool.release.xcconfig"; sourceTree = ""; }; - 489AA4AF96AEBD4B7A7D8A91 /* Pods-TBWXDevTool.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-TBWXDevTool.debug.xcconfig"; path = "Pods/Target Support Files/Pods-TBWXDevTool/Pods-TBWXDevTool.debug.xcconfig"; sourceTree = ""; }; 74BF27120E6548831B0E4FB7 /* libPods-WXDevTool.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = "libPods-WXDevTool.a"; sourceTree = BUILT_PRODUCTS_DIR; }; - 9CF2E2BFC9331B7CB90EA000 /* Pods-TBWXDevTool.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-TBWXDevTool.release.xcconfig"; path = "Pods/Target Support Files/Pods-TBWXDevTool/Pods-TBWXDevTool.release.xcconfig"; sourceTree = ""; }; A7B2575D248E618B57F22E13 /* Pods-WXDevTool.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-WXDevTool.debug.xcconfig"; path = "Pods/Target Support Files/Pods-WXDevTool/Pods-WXDevTool.debug.xcconfig"; sourceTree = ""; }; C42545BB1F27461000B93B0D /* WXNetworkRecorder.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WXNetworkRecorder.h; sourceTree = ""; }; C42545BC1F27461000B93B0D /* WXNetworkRecorder.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = WXNetworkRecorder.m; sourceTree = ""; }; @@ -341,7 +334,7 @@ C42545C71F27461000B93B0D /* WXTracingUtility.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WXTracingUtility.h; sourceTree = ""; }; C42545C81F27461000B93B0D /* WXTracingUtility.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = WXTracingUtility.m; sourceTree = ""; }; C49207721F28927D002EF9D7 /* ImageIO.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = ImageIO.framework; path = System/Library/Frameworks/ImageIO.framework; sourceTree = SDKROOT; }; - C50EBFCEBD547BE8303CEC8F /* libPods-TBWXDevTool.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = "libPods-TBWXDevTool.a"; sourceTree = BUILT_PRODUCTS_DIR; }; + C866F7E0211DBC66007E3B47 /* WXDevTool.pch */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WXDevTool.pch; sourceTree = ""; }; C8A3D04A20ECFA52004AB78A /* libWeexSDK.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; path = libWeexSDK.a; sourceTree = BUILT_PRODUCTS_DIR; }; /* End PBXFileReference section */ @@ -357,7 +350,6 @@ 0AFA100E1D2CEC34006E30BB /* Foundation.framework in Frameworks */, 0AFA100C1D2CEC2A006E30BB /* CFNetwork.framework in Frameworks */, 0AFA0FE61D2CEB39006E30BB /* Security.framework in Frameworks */, - 15C5AF763645AC346A190397 /* libPods-TBWXDevTool.a in Frameworks */, 36E050F3DFBCF2724B0320CE /* libPods-WXDevTool.a in Frameworks */, ); runOnlyForDeploymentPostprocessing = 0; @@ -535,26 +527,16 @@ 0A1DCE341D4EFDD1005E87C7 /* Supporting Files */ = { isa = PBXGroup; children = ( - 0A1DCE391D4F004C005E87C7 /* TBWXDevTool.pch */, + C866F7E0211DBC66007E3B47 /* WXDevTool.pch */, ); name = "Supporting Files"; path = "Source/Supporting Files"; sourceTree = ""; }; - 0ABB39EF1D3F37700091332E /* TBWXDevTool_MTL */ = { - isa = PBXGroup; - children = ( - 0ABB39F01D3F37700091332E /* TBWXDevTool_MTL.h */, - 0ABB39F21D3F37700091332E /* TBWXDevTool_MTL.m */, - ); - path = TBWXDevTool_MTL; - sourceTree = ""; - }; 0AFA0EC11D2CE79E006E30BB = { isa = PBXGroup; children = ( 0AFA0ECD1D2CE79E006E30BB /* WXDevTool */, - 0ABB39EF1D3F37700091332E /* TBWXDevTool_MTL */, 0AFA10171D2CEC61006E30BB /* Frameworks */, 0AFA0ECC1D2CE79E006E30BB /* Products */, 7AED1ACEA69643F607B0C3D3 /* Pods */, @@ -564,7 +546,7 @@ 0AFA0ECC1D2CE79E006E30BB /* Products */ = { isa = PBXGroup; children = ( - 0AFA0ECB1D2CE79E006E30BB /* TBWXDevTool.framework */, + 0AFA0ECB1D2CE79E006E30BB /* WXDevTool.framework */, ); name = Products; sourceTree = ""; @@ -573,7 +555,6 @@ isa = PBXGroup; children = ( 0AFA0ED61D2CEA94006E30BB /* Source */, - 0AFA0ECE1D2CE79E006E30BB /* TBWXDevTool.h */, 0AFA0ED01D2CE79E006E30BB /* Info.plist */, 0A1DCE341D4EFDD1005E87C7 /* Supporting Files */, ); @@ -603,7 +584,6 @@ 0AFA100D1D2CEC34006E30BB /* Foundation.framework */, 0AFA100B1D2CEC2A006E30BB /* CFNetwork.framework */, 0AFA0FE51D2CEB39006E30BB /* Security.framework */, - C50EBFCEBD547BE8303CEC8F /* libPods-TBWXDevTool.a */, 74BF27120E6548831B0E4FB7 /* libPods-WXDevTool.a */, ); name = Frameworks; @@ -613,8 +593,6 @@ 7AED1ACEA69643F607B0C3D3 /* Pods */ = { isa = PBXGroup; children = ( - 489AA4AF96AEBD4B7A7D8A91 /* Pods-TBWXDevTool.debug.xcconfig */, - 9CF2E2BFC9331B7CB90EA000 /* Pods-TBWXDevTool.release.xcconfig */, A7B2575D248E618B57F22E13 /* Pods-WXDevTool.debug.xcconfig */, 165DA532BBD5D3B8738062C5 /* Pods-WXDevTool.release.xcconfig */, ); @@ -677,7 +655,6 @@ 0ADE97891D767B62005781C1 /* WXConsoleDomainController.h in Headers */, 0ADE97851D767B62005781C1 /* NSOrderedSet+WXRuntimePropertyDescriptor.h in Headers */, 0ADE97AA1D767B6F005781C1 /* WXDynamicDebuggerDomain.h in Headers */, - 0A1DCE3A1D4F004C005E87C7 /* TBWXDevTool.pch in Headers */, 0ADE97811D767B62005781C1 /* NSManagedObject+WXRuntimePropertyDescriptor.h in Headers */, 0A01031E1D35E25300F0D592 /* WXDeviceInfo.h in Headers */, C42546011F27461000B93B0D /* WXNetworkTransaction.h in Headers */, @@ -688,6 +665,7 @@ 0ADE97D71D767B93005781C1 /* WXDatabaseDomain.h in Headers */, 0AFE81D61D8102B800C99208 /* WXPageDomainUtility.h in Headers */, 0ADE97D11D767B93005781C1 /* WXConsoleTypes.h in Headers */, + C866F7E1211DBC67007E3B47 /* WXDevTool.pch in Headers */, 0ADE97D91D767B93005781C1 /* WXDatabaseTypes.h in Headers */, 0A0298541D4B402400B4BC95 /* WXDevToolType.h in Headers */, 0ADE980D1D767BA5005781C1 /* WXDOMTypes.h in Headers */, @@ -752,7 +730,7 @@ ); name = WXDevTool; productName = WXDevTool; - productReference = 0AFA0ECB1D2CE79E006E30BB /* TBWXDevTool.framework */; + productReference = 0AFA0ECB1D2CE79E006E30BB /* WXDevTool.framework */; productType = "com.apple.product-type.framework"; }; /* End PBXNativeTarget section */ @@ -1048,7 +1026,7 @@ DYLIB_COMPATIBILITY_VERSION = 1; DYLIB_CURRENT_VERSION = 1; DYLIB_INSTALL_NAME_BASE = "@rpath"; - GCC_PREFIX_HEADER = "$(SRCROOT)/WXDevTool/Source/Supporting Files/TBWXDevTool.pch"; + GCC_PREFIX_HEADER = "$(SRCROOT)/WXDevTool/Source/Supporting Files/WXDevTool.pch"; GCC_TREAT_WARNINGS_AS_ERRORS = YES; INFOPLIST_FILE = WXDevTool/Info.plist; INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks"; @@ -1063,7 +1041,7 @@ OTHER_LIBTOOLFLAGS = "-ObjC"; PRIVATE_HEADERS_FOLDER_PATH = ""; PRODUCT_BUNDLE_IDENTIFIER = com.taobao.WXDevTool; - PRODUCT_NAME = TBWXDevTool; + PRODUCT_NAME = WXDevTool; PROVISIONING_PROFILE_SPECIFIER = ""; PUBLIC_HEADERS_FOLDER_PATH = ""; SKIP_INSTALL = YES; @@ -1087,7 +1065,7 @@ DYLIB_COMPATIBILITY_VERSION = 1; DYLIB_CURRENT_VERSION = 1; DYLIB_INSTALL_NAME_BASE = "@rpath"; - GCC_PREFIX_HEADER = "$(SRCROOT)/WXDevTool/Source/Supporting Files/TBWXDevTool.pch"; + GCC_PREFIX_HEADER = "$(SRCROOT)/WXDevTool/Source/Supporting Files/WXDevTool.pch"; GCC_TREAT_WARNINGS_AS_ERRORS = YES; INFOPLIST_FILE = WXDevTool/Info.plist; INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks"; @@ -1102,7 +1080,7 @@ OTHER_LIBTOOLFLAGS = "-ObjC"; PRIVATE_HEADERS_FOLDER_PATH = ""; PRODUCT_BUNDLE_IDENTIFIER = com.taobao.WXDevTool; - PRODUCT_NAME = TBWXDevTool; + PRODUCT_NAME = WXDevTool; PROVISIONING_PROFILE_SPECIFIER = ""; PUBLIC_HEADERS_FOLDER_PATH = ""; SKIP_INSTALL = YES; diff --git a/sdk/WXDevTool.xcodeproj/xcshareddata/xcschemes/WXDevTool.xcscheme b/sdk/WXDevTool.xcodeproj/xcshareddata/xcschemes/WXDevTool.xcscheme index a734e34..43ac260 100644 --- a/sdk/WXDevTool.xcodeproj/xcshareddata/xcschemes/WXDevTool.xcscheme +++ b/sdk/WXDevTool.xcodeproj/xcshareddata/xcschemes/WXDevTool.xcscheme @@ -15,7 +15,7 @@ @@ -48,7 +48,7 @@ @@ -66,7 +66,7 @@ diff --git a/sdk/WXDevTool/Source/Supporting Files/TBWXDevTool.pch b/sdk/WXDevTool/Source/Supporting Files/WXDevTool.pch similarity index 100% rename from sdk/WXDevTool/Source/Supporting Files/TBWXDevTool.pch rename to sdk/WXDevTool/Source/Supporting Files/WXDevTool.pch From 58373a16022993a9e9bc674757de6537657b7bad Mon Sep 17 00:00:00 2001 From: erha19 Date: Mon, 13 Aug 2018 19:35:57 +0800 Subject: [PATCH 07/23] Remove useless link binary --- sdk/WXDevTool.xcodeproj/project.pbxproj | 4 ---- sdk/package-lock.json | 3 --- 2 files changed, 7 deletions(-) delete mode 100644 sdk/package-lock.json diff --git a/sdk/WXDevTool.xcodeproj/project.pbxproj b/sdk/WXDevTool.xcodeproj/project.pbxproj index aba1276..49da015 100644 --- a/sdk/WXDevTool.xcodeproj/project.pbxproj +++ b/sdk/WXDevTool.xcodeproj/project.pbxproj @@ -156,7 +156,6 @@ 0AFA10141D2CEC49006E30BB /* CoreData.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 0AFA10131D2CEC49006E30BB /* CoreData.framework */; }; 0AFE81D61D8102B800C99208 /* WXPageDomainUtility.h in Headers */ = {isa = PBXBuildFile; fileRef = 0AFE81D41D8102B800C99208 /* WXPageDomainUtility.h */; }; 0AFE81D71D8102B800C99208 /* WXPageDomainUtility.m in Sources */ = {isa = PBXBuildFile; fileRef = 0AFE81D51D8102B800C99208 /* WXPageDomainUtility.m */; }; - 36E050F3DFBCF2724B0320CE /* libPods-WXDevTool.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 74BF27120E6548831B0E4FB7 /* libPods-WXDevTool.a */; }; C42545FD1F27461000B93B0D /* WXNetworkRecorder.h in Headers */ = {isa = PBXBuildFile; fileRef = C42545BB1F27461000B93B0D /* WXNetworkRecorder.h */; }; C42545FE1F27461000B93B0D /* WXNetworkRecorder.m in Sources */ = {isa = PBXBuildFile; fileRef = C42545BC1F27461000B93B0D /* WXNetworkRecorder.m */; }; C42546011F27461000B93B0D /* WXNetworkTransaction.h in Headers */ = {isa = PBXBuildFile; fileRef = C42545BF1F27461000B93B0D /* WXNetworkTransaction.h */; }; @@ -335,7 +334,6 @@ C42545C81F27461000B93B0D /* WXTracingUtility.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = WXTracingUtility.m; sourceTree = ""; }; C49207721F28927D002EF9D7 /* ImageIO.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = ImageIO.framework; path = System/Library/Frameworks/ImageIO.framework; sourceTree = SDKROOT; }; C866F7E0211DBC66007E3B47 /* WXDevTool.pch */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WXDevTool.pch; sourceTree = ""; }; - C8A3D04A20ECFA52004AB78A /* libWeexSDK.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; path = libWeexSDK.a; sourceTree = BUILT_PRODUCTS_DIR; }; /* End PBXFileReference section */ /* Begin PBXFrameworksBuildPhase section */ @@ -350,7 +348,6 @@ 0AFA100E1D2CEC34006E30BB /* Foundation.framework in Frameworks */, 0AFA100C1D2CEC2A006E30BB /* CFNetwork.framework in Frameworks */, 0AFA0FE61D2CEB39006E30BB /* Security.framework in Frameworks */, - 36E050F3DFBCF2724B0320CE /* libPods-WXDevTool.a in Frameworks */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -575,7 +572,6 @@ 0AFA10171D2CEC61006E30BB /* Frameworks */ = { isa = PBXGroup; children = ( - C8A3D04A20ECFA52004AB78A /* libWeexSDK.a */, C49207721F28927D002EF9D7 /* ImageIO.framework */, 0AFA10151D2CEC58006E30BB /* libicucore.tbd */, 0AFA10131D2CEC49006E30BB /* CoreData.framework */, diff --git a/sdk/package-lock.json b/sdk/package-lock.json deleted file mode 100644 index 48e341a..0000000 --- a/sdk/package-lock.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "lockfileVersion": 1 -} From 88729491532d3165163be6b9832d91ce752ad8e6 Mon Sep 17 00:00:00 2001 From: doumafang Date: Wed, 15 Aug 2018 21:01:46 +0800 Subject: [PATCH 08/23] add jsvalue to nsarray method --- sdk/WXDevTool/Source/PonyDebugger/WXDebugger.m | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/sdk/WXDevTool/Source/PonyDebugger/WXDebugger.m b/sdk/WXDevTool/Source/PonyDebugger/WXDebugger.m index e1d678b..21a528d 100644 --- a/sdk/WXDevTool/Source/PonyDebugger/WXDebugger.m +++ b/sdk/WXDevTool/Source/PonyDebugger/WXDebugger.m @@ -630,17 +630,16 @@ - (JSValue *)callJSMethod:(NSString *)method args:(NSArray *)args { [request setHTTPBody:data]; [request setValue:@"application/json" forHTTPHeaderField:@"Content-Type"]; - __block NSDictionary *receivedData = nil; + __block NSArray *receivedData = nil; NSOperationQueue *queue = [[NSOperationQueue alloc] init]; dispatch_semaphore_t signal = dispatch_semaphore_create(0); [NSURLConnection sendAsynchronousRequest:request queue:queue completionHandler:^(NSURLResponse * _Nonnull response, NSData * _Nullable data, NSError * _Nullable connectionError) { - NSArray *array = [NSJSONSerialization JSONObjectWithData:data options:kNilOptions error:nil]; - receivedData = @{@"0": array[0]}; + NSError *error = nil; + receivedData = [NSJSONSerialization JSONObjectWithData:data options:kNilOptions error:&error]; dispatch_semaphore_signal(signal); }]; dispatch_semaphore_wait(signal, DISPATCH_TIME_FOREVER); - NSDictionary *dict = receivedData; - return (JSValue *)dict; + return [JSValue valueWithObject:receivedData inContext:[JSContext new]]; } else { From a7f8d9a6b5947f486d1ab7b8816100a9b925cca7 Mon Sep 17 00:00:00 2001 From: erha19 Date: Thu, 16 Aug 2018 10:28:10 +0800 Subject: [PATCH 09/23] Release v0.16.2 --- WXDevtool.podspec | 4 ++-- playground/WeexDemo.xcodeproj/project.pbxproj | 6 +++--- sdk/WXDevTool/Source/WXHeader/WXDevTool.m | 2 +- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/WXDevtool.podspec b/WXDevtool.podspec index 269c98e..dcea956 100644 --- a/WXDevtool.podspec +++ b/WXDevtool.podspec @@ -3,7 +3,7 @@ Pod::Spec.new do |s| s.name = "WXDevtool" - s.version = "0.16.1" + s.version = "0.16.2" s.summary = "WXDevtool Source." @@ -30,7 +30,7 @@ Pod::Spec.new do |s| s.ios.deployment_target = "8.0" # cocoapods - s.source = { :git => "https://github.com/weexteam/weex-devtool-iOS.git", :tag => "0.16.1" } + s.source = { :git => "https://github.com/weexteam/weex-devtool-iOS.git", :tag => "0.16.2" } s.source_files = "sdk/WXDevTool/Source/**/*.{h,m,mm,c}" s.requires_arc = true diff --git a/playground/WeexDemo.xcodeproj/project.pbxproj b/playground/WeexDemo.xcodeproj/project.pbxproj index d6d7fe0..b0bbd03 100644 --- a/playground/WeexDemo.xcodeproj/project.pbxproj +++ b/playground/WeexDemo.xcodeproj/project.pbxproj @@ -415,7 +415,7 @@ TargetAttributes = { 775BEE7A1C1E8ECC008D1629 = { CreatedOnToolsVersion = 7.1.1; - DevelopmentTeam = K46RM9974S; + DevelopmentTeam = G7EDFK7C8C; ProvisioningStyle = Automatic; }; 775BEE931C1E8ECC008D1629 = { @@ -753,7 +753,7 @@ CODE_SIGN_IDENTITY = "iPhone Developer"; "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; CODE_SIGN_STYLE = Automatic; - DEVELOPMENT_TEAM = K46RM9974S; + DEVELOPMENT_TEAM = G7EDFK7C8C; ENABLE_BITCODE = NO; FRAMEWORK_SEARCH_PATHS = ( "$(inherited)", @@ -785,7 +785,7 @@ CODE_SIGN_IDENTITY = "iPhone Distribution"; "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; CODE_SIGN_STYLE = Automatic; - DEVELOPMENT_TEAM = K46RM9974S; + DEVELOPMENT_TEAM = G7EDFK7C8C; ENABLE_BITCODE = NO; FRAMEWORK_SEARCH_PATHS = ( "$(inherited)", diff --git a/sdk/WXDevTool/Source/WXHeader/WXDevTool.m b/sdk/WXDevTool/Source/WXHeader/WXDevTool.m index cecb0f1..b1185bc 100644 --- a/sdk/WXDevTool/Source/WXHeader/WXDevTool.m +++ b/sdk/WXDevTool/Source/WXHeader/WXDevTool.m @@ -11,7 +11,7 @@ #import "WXDevToolType.h" #import -#define WXDevtool_VERSION @"0.16.1" +#define WXDevtool_VERSION @"0.16.2" @implementation WXDevTool From 4a475697d6cb2066956dbd387ed796b9802bbc80 Mon Sep 17 00:00:00 2001 From: erha19 Date: Wed, 22 Aug 2018 17:46:51 +0800 Subject: [PATCH 10/23] Fix weexteam/weex-devtool-iOS/issues/30 --- sdk/WXDevTool/Source/DerivedSources/WXDebugDomain.h | 2 +- sdk/WXDevTool/Source/PonyDebugger/WXDebugDomainController.h | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/sdk/WXDevTool/Source/DerivedSources/WXDebugDomain.h b/sdk/WXDevTool/Source/DerivedSources/WXDebugDomain.h index 7c81dab..4745762 100644 --- a/sdk/WXDevTool/Source/DerivedSources/WXDebugDomain.h +++ b/sdk/WXDevTool/Source/DerivedSources/WXDebugDomain.h @@ -9,7 +9,7 @@ #import "WXDynamicDebuggerDomain.h" #import "WXObject.h" #import "WXDebugger.h" -#import "WXDevtool.h" +#import "WXDevTool.h" @protocol WXDebugCommandDelegate; diff --git a/sdk/WXDevTool/Source/PonyDebugger/WXDebugDomainController.h b/sdk/WXDevTool/Source/PonyDebugger/WXDebugDomainController.h index 434c5d6..c7a7a33 100644 --- a/sdk/WXDevTool/Source/PonyDebugger/WXDebugDomainController.h +++ b/sdk/WXDevTool/Source/PonyDebugger/WXDebugDomainController.h @@ -6,7 +6,7 @@ * For the full copyright and license information,please view the LICENSE file in the root directory of this source tree. */ -#import "WXDevtool.h" +#import "WXDevTool.h" #import "WXPonyDebugger.h" #import "WXDebugDomain.h" #import "WXDynamicDebuggerDomain.h" From 2b9ddc089e8dd21e0625ff231280e972ae91b5af Mon Sep 17 00:00:00 2001 From: erha19 Date: Wed, 22 Aug 2018 17:50:27 +0800 Subject: [PATCH 11/23] tag 0.16.3 --- WXDevtool.podspec | 4 ++-- sdk/WXDevTool/Source/WXHeader/WXDevTool.m | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/WXDevtool.podspec b/WXDevtool.podspec index dcea956..5748774 100644 --- a/WXDevtool.podspec +++ b/WXDevtool.podspec @@ -3,7 +3,7 @@ Pod::Spec.new do |s| s.name = "WXDevtool" - s.version = "0.16.2" + s.version = "0.16.3" s.summary = "WXDevtool Source." @@ -30,7 +30,7 @@ Pod::Spec.new do |s| s.ios.deployment_target = "8.0" # cocoapods - s.source = { :git => "https://github.com/weexteam/weex-devtool-iOS.git", :tag => "0.16.2" } + s.source = { :git => "https://github.com/weexteam/weex-devtool-iOS.git", :tag => "0.16.3" } s.source_files = "sdk/WXDevTool/Source/**/*.{h,m,mm,c}" s.requires_arc = true diff --git a/sdk/WXDevTool/Source/WXHeader/WXDevTool.m b/sdk/WXDevTool/Source/WXHeader/WXDevTool.m index b1185bc..0e4aeb3 100644 --- a/sdk/WXDevTool/Source/WXHeader/WXDevTool.m +++ b/sdk/WXDevTool/Source/WXHeader/WXDevTool.m @@ -11,7 +11,7 @@ #import "WXDevToolType.h" #import -#define WXDevtool_VERSION @"0.16.2" +#define WXDevtool_VERSION @"0.16.3" @implementation WXDevTool From 13bfc3c4be68363161ab6f0aa60b5d5be23b326f Mon Sep 17 00:00:00 2001 From: erha19 Date: Tue, 30 Oct 2018 20:06:58 +0800 Subject: [PATCH 12/23] Add network flag and implemente javascriptContext on JSBrige --- .../Source/PonyDebugger/WXDebugger.m | 20 ++++++++++++++++++- 1 file changed, 19 insertions(+), 1 deletion(-) diff --git a/sdk/WXDevTool/Source/PonyDebugger/WXDebugger.m b/sdk/WXDevTool/Source/PonyDebugger/WXDebugger.m index 21a528d..9896af8 100644 --- a/sdk/WXDevTool/Source/PonyDebugger/WXDebugger.m +++ b/sdk/WXDevTool/Source/PonyDebugger/WXDebugger.m @@ -40,12 +40,13 @@ static NSString *const WXBonjourServiceType = @"_ponyd._tcp"; static BOOL WXIsVDom = NO; - +static BOOL WXIsNetwork = NO; NSString *const kWXNetworkObserverEnabledStateChangedNotification = @"kWXNetworkObserverEnabledStateChangedNotification"; static NSString *const kWXNetworkObserverEnabledDefaultsKey = @"com.taobao.WXNetworkObserver.enableOnLaunch"; static NSString *const kWXPerfomanceRenderFinishEnabledDefaultsKey = @"com.taobao.WXPerfomance.renderFinish"; +static JSContext *_jsContext; void _WXLogObjectsImpl(NSString *severity, NSArray *arguments) { [[WXConsoleDomainController defaultInstance] logWithArguments:arguments severity:severity]; @@ -102,6 +103,7 @@ - (id)init; return nil; } _isConnect = NO; + _jsContext = [[JSContext alloc] init]; _domains = [[NSMutableDictionary alloc] init]; _controllers = [[NSMutableDictionary alloc] init]; @@ -389,11 +391,13 @@ + (BOOL)isVDom { - (void)enableNetworkTrafficDebugging; { [self _addController:[WXNetworkDomainController defaultInstance]]; + WXIsNetwork = YES; } - (void)disEnableNetworkTrafficDebugging { [self _removeController:[WXNetworkDomainController defaultInstance]]; + WXIsNetwork = NO; } - (void)forwardAllNetworkTraffic; @@ -429,6 +433,10 @@ + (void)unregisterPrettyStringPrinter:(id)prettyStringPr [WXNetworkDomainController unregisterPrettyStringPrinter:prettyStringPrinter]; } ++ (BOOL)isNetwork { + return WXIsNetwork; +} + #pragma mark Core Data Debugging - (void)enableCoreDataDebugging; @@ -529,6 +537,16 @@ - (JSValue*)executeJavascript:(NSString *)script withSourceURL:(NSURL*)sourceURL return [self callJSMethod:@"importScript" args: @[_instanceID, script, @{@"bundleUrl": sourceURL.absoluteString}]]; } +- (void)setJSContext:(JSContext *)context +{ + _jsContext = context; +} + +- (JSContext *)javaScriptContext +{ + return _jsContext; +} + - (void)registerCallNative:(WXJSCallNative)callNative { WXDebugDomainController *debugDomainCrl = [WXDebugDomainController defaultInstance]; From 902ec745d612a5dd70e7dbdb610c16c379c20d95 Mon Sep 17 00:00:00 2001 From: erha19 Date: Tue, 30 Oct 2018 20:08:46 +0800 Subject: [PATCH 13/23] Feature: weex performance analyzer --- .../Source/DerivedSources/WXDebugDomain.h | 3 ++ .../Source/DerivedSources/WXDebugDomain.m | 13 +++-- .../PonyDebugger/WXDebugDomainController.m | 31 +++++++++++ .../Source/PonyDebugger/WXDebugger.h | 1 + .../WXTracing/WXMonitor/WXMonitorHandler.h | 20 +++++++ .../WXTracing/WXMonitor/WXMonitorHandler.m | 53 +++++++++++++++++++ .../WXTracing/WXNetwork/WXTracingUtility.h | 2 - .../WXTracing/WXNetwork/WXTracingUtility.m | 11 ---- 8 files changed, 117 insertions(+), 17 deletions(-) create mode 100644 sdk/WXDevTool/Source/WXTracing/WXMonitor/WXMonitorHandler.h create mode 100644 sdk/WXDevTool/Source/WXTracing/WXMonitor/WXMonitorHandler.m diff --git a/sdk/WXDevTool/Source/DerivedSources/WXDebugDomain.h b/sdk/WXDevTool/Source/DerivedSources/WXDebugDomain.h index 4745762..3dc3aa9 100644 --- a/sdk/WXDevTool/Source/DerivedSources/WXDebugDomain.h +++ b/sdk/WXDevTool/Source/DerivedSources/WXDebugDomain.h @@ -48,4 +48,7 @@ - (void)domain:(WXDynamicDebuggerDomain *)domain callRemoveEvent:(NSDictionary *)jsModule callBack:(void (^)(id error))callback ; - (void)domain:(WXDynamicDebuggerDomain *)domain syncCall:(NSDictionary *)args callBack:(void (^)(NSDictionary *data, id error))callback; +- (void)domain:(WXDynamicDebuggerDomain *)domain enablePerformanceMonitor:(BOOL)enable monitorCallback:(void (^)(id error))callback; +- (void)domain:(WXDynamicDebuggerDomain *)domain sendPerformanceData:(BOOL)enable sendCallback:(void (^)(id error))callback; + @end diff --git a/sdk/WXDevTool/Source/DerivedSources/WXDebugDomain.m b/sdk/WXDevTool/Source/DerivedSources/WXDebugDomain.m index 0065fc6..25ffdfe 100644 --- a/sdk/WXDevTool/Source/DerivedSources/WXDebugDomain.m +++ b/sdk/WXDevTool/Source/DerivedSources/WXDebugDomain.m @@ -87,11 +87,16 @@ - (void)handleMethodWithName:(NSString *)methodName parameters:(NSDictionary *)p [self.delegate domain:self callRemoveEvent:params callBack:^(id error) { responseCallback(nil, error); }]; - }else if ([methodName isEqualToString:@"enableTracing"]) { - [WXTracingUtility setRemoteTracing:[params[@"status"] boolValue]]; - } + }else if ([methodName isEqualToString:@"enablePerformanceMonitor"]) { + [self.delegate domain:self enablePerformanceMonitor:[[params objectForKey:@"value"] boolValue] monitorCallback:^(id error) { + responseCallback(nil,error); + }]; + }else if ([methodName isEqualToString:@"refreshPerformanceData"]) { + [self.delegate domain:self sendPerformanceData:[[params objectForKey:@"value"] boolValue] sendCallback:^(id error) { + responseCallback(nil,error); + }]; + } } - @end diff --git a/sdk/WXDevTool/Source/PonyDebugger/WXDebugDomainController.m b/sdk/WXDevTool/Source/PonyDebugger/WXDebugDomainController.m index caa5525..8b7e3cf 100644 --- a/sdk/WXDevTool/Source/PonyDebugger/WXDebugDomainController.m +++ b/sdk/WXDevTool/Source/PonyDebugger/WXDebugDomainController.m @@ -10,6 +10,7 @@ #import "WXDevToolType.h" #import "WXDeviceInfo.h" #import "WXDebuggerUtility.h" +#import "WXMonitorHandler.h" #import #define SYNCRETURN @"WxDebug.syncReturn" @@ -80,9 +81,11 @@ - (void)registerDevice { machine, @"model", [WXSDKEngine SDKEngineVersion],@"weexVersion", [WXDevTool WXDevtoolVersion],@"devtoolVersion", + [WXDebugger isVDom] ? @"vdom" : @"native",@"elementMode", appName, @"name", [WXLog logLevelString] ?: @"error",@"logLevel", [NSNumber numberWithBool:[WXDevToolType isDebug]],@"remoteDebug", + [WXDebugger isNetwork], @"network", nil]; [self _registerDeviceWithParams:parameters]; } @@ -380,6 +383,34 @@ - (void)domain:(WXDynamicDebuggerDomain *)domain syncCall:(NSDictionary *)data c }]; } +- (void)domain:(WXDynamicDebuggerDomain *)domain enablePerformanceMonitor:(BOOL)enable monitorCallback:(void (^)(id error))callback { + [WXAnalyzerCenter setOpen: enable]; + if (enable) { + [WXAnalyzerCenter addWxAnalyzer:[WXMonitorHandler sharedInstance]]; + if ([WXDebugTool isDebug]) { + [WXDebugTool setDebug:false]; + } + }else { + [WXAnalyzerCenter rmWxAnalyzer:[WXMonitorHandler sharedInstance]]; + [WXMonitorHandler resetMonitorData]; + } +} +- (void)domain:(WXDynamicDebuggerDomain *)domain sendPerformanceData:(BOOL)enable sendCallback:(void (^)(id error))callback { + NSMutableDictionary *params = nil; + NSError *error = nil; + if ([WXMonitorHandler sharedInstance]) { + params = [WXMonitorHandler sharedInstance].monitorDictionary; + }else { + error = [NSError errorWithDomain:(NSErrorDomain)@"sendPerformanceData error" code:500 userInfo:nil]; + } + if ([WXDebugger defaultInstance].isConnected) { + NSMutableDictionary *dict = [NSMutableDictionary dictionary]; + [dict setObject:@"WxDebug.sendPerformanceData" forKey:@"method"]; + [dict setObject:params forKey:@"params"]; + [[WXDebugger defaultInstance] sendDebugMessage:[WXUtility JSONString:dict] onBridgeThread:false]; + } + callback(error); +} @end diff --git a/sdk/WXDevTool/Source/PonyDebugger/WXDebugger.h b/sdk/WXDevTool/Source/PonyDebugger/WXDebugger.h index bde1e96..4aa1fd6 100644 --- a/sdk/WXDevTool/Source/PonyDebugger/WXDebugger.h +++ b/sdk/WXDevTool/Source/PonyDebugger/WXDebugger.h @@ -78,6 +78,7 @@ extern NSString *const kWXNetworkObserverEnabledStateChangedNotification; - (void)forwardNetworkTrafficFromDelegateClass:(Class)cls; + (void)registerPrettyStringPrinter:(id)prettyStringPrinter; + (void)unregisterPrettyStringPrinter:(id)prettyStringPrinter; ++ (BOOL)isNetwork; #pragma mark Core Data Debugging - (void)enableCoreDataDebugging; diff --git a/sdk/WXDevTool/Source/WXTracing/WXMonitor/WXMonitorHandler.h b/sdk/WXDevTool/Source/WXTracing/WXMonitor/WXMonitorHandler.h new file mode 100644 index 0000000..00f7e47 --- /dev/null +++ b/sdk/WXDevTool/Source/WXTracing/WXMonitor/WXMonitorHandler.h @@ -0,0 +1,20 @@ +/** + * Created by Weex. + * Copyright (c) 2016, Alibaba, Inc. All rights reserved. + * + * This source code is licensed under the Apache Licence 2.0. + * For the full copyright and license information,please view the LICENSE file in the root directory of this source tree. + */ + +#import +#import + +@interface WXMonitorHandler : NSObject + +@property(nonatomic, strong) NSMutableDictionary *monitorDictionary; + ++ (instancetype)sharedInstance; ++ (void)resetMonitorData; + +@end + diff --git a/sdk/WXDevTool/Source/WXTracing/WXMonitor/WXMonitorHandler.m b/sdk/WXDevTool/Source/WXTracing/WXMonitor/WXMonitorHandler.m new file mode 100644 index 0000000..e5fede0 --- /dev/null +++ b/sdk/WXDevTool/Source/WXTracing/WXMonitor/WXMonitorHandler.m @@ -0,0 +1,53 @@ +/** + * Created by Weex. + * Copyright (c) 2016, Alibaba, Inc. All rights reserved. + * + * This source code is licensed under the Apache Licence 2.0. + * For the full copyright and license information,please view the LICENSE file in the root directory of this source tree. + */ + + +#import "WXMonitorHandler.h" +#import + +@implementation WXMonitorHandler + +static WXMonitorHandler* _sharedInstance; + ++ (instancetype)sharedInstance { + static dispatch_once_t onceToken; + dispatch_once(&onceToken, ^{ + _sharedInstance = [[self alloc] init]; + _sharedInstance.monitorDictionary = [NSMutableDictionary new]; + }); + return _sharedInstance; +} + ++ (void) resetMonitorData { + [WXMonitorHandler.sharedInstance.monitorDictionary removeAllObjects]; +} + +- (void)transfer:(NSDictionary *)value { + if (![value isKindOfClass:NSDictionary.class]) { + return; + } + NSString* group = value[@"group"]; + NSString* instanceId = value[@"module"]; + if ([group isEqualToString:@"wxapm"]) { + if (instanceId && [instanceId isKindOfClass:NSString.class]) { + NSMutableArray *array = WXMonitorHandler.sharedInstance.monitorDictionary[instanceId]; + if (!array) { + array = [NSMutableArray new]; + [WXMonitorHandler.sharedInstance.monitorDictionary setObject:array forKey:instanceId]; + } + NSMutableDictionary *directory = [value mutableCopy]; + [directory removeObjectsForKeys:@[@"group",@"module"]]; + [array addObject:directory]; + [WXMonitorHandler.sharedInstance.monitorDictionary setObject:array forKey:instanceId]; + } + } + +} + +@end + diff --git a/sdk/WXDevTool/Source/WXTracing/WXNetwork/WXTracingUtility.h b/sdk/WXDevTool/Source/WXTracing/WXNetwork/WXTracingUtility.h index 6591051..384e5f7 100755 --- a/sdk/WXDevTool/Source/WXTracing/WXNetwork/WXTracingUtility.h +++ b/sdk/WXDevTool/Source/WXTracing/WXNetwork/WXTracingUtility.h @@ -53,8 +53,6 @@ + (NSArray *)allWindows; + (NSString *)tracingTime; + (NSArray *)formatTask:(WXTracingTask *)task; -+ (BOOL)isRemoteTracing; -+ (void)setRemoteTracing:(BOOL)isRemoteTracing; // Swizzling utilities diff --git a/sdk/WXDevTool/Source/WXTracing/WXNetwork/WXTracingUtility.m b/sdk/WXDevTool/Source/WXTracing/WXNetwork/WXTracingUtility.m index 1465eae..0bbd383 100755 --- a/sdk/WXDevTool/Source/WXTracing/WXNetwork/WXTracingUtility.m +++ b/sdk/WXDevTool/Source/WXTracing/WXNetwork/WXTracingUtility.m @@ -379,17 +379,6 @@ + (NSArray *)formatTask:(WXTracingTask *)task return array; } -+ (BOOL)isRemoteTracing -{ - return [WXDebugTool isRemoteTracing]; -} -+ (void)setRemoteTracing:(BOOL)isRemoteTracing -{ - [WXDebugTool setRemoteTracing:isRemoteTracing]; -} - - - // Swizzling utilities + (SEL)swizzledSelectorForSelector:(SEL)selector { From 4f95b448d5625369661e9b0c6e2bb2bc81e72695 Mon Sep 17 00:00:00 2001 From: erha19 Date: Tue, 30 Oct 2018 20:09:28 +0800 Subject: [PATCH 14/23] Fix DOM inspector --- .../Source/PonyDebugger/WXDOMDomainController.m | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/sdk/WXDevTool/Source/PonyDebugger/WXDOMDomainController.m b/sdk/WXDevTool/Source/PonyDebugger/WXDOMDomainController.m index 929caef..861cefe 100644 --- a/sdk/WXDevTool/Source/PonyDebugger/WXDOMDomainController.m +++ b/sdk/WXDevTool/Source/PonyDebugger/WXDOMDomainController.m @@ -666,6 +666,9 @@ - (void)removeView:(UIView *)view } else if ([view isKindOfClass:[UIWindow class]]) { // Windows are always children of the root element node parentNodeId = @(1); + } else { + // Windows are always children of the root element node + parentNodeId = @(1); } [self.domain childNodeRemovedWithParentNodeId:parentNodeId nodeId:nodeId]; [self stopTrackingView:view]; @@ -1456,12 +1459,12 @@ - (void)_getBoxModelNode:(UIView *)objectForNodeId callback:(void (^)(WXDOMBoxMo CGFloat scale = [WXPageDomainController defaultInstance].domain.screenScaleFactor; UIView *view = [WXPageDomainUtility getCurrentKeyController].view; CGRect changeRect = [objectForNodeId.superview convertRect:objectForNodeId.frame toView:view]; - NSNumber *width = [NSNumber numberWithInteger:objectForNodeId.frame.size.width / [WXUtility defaultPixelScaleFactor]]; - NSNumber *height = [NSNumber numberWithInteger:objectForNodeId.frame.size.height / [WXUtility defaultPixelScaleFactor]]; - CGFloat left = changeRect.origin.x * scale; - CGFloat top = changeRect.origin.y * scale; - CGFloat right = left + objectForNodeId.frame.size.width * scale; - CGFloat bottom = top + objectForNodeId.frame.size.height * scale; + NSNumber *width = [NSNumber numberWithInteger:objectForNodeId.frame.size.width / scale]; + NSNumber *height = [NSNumber numberWithInteger:objectForNodeId.frame.size.height / scale]; + CGFloat left = changeRect.origin.x; + CGFloat top = changeRect.origin.y; + CGFloat right = left + objectForNodeId.frame.size.width; + CGFloat bottom = top + objectForNodeId.frame.size.height; CGFloat paddingLeft = 0; CGFloat paddingRight = 0; From dd39a8b68ee404cacc2555037166ec0e03fb7b12 Mon Sep 17 00:00:00 2001 From: erha19 Date: Wed, 31 Oct 2018 10:41:12 +0800 Subject: [PATCH 15/23] update weexsdk version --- sdk/Podfile | 2 +- sdk/WXDevTool.xcodeproj/project.pbxproj | 43 ++++++++++++------------- 2 files changed, 21 insertions(+), 24 deletions(-) diff --git a/sdk/Podfile b/sdk/Podfile index 313bbac..e373d26 100644 --- a/sdk/Podfile +++ b/sdk/Podfile @@ -8,7 +8,7 @@ use_frameworks! def pods - pod 'WeexSDK','0.18.0' + pod 'WeexSDK','0.19.0' pod 'SocketRocket', '0.4.2' end diff --git a/sdk/WXDevTool.xcodeproj/project.pbxproj b/sdk/WXDevTool.xcodeproj/project.pbxproj index 49da015..8746d9e 100644 --- a/sdk/WXDevTool.xcodeproj/project.pbxproj +++ b/sdk/WXDevTool.xcodeproj/project.pbxproj @@ -166,6 +166,9 @@ C425460A1F27461000B93B0D /* WXTracingUtility.m in Sources */ = {isa = PBXBuildFile; fileRef = C42545C81F27461000B93B0D /* WXTracingUtility.m */; }; C49207731F28927D002EF9D7 /* ImageIO.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = C49207721F28927D002EF9D7 /* ImageIO.framework */; }; C866F7E1211DBC67007E3B47 /* WXDevTool.pch in Headers */ = {isa = PBXBuildFile; fileRef = C866F7E0211DBC66007E3B47 /* WXDevTool.pch */; }; + C8DFD4FE21888415006172B7 /* WXMonitorHandler.m in Sources */ = {isa = PBXBuildFile; fileRef = C8DFD4FC21888415006172B7 /* WXMonitorHandler.m */; }; + C8DFD4FF21888415006172B7 /* WXMonitorHandler.h in Headers */ = {isa = PBXBuildFile; fileRef = C8DFD4FD21888415006172B7 /* WXMonitorHandler.h */; }; + FBE96675AA0C067CBCAF0BF9 /* Pods_WXDevTool.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 24EB9AE41ACB871D7515F88E /* Pods_WXDevTool.framework */; }; /* End PBXBuildFile section */ /* Begin PBXFileReference section */ @@ -322,7 +325,7 @@ 0AFE81D41D8102B800C99208 /* WXPageDomainUtility.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WXPageDomainUtility.h; sourceTree = ""; }; 0AFE81D51D8102B800C99208 /* WXPageDomainUtility.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = WXPageDomainUtility.m; sourceTree = ""; }; 165DA532BBD5D3B8738062C5 /* Pods-WXDevTool.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-WXDevTool.release.xcconfig"; path = "Pods/Target Support Files/Pods-WXDevTool/Pods-WXDevTool.release.xcconfig"; sourceTree = ""; }; - 74BF27120E6548831B0E4FB7 /* libPods-WXDevTool.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = "libPods-WXDevTool.a"; sourceTree = BUILT_PRODUCTS_DIR; }; + 24EB9AE41ACB871D7515F88E /* Pods_WXDevTool.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_WXDevTool.framework; sourceTree = BUILT_PRODUCTS_DIR; }; A7B2575D248E618B57F22E13 /* Pods-WXDevTool.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-WXDevTool.debug.xcconfig"; path = "Pods/Target Support Files/Pods-WXDevTool/Pods-WXDevTool.debug.xcconfig"; sourceTree = ""; }; C42545BB1F27461000B93B0D /* WXNetworkRecorder.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WXNetworkRecorder.h; sourceTree = ""; }; C42545BC1F27461000B93B0D /* WXNetworkRecorder.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = WXNetworkRecorder.m; sourceTree = ""; }; @@ -334,6 +337,8 @@ C42545C81F27461000B93B0D /* WXTracingUtility.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = WXTracingUtility.m; sourceTree = ""; }; C49207721F28927D002EF9D7 /* ImageIO.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = ImageIO.framework; path = System/Library/Frameworks/ImageIO.framework; sourceTree = SDKROOT; }; C866F7E0211DBC66007E3B47 /* WXDevTool.pch */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WXDevTool.pch; sourceTree = ""; }; + C8DFD4FC21888415006172B7 /* WXMonitorHandler.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = WXMonitorHandler.m; path = WXMonitor/WXMonitorHandler.m; sourceTree = ""; }; + C8DFD4FD21888415006172B7 /* WXMonitorHandler.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = WXMonitorHandler.h; path = WXMonitor/WXMonitorHandler.h; sourceTree = ""; }; /* End PBXFileReference section */ /* Begin PBXFrameworksBuildPhase section */ @@ -348,6 +353,7 @@ 0AFA100E1D2CEC34006E30BB /* Foundation.framework in Frameworks */, 0AFA100C1D2CEC2A006E30BB /* CFNetwork.framework in Frameworks */, 0AFA0FE61D2CEB39006E30BB /* Security.framework in Frameworks */, + FBE96675AA0C067CBCAF0BF9 /* Pods_WXDevTool.framework in Frameworks */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -580,7 +586,7 @@ 0AFA100D1D2CEC34006E30BB /* Foundation.framework */, 0AFA100B1D2CEC2A006E30BB /* CFNetwork.framework */, 0AFA0FE51D2CEB39006E30BB /* Security.framework */, - 74BF27120E6548831B0E4FB7 /* libPods-WXDevTool.a */, + 24EB9AE41ACB871D7515F88E /* Pods_WXDevTool.framework */, ); name = Frameworks; path = WXDevTool; @@ -598,6 +604,7 @@ C42545A01F27461000B93B0D /* WXTracing */ = { isa = PBXGroup; children = ( + C8DFD4FB218883FC006172B7 /* WXMonitor */, C42545B21F27461000B93B0D /* WXNetwork */, ); name = WXTracing; @@ -619,6 +626,15 @@ path = WXNetwork; sourceTree = ""; }; + C8DFD4FB218883FC006172B7 /* WXMonitor */ = { + isa = PBXGroup; + children = ( + C8DFD4FD21888415006172B7 /* WXMonitorHandler.h */, + C8DFD4FC21888415006172B7 /* WXMonitorHandler.m */, + ); + name = WXMonitor; + sourceTree = ""; + }; /* End PBXGroup section */ /* Begin PBXHeadersBuildPhase section */ @@ -651,6 +667,7 @@ 0ADE97891D767B62005781C1 /* WXConsoleDomainController.h in Headers */, 0ADE97851D767B62005781C1 /* NSOrderedSet+WXRuntimePropertyDescriptor.h in Headers */, 0ADE97AA1D767B6F005781C1 /* WXDynamicDebuggerDomain.h in Headers */, + C8DFD4FF21888415006172B7 /* WXMonitorHandler.h in Headers */, 0ADE97811D767B62005781C1 /* NSManagedObject+WXRuntimePropertyDescriptor.h in Headers */, 0A01031E1D35E25300F0D592 /* WXDeviceInfo.h in Headers */, C42546011F27461000B93B0D /* WXNetworkTransaction.h in Headers */, @@ -718,7 +735,6 @@ 0AFA0EC71D2CE79E006E30BB /* Frameworks */, 0AFA0EC81D2CE79E006E30BB /* Headers */, 0AFECA031D76C75E0035719C /* ShellScript */, - DCC44042CB705B7C25D4BB99 /* [CP] Copy Pods Resources */, ); buildRules = ( ); @@ -793,26 +809,6 @@ shellScript = "diff \"${PODS_PODFILE_DIR_PATH}/Podfile.lock\" \"${PODS_ROOT}/Manifest.lock\" > /dev/null\nif [ $? != 0 ] ; then\n # print error to STDERR\n echo \"error: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.\" >&2\n exit 1\nfi\n# This output is used by Xcode 'outputs' to avoid re-running this script phase.\necho \"SUCCESS\" > \"${SCRIPT_OUTPUT_FILE_0}\"\n"; showEnvVarsInLog = 0; }; - DCC44042CB705B7C25D4BB99 /* [CP] Copy Pods Resources */ = { - isa = PBXShellScriptBuildPhase; - buildActionMask = 2147483647; - files = ( - ); - inputPaths = ( - "${SRCROOT}/Pods/Target Support Files/Pods-WXDevTool/Pods-WXDevTool-resources.sh", - "${PODS_ROOT}/WeexSDK/pre-build/native-bundle-main.js", - "${PODS_ROOT}/WeexSDK/ios/sdk/WeexSDK/Resources/wx_load_error@3x.png", - ); - name = "[CP] Copy Pods Resources"; - outputPaths = ( - "${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/native-bundle-main.js", - "${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/wx_load_error@3x.png", - ); - runOnlyForDeploymentPostprocessing = 0; - shellPath = /bin/sh; - shellScript = "\"${SRCROOT}/Pods/Target Support Files/Pods-WXDevTool/Pods-WXDevTool-resources.sh\"\n"; - showEnvVarsInLog = 0; - }; /* End PBXShellScriptBuildPhase section */ /* Begin PBXSourcesBuildPhase section */ @@ -858,6 +854,7 @@ 0ADE97781D767B62005781C1 /* NSData+WXDebugger.m in Sources */, 0ADE97CE1D767B93005781C1 /* WXApplicationCacheTypes.m in Sources */, 0ADE97B31D767B6F005781C1 /* WXObject.m in Sources */, + C8DFD4FE21888415006172B7 /* WXMonitorHandler.m in Sources */, 0A37BCA31E1A521F00C5542E /* WXDebuggerUtility.m in Sources */, 0ADE97AD1D767B6F005781C1 /* WXIndexedDBDomainController.m in Sources */, 0ADE978A1D767B62005781C1 /* WXConsoleDomainController.m in Sources */, From f1b0c2baea2fd35afa11925ca139221ae4960cec Mon Sep 17 00:00:00 2001 From: erha19 Date: Wed, 31 Oct 2018 10:41:17 +0800 Subject: [PATCH 16/23] tag 0.17.0 --- WXDevtool.podspec | 4 ++-- sdk/WXDevTool/Source/WXHeader/WXDevTool.m | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/WXDevtool.podspec b/WXDevtool.podspec index 5748774..5443f66 100644 --- a/WXDevtool.podspec +++ b/WXDevtool.podspec @@ -3,7 +3,7 @@ Pod::Spec.new do |s| s.name = "WXDevtool" - s.version = "0.16.3" + s.version = "0.17.0" s.summary = "WXDevtool Source." @@ -30,7 +30,7 @@ Pod::Spec.new do |s| s.ios.deployment_target = "8.0" # cocoapods - s.source = { :git => "https://github.com/weexteam/weex-devtool-iOS.git", :tag => "0.16.3" } + s.source = { :git => "https://github.com/weexteam/weex-devtool-iOS.git", :tag => "0.17.0" } s.source_files = "sdk/WXDevTool/Source/**/*.{h,m,mm,c}" s.requires_arc = true diff --git a/sdk/WXDevTool/Source/WXHeader/WXDevTool.m b/sdk/WXDevTool/Source/WXHeader/WXDevTool.m index 0e4aeb3..da7b6f3 100644 --- a/sdk/WXDevTool/Source/WXHeader/WXDevTool.m +++ b/sdk/WXDevTool/Source/WXHeader/WXDevTool.m @@ -11,7 +11,7 @@ #import "WXDevToolType.h" #import -#define WXDevtool_VERSION @"0.16.3" +#define WXDevtool_VERSION @"0.17.0" @implementation WXDevTool From 8f7bebc6f6d0ee207f417f9f9bf6e108df5321fe Mon Sep 17 00:00:00 2001 From: erha19 Date: Wed, 7 Nov 2018 16:34:26 +0800 Subject: [PATCH 17/23] support for Overlay.hightlightNode --- sdk/WXDevTool/Source/PonyDebugger/WXDebugger.m | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/sdk/WXDevTool/Source/PonyDebugger/WXDebugger.m b/sdk/WXDevTool/Source/PonyDebugger/WXDebugger.m index 9896af8..af5019b 100644 --- a/sdk/WXDevTool/Source/PonyDebugger/WXDebugger.m +++ b/sdk/WXDevTool/Source/PonyDebugger/WXDebugger.m @@ -158,6 +158,10 @@ - (void)webSocket:(SRWebSocket *)webSocket didReceiveMessage:(NSString *)message NSString *encodedData = [[NSString alloc] initWithData:data encoding:NSUTF8StringEncoding]; [webSocket send:encodedData]; }; + + if ([domainName isEqualToString:@"Overlay"]) { + domainName = @"DOM"; + } WXDynamicDebuggerDomain *domain = [self domainForName:domainName]; From 273f46192d07013ea989247cd0f093871ac16ff2 Mon Sep 17 00:00:00 2001 From: erha19 Date: Wed, 7 Nov 2018 16:41:52 +0800 Subject: [PATCH 18/23] tag 0.17.1 --- WXDevtool.podspec | 4 ++-- sdk/WXDevTool/Source/WXHeader/WXDevTool.m | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/WXDevtool.podspec b/WXDevtool.podspec index 5443f66..33ffd7a 100644 --- a/WXDevtool.podspec +++ b/WXDevtool.podspec @@ -3,7 +3,7 @@ Pod::Spec.new do |s| s.name = "WXDevtool" - s.version = "0.17.0" + s.version = "0.17.1" s.summary = "WXDevtool Source." @@ -30,7 +30,7 @@ Pod::Spec.new do |s| s.ios.deployment_target = "8.0" # cocoapods - s.source = { :git => "https://github.com/weexteam/weex-devtool-iOS.git", :tag => "0.17.0" } + s.source = { :git => "https://github.com/weexteam/weex-devtool-iOS.git", :tag => "0.17.1" } s.source_files = "sdk/WXDevTool/Source/**/*.{h,m,mm,c}" s.requires_arc = true diff --git a/sdk/WXDevTool/Source/WXHeader/WXDevTool.m b/sdk/WXDevTool/Source/WXHeader/WXDevTool.m index da7b6f3..cbb8399 100644 --- a/sdk/WXDevTool/Source/WXHeader/WXDevTool.m +++ b/sdk/WXDevTool/Source/WXHeader/WXDevTool.m @@ -11,7 +11,7 @@ #import "WXDevToolType.h" #import -#define WXDevtool_VERSION @"0.17.0" +#define WXDevtool_VERSION @"0.17.1" @implementation WXDevTool From 468c9c210aa08e08b656d02e6e76357eb6f336e3 Mon Sep 17 00:00:00 2001 From: erha19 Date: Thu, 29 Nov 2018 17:10:41 +0800 Subject: [PATCH 19/23] update podfile --- playground/Podfile | 2 +- playground/WeexDemo.xcodeproj/project.pbxproj | 20 +++++++++---------- 2 files changed, 11 insertions(+), 11 deletions(-) diff --git a/playground/Podfile b/playground/Podfile index d51ef1c..1e21cea 100644 --- a/playground/Podfile +++ b/playground/Podfile @@ -3,7 +3,7 @@ platform :ios, '8.0' #inhibit_all_warnings! def common - pod 'WeexSDK', :path=>'../../incubator-weex/' + pod 'WeexSDK', '0.19.0.2' pod 'WXDevtool', :path=>'../' pod 'SDWebImage', '3.7.5' pod 'SocketRocket', '0.4.2' diff --git a/playground/WeexDemo.xcodeproj/project.pbxproj b/playground/WeexDemo.xcodeproj/project.pbxproj index b0bbd03..e886457 100644 --- a/playground/WeexDemo.xcodeproj/project.pbxproj +++ b/playground/WeexDemo.xcodeproj/project.pbxproj @@ -520,11 +520,11 @@ "${PODS_ROOT}/ATSDK-Weex/ATSDK.framework/Versions/A/Resources/ATSDK.bundle", "${PODS_ROOT}/ATSDK-Weex/ATSDK.framework/Versions/A/Resources/en.lproj", "${PODS_ROOT}/ATSDK-Weex/ATSDK.framework/Versions/A/Resources/zh-Hans.lproj", - "${PODS_ROOT}/../../../incubator-weex/pre-build/native-bundle-main.js", - "${PODS_ROOT}/../../../incubator-weex/pre-build/weex-main-jsfm.js", - "${PODS_ROOT}/../../../incubator-weex/pre-build/weex-polyfill.js", - "${PODS_ROOT}/../../../incubator-weex/pre-build/weex-rax-api.js", - "${PODS_ROOT}/../../../incubator-weex/ios/sdk/WeexSDK/Resources/wx_load_error@3x.png", + "${PODS_ROOT}/WeexSDK/pre-build/native-bundle-main.js", + "${PODS_ROOT}/WeexSDK/pre-build/weex-main-jsfm.js", + "${PODS_ROOT}/WeexSDK/pre-build/weex-polyfill.js", + "${PODS_ROOT}/WeexSDK/pre-build/weex-rax-api.js", + "${PODS_ROOT}/WeexSDK/ios/sdk/WeexSDK/Resources/wx_load_error@3x.png", ); name = "[CP] Copy Pods Resources"; outputPaths = ( @@ -570,11 +570,11 @@ "${PODS_ROOT}/ATSDK-Weex/ATSDK.framework/Versions/A/Resources/ATSDK.bundle", "${PODS_ROOT}/ATSDK-Weex/ATSDK.framework/Versions/A/Resources/en.lproj", "${PODS_ROOT}/ATSDK-Weex/ATSDK.framework/Versions/A/Resources/zh-Hans.lproj", - "${PODS_ROOT}/../../../incubator-weex/pre-build/native-bundle-main.js", - "${PODS_ROOT}/../../../incubator-weex/pre-build/weex-main-jsfm.js", - "${PODS_ROOT}/../../../incubator-weex/pre-build/weex-polyfill.js", - "${PODS_ROOT}/../../../incubator-weex/pre-build/weex-rax-api.js", - "${PODS_ROOT}/../../../incubator-weex/ios/sdk/WeexSDK/Resources/wx_load_error@3x.png", + "${PODS_ROOT}/WeexSDK/pre-build/native-bundle-main.js", + "${PODS_ROOT}/WeexSDK/pre-build/weex-main-jsfm.js", + "${PODS_ROOT}/WeexSDK/pre-build/weex-polyfill.js", + "${PODS_ROOT}/WeexSDK/pre-build/weex-rax-api.js", + "${PODS_ROOT}/WeexSDK/ios/sdk/WeexSDK/Resources/wx_load_error@3x.png", ); name = "[CP] Copy Pods Resources"; outputPaths = ( From 5a943a91a9f3e5570e3c0ef45c5736c7bf31a7b6 Mon Sep 17 00:00:00 2001 From: redye Date: Wed, 26 Dec 2018 17:21:42 +0800 Subject: [PATCH 20/23] [fix] dictionary add a bool value. --- sdk/WXDevTool/Source/PonyDebugger/WXDebugDomainController.m | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sdk/WXDevTool/Source/PonyDebugger/WXDebugDomainController.m b/sdk/WXDevTool/Source/PonyDebugger/WXDebugDomainController.m index 8b7e3cf..a962115 100644 --- a/sdk/WXDevTool/Source/PonyDebugger/WXDebugDomainController.m +++ b/sdk/WXDevTool/Source/PonyDebugger/WXDebugDomainController.m @@ -85,7 +85,7 @@ - (void)registerDevice { appName, @"name", [WXLog logLevelString] ?: @"error",@"logLevel", [NSNumber numberWithBool:[WXDevToolType isDebug]],@"remoteDebug", - [WXDebugger isNetwork], @"network", + [NSNumber numberWithBool:[WXDebugger isNetwork]], @"network", nil]; [self _registerDeviceWithParams:parameters]; } From 73b1d4ba71e95142bc51025bc5034967db53a9f2 Mon Sep 17 00:00:00 2001 From: kuiwu Date: Thu, 3 Jan 2019 17:39:23 +0800 Subject: [PATCH 21/23] perf(sdk): improve by remove WXTracingManager header --- WXDevtool.podspec | 4 ++-- .../xcshareddata/IDEWorkspaceChecks.plist | 8 ++++++++ sdk/WXDevTool/Source/PonyDebugger/WXDebugger.h | 1 - sdk/WXDevTool/Source/WXHeader/WXDevTool.m | 2 +- .../Source/WXTracing/WXNetwork/WXTracingUtility.h | 2 -- .../Source/WXTracing/WXNetwork/WXTracingUtility.m | 8 -------- 6 files changed, 11 insertions(+), 14 deletions(-) create mode 100644 sdk/WXDevTool.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist diff --git a/WXDevtool.podspec b/WXDevtool.podspec index 33ffd7a..3cd1f30 100644 --- a/WXDevtool.podspec +++ b/WXDevtool.podspec @@ -3,7 +3,7 @@ Pod::Spec.new do |s| s.name = "WXDevtool" - s.version = "0.17.1" + s.version = "0.20.0" s.summary = "WXDevtool Source." @@ -30,7 +30,7 @@ Pod::Spec.new do |s| s.ios.deployment_target = "8.0" # cocoapods - s.source = { :git => "https://github.com/weexteam/weex-devtool-iOS.git", :tag => "0.17.1" } + s.source = { :git => "https://github.com/weexteam/weex-devtool-iOS.git", :tag => "0.20.0" } s.source_files = "sdk/WXDevTool/Source/**/*.{h,m,mm,c}" s.requires_arc = true diff --git a/sdk/WXDevTool.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist b/sdk/WXDevTool.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist new file mode 100644 index 0000000..18d9810 --- /dev/null +++ b/sdk/WXDevTool.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist @@ -0,0 +1,8 @@ + + + + + IDEDidComputeMac32BitWarning + + + diff --git a/sdk/WXDevTool/Source/PonyDebugger/WXDebugger.h b/sdk/WXDevTool/Source/PonyDebugger/WXDebugger.h index 4aa1fd6..9c29697 100644 --- a/sdk/WXDevTool/Source/PonyDebugger/WXDebugger.h +++ b/sdk/WXDevTool/Source/PonyDebugger/WXDebugger.h @@ -12,7 +12,6 @@ #import #import #import -#import #pragma mark - Preprocessor diff --git a/sdk/WXDevTool/Source/WXHeader/WXDevTool.m b/sdk/WXDevTool/Source/WXHeader/WXDevTool.m index cbb8399..013aba1 100644 --- a/sdk/WXDevTool/Source/WXHeader/WXDevTool.m +++ b/sdk/WXDevTool/Source/WXHeader/WXDevTool.m @@ -11,7 +11,7 @@ #import "WXDevToolType.h" #import -#define WXDevtool_VERSION @"0.17.1" +#define WXDevtool_VERSION @"0.20.0" @implementation WXDevTool diff --git a/sdk/WXDevTool/Source/WXTracing/WXNetwork/WXTracingUtility.h b/sdk/WXDevTool/Source/WXTracing/WXNetwork/WXTracingUtility.h index 384e5f7..2c53671 100755 --- a/sdk/WXDevTool/Source/WXTracing/WXNetwork/WXTracingUtility.h +++ b/sdk/WXDevTool/Source/WXTracing/WXNetwork/WXTracingUtility.h @@ -9,7 +9,6 @@ #import #import #import -#import #define FLEXFloor(x) (floor([[UIScreen mainScreen] scale] * (x)) / [[UIScreen mainScreen] scale]) #define TracingResetLogDataNoti @"TracingResetLogDataNoti" @@ -52,7 +51,6 @@ + (NSArray *)allWindows; + (NSString *)tracingTime; -+ (NSArray *)formatTask:(WXTracingTask *)task; // Swizzling utilities diff --git a/sdk/WXDevTool/Source/WXTracing/WXNetwork/WXTracingUtility.m b/sdk/WXDevTool/Source/WXTracing/WXNetwork/WXTracingUtility.m index 0bbd383..26459da 100755 --- a/sdk/WXDevTool/Source/WXTracing/WXNetwork/WXTracingUtility.m +++ b/sdk/WXDevTool/Source/WXTracing/WXNetwork/WXTracingUtility.m @@ -370,14 +370,6 @@ +(NSString *)tracingTime NSString *str = [outputFormatter stringFromDate:[NSDate date]]; return str; } -+ (NSArray *)formatTask:(WXTracingTask *)task -{ - NSMutableArray *array = [NSMutableArray new]; - for (WXTracing *t in task.tracings) { - [array addObject:[t dictionary]]; - } - return array; -} // Swizzling utilities + (SEL)swizzledSelectorForSelector:(SEL)selector From 3a36d9356221e000856222db61e566af0198ac41 Mon Sep 17 00:00:00 2001 From: kuiwu Date: Wed, 30 Jan 2019 19:04:47 +0800 Subject: [PATCH 22/23] v0.20.1 --- WXDevtool.podspec | 4 ++-- sdk/WXDevTool/Source/WXHeader/WXDevTool.m | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/WXDevtool.podspec b/WXDevtool.podspec index 3cd1f30..a7ba129 100644 --- a/WXDevtool.podspec +++ b/WXDevtool.podspec @@ -3,7 +3,7 @@ Pod::Spec.new do |s| s.name = "WXDevtool" - s.version = "0.20.0" + s.version = "0.20.1" s.summary = "WXDevtool Source." @@ -30,7 +30,7 @@ Pod::Spec.new do |s| s.ios.deployment_target = "8.0" # cocoapods - s.source = { :git => "https://github.com/weexteam/weex-devtool-iOS.git", :tag => "0.20.0" } + s.source = { :git => "https://github.com/weexteam/weex-devtool-iOS.git", :tag => "0.20.1" } s.source_files = "sdk/WXDevTool/Source/**/*.{h,m,mm,c}" s.requires_arc = true diff --git a/sdk/WXDevTool/Source/WXHeader/WXDevTool.m b/sdk/WXDevTool/Source/WXHeader/WXDevTool.m index 013aba1..4efa62b 100644 --- a/sdk/WXDevTool/Source/WXHeader/WXDevTool.m +++ b/sdk/WXDevTool/Source/WXHeader/WXDevTool.m @@ -11,7 +11,7 @@ #import "WXDevToolType.h" #import -#define WXDevtool_VERSION @"0.20.0" +#define WXDevtool_VERSION @"0.20.1" @implementation WXDevTool From 9cc391a7ab6e7525cc4966fa78cdc6c166807d44 Mon Sep 17 00:00:00 2001 From: Jerome Tan Date: Mon, 25 Feb 2019 16:56:48 +0800 Subject: [PATCH 23/23] Handle WxDebug.renderPage --- sdk/WXDevTool/Source/DerivedSources/WXDebugDomain.h | 2 ++ sdk/WXDevTool/Source/DerivedSources/WXDebugDomain.m | 6 +++++- sdk/WXDevTool/Source/PonyDebugger/WXDebugDomainController.m | 6 ++++++ 3 files changed, 13 insertions(+), 1 deletion(-) diff --git a/sdk/WXDevTool/Source/DerivedSources/WXDebugDomain.h b/sdk/WXDevTool/Source/DerivedSources/WXDebugDomain.h index 3dc3aa9..a8a40cc 100644 --- a/sdk/WXDevTool/Source/DerivedSources/WXDebugDomain.h +++ b/sdk/WXDevTool/Source/DerivedSources/WXDebugDomain.h @@ -51,4 +51,6 @@ - (void)domain:(WXDynamicDebuggerDomain *)domain enablePerformanceMonitor:(BOOL)enable monitorCallback:(void (^)(id error))callback; - (void)domain:(WXDynamicDebuggerDomain *)domain sendPerformanceData:(BOOL)enable sendCallback:(void (^)(id error))callback; +- (void)domain:(WXDynamicDebuggerDomain *)domain renderPageWithURL:(NSURL *)url callBack:(void (^)(id error))callback; + @end diff --git a/sdk/WXDevTool/Source/DerivedSources/WXDebugDomain.m b/sdk/WXDevTool/Source/DerivedSources/WXDebugDomain.m index 25ffdfe..df7334b 100644 --- a/sdk/WXDevTool/Source/DerivedSources/WXDebugDomain.m +++ b/sdk/WXDevTool/Source/DerivedSources/WXDebugDomain.m @@ -95,7 +95,11 @@ - (void)handleMethodWithName:(NSString *)methodName parameters:(NSDictionary *)p [self.delegate domain:self sendPerformanceData:[[params objectForKey:@"value"] boolValue] sendCallback:^(id error) { responseCallback(nil,error); }]; - } + } else if ([methodName isEqualToString:@"renderPage"]) { + [self.delegate domain:self renderPageWithURL:[NSURL URLWithString:params[@"url"]] callBack:^(id error) { + responseCallback(nil, error); + }]; + } } diff --git a/sdk/WXDevTool/Source/PonyDebugger/WXDebugDomainController.m b/sdk/WXDevTool/Source/PonyDebugger/WXDebugDomainController.m index a962115..bf352b8 100644 --- a/sdk/WXDevTool/Source/PonyDebugger/WXDebugDomainController.m +++ b/sdk/WXDevTool/Source/PonyDebugger/WXDebugDomainController.m @@ -413,4 +413,10 @@ - (void)domain:(WXDynamicDebuggerDomain *)domain sendPerformanceData:(BOOL)enabl callback(error); } +- (void)domain:(WXDynamicDebuggerDomain *)domain renderPageWithURL:(NSURL *)url callBack:(void (^)(id error))callback { + NSDictionary *userInfo = @{@"url": url}; + [[NSNotificationCenter defaultCenter] postNotificationName:@"WXDevToolRenderPage" object:nil userInfo:userInfo]; + callback(nil); +} + @end