Skip to content

Commit

Permalink
Merge branch 'develop-data-render-script' of gitlab.alibaba-inc.com:w…
Browse files Browse the repository at this point in the history
…eex/weex into data_render_script_dev
  • Loading branch information
jianhan-he committed Dec 19, 2018
2 parents 49a80bd + 863c018 commit 47c8be3
Show file tree
Hide file tree
Showing 9 changed files with 54 additions and 34 deletions.
Binary file modified android/sdk/libs/armeabi-v7a/libweexcore.so
Binary file not shown.
Binary file modified android/sdk/libs/armeabi/libweexcore.so
Binary file not shown.
Binary file modified android/sdk/libs/x86/libweexcore.so
Binary file not shown.
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@ public void onHttpUploadProgress(int uploadProgress) {

@Override
public void onHttpResponseProgress(int loadedLength) {

instance.getApmForInstance().extInfo.put(WXInstanceApm.VALUE_BUNDLE_LOAD_LENGTH,loadedLength);
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,8 @@
*/
package com.taobao.weex.bridge;

import static com.taobao.weex.bridge.WXModuleManager.createDomModule;

import android.content.Context;
import android.net.Uri;
import android.os.Build;
Expand All @@ -31,7 +33,6 @@
import android.support.v4.util.ArrayMap;
import android.text.TextUtils;
import android.util.Log;

import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject;
Expand All @@ -43,12 +44,38 @@
import com.taobao.weex.adapter.IWXJSExceptionAdapter;
import com.taobao.weex.adapter.IWXJsFileLoaderAdapter;
import com.taobao.weex.adapter.IWXUserTrackAdapter;
import com.taobao.weex.common.*;
import com.taobao.weex.common.IWXBridge;
import com.taobao.weex.common.IWXDebugConfig;
import com.taobao.weex.common.WXConfig;
import com.taobao.weex.common.WXErrorCode;
import com.taobao.weex.common.WXException;
import com.taobao.weex.common.WXJSBridgeMsgType;
import com.taobao.weex.common.WXJSExceptionInfo;
import com.taobao.weex.common.WXRefreshData;
import com.taobao.weex.common.WXRenderStrategy;
import com.taobao.weex.common.WXRuntimeException;
import com.taobao.weex.common.WXThread;
import com.taobao.weex.dom.CSSShorthand;
import com.taobao.weex.layout.ContentBoxMeasurement;
import com.taobao.weex.performance.WXInstanceApm;
import com.taobao.weex.ui.WXComponentRegistry;
import com.taobao.weex.ui.action.*;
import com.taobao.weex.ui.action.ActionReloadPage;
import com.taobao.weex.ui.action.BasicGraphicAction;
import com.taobao.weex.ui.action.GraphicActionAddElement;
import com.taobao.weex.ui.action.GraphicActionAddEvent;
import com.taobao.weex.ui.action.GraphicActionAppendTreeCreateFinish;
import com.taobao.weex.ui.action.GraphicActionCreateBody;
import com.taobao.weex.ui.action.GraphicActionCreateFinish;
import com.taobao.weex.ui.action.GraphicActionLayout;
import com.taobao.weex.ui.action.GraphicActionMoveElement;
import com.taobao.weex.ui.action.GraphicActionRefreshFinish;
import com.taobao.weex.ui.action.GraphicActionRemoveElement;
import com.taobao.weex.ui.action.GraphicActionRemoveEvent;
import com.taobao.weex.ui.action.GraphicActionRenderSuccess;
import com.taobao.weex.ui.action.GraphicActionUpdateAttr;
import com.taobao.weex.ui.action.GraphicActionUpdateStyle;
import com.taobao.weex.ui.action.GraphicPosition;
import com.taobao.weex.ui.action.GraphicSize;
import com.taobao.weex.ui.component.WXComponent;
import com.taobao.weex.ui.module.WXDomModule;
import com.taobao.weex.utils.WXExceptionUtils;
Expand All @@ -60,7 +87,6 @@
import com.taobao.weex.utils.WXWsonJSONSwitch;
import com.taobao.weex.utils.batch.BactchExecutor;
import com.taobao.weex.utils.batch.Interceptor;

import java.io.BufferedReader;
import java.io.File;
import java.io.FileInputStream;
Expand All @@ -84,8 +110,6 @@
import java.util.concurrent.TimeUnit;
import java.util.regex.Pattern;

import static com.taobao.weex.bridge.WXModuleManager.createDomModule;

/**
* Manager class for communication between JavaScript and Android.
* <ol>
Expand Down Expand Up @@ -1563,33 +1587,22 @@ public BundType getBundleType(String url, String temp) {
}
}
if (temp != null) {
if (temp.startsWith("// { \"framework\": \"Vue\" }") ||
temp.startsWith("// { \"framework\": \"vue\" }") ||
temp.startsWith("// {\"framework\" : \"Vue\"}") ||
temp.startsWith("// {\"framework\" : \"vue\"}")) {
final String FRAMEWORK="framework", VUE="vue", RAX="rax";

// Find the first line that starts with '//' and convert it to json
int bundleTypeStart = temp.indexOf("//");
int bundleTypeEnd = temp.indexOf("\n", bundleTypeStart);
JSONObject bundleType = JSONObject.parseObject(
temp.substring(bundleTypeStart+2, bundleTypeEnd));
String type = bundleType.getString(FRAMEWORK);
if(VUE.equalsIgnoreCase(type)){
return BundType.Vue;
} else if (temp.startsWith("// { \"framework\": \"Rax\" }") ||
temp.startsWith("// { \"framework\": \"rax\" }")
|| temp.startsWith("// {\"framework\" : \"Rax\"}") ||
temp.startsWith("// {\"framework\" : \"rax\"}")) {
}
else if(RAX.equalsIgnoreCase(type)){
return BundType.Rax;
} else {
if (temp.length() > 500) {
temp = temp.substring(0, 500);
}
String strTrim = temp.replaceAll("\n","").trim();
if (strTrim.startsWith("// { \"framework\": \"Vue\" }") ||
strTrim.startsWith("// { \"framework\": \"vue\" }") ||
strTrim.startsWith("// {\"framework\" : \"Vue\"}") ||
strTrim.startsWith("// {\"framework\" : \"vue\"}")) {
return BundType.Vue;
} else if (strTrim.startsWith("// { \"framework\": \"Rax\" }") ||
strTrim.startsWith("// { \"framework\": \"rax\" }")
|| strTrim.startsWith("// {\"framework\" : \"Rax\"}") ||
strTrim.startsWith("// {\"framework\" : \"rax\"}")) {
return BundType.Rax;
}

}
else{
// '//{ "framework": "Vue"}' is not found.
String regEx = "(use)(\\s+)(weex:vue)";
Pattern pattern = Pattern.compile(regEx, Pattern.CASE_INSENSITIVE);
if (pattern.matcher(temp).find()) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -107,6 +107,7 @@ public class WXInstanceApm {

/************** value *****************/
public static final String VALUE_ERROR_CODE_DEFAULT = "0";
public static final String VALUE_BUNDLE_LOAD_LENGTH = "wxLoadedLength";

private String mInstanceId;
private IWXApmMonitorAdapter apmInstance;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,9 @@ public static void commitCriticalExceptionWithDefaultUrl(

if (null != instance) {
bundleUrlCommit = instance.getApmForInstance().reportPageName;
Object loadLength = instance.getApmForInstance().extInfo.get(WXInstanceApm.VALUE_BUNDLE_LOAD_LENGTH);
String loadLengthStr = (loadLength instanceof Integer)?String.valueOf(loadLength):"unknownLength";
commitMap.put(WXInstanceApm.VALUE_BUNDLE_LOAD_LENGTH,loadLengthStr);
commitMap.put("templateInfo",instance.getTemplateInfo());
if (TextUtils.isEmpty(bundleUrlCommit) || bundleUrlCommit.equals(WXPerformance.DEFAULT)) {
if (!TextUtils.equals(degradeUrl, "BundleUrlDefaultDegradeUrl")) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -72,8 +72,9 @@ public static void renderPerformanceLog(String type, long time) {
}

private static void log(String tag, String msg, LogLevel level){
if(msg == null || tag == null || level == null)
if(TextUtils.isEmpty(msg) || TextUtils.isEmpty(tag) || level == null || TextUtils.isEmpty(level.getName())){
return;
}

if(sLogWatcher !=null){
sLogWatcher.onLog(level.getName(), tag, msg);
Expand Down
4 changes: 3 additions & 1 deletion ios/sdk/WeexSDK/Sources/Display/WXComponent+Display.m
Original file line number Diff line number Diff line change
Expand Up @@ -581,7 +581,9 @@ - (BOOL)_bitmapOpaqueWithSize:(CGSize)size
- (CAShapeLayer *)drawBorderRadiusMaskLayer:(CGRect)rect
{
if ([self hasBorderRadiusMaskLayer]) {
UIBezierPath *bezierPath = [UIBezierPath wx_bezierPathWithRoundedRect:rect topLeft:_borderTopLeftRadius topRight:_borderTopRightRadius bottomLeft:_borderBottomLeftRadius bottomRight:_borderBottomRightRadius];
WXRoundedRect *borderRect = [[WXRoundedRect alloc] initWithRect:rect topLeft:_borderTopLeftRadius topRight:_borderTopRightRadius bottomLeft:_borderBottomLeftRadius bottomRight:_borderBottomRightRadius];
WXRadii *radii = borderRect.radii;
UIBezierPath *bezierPath = [UIBezierPath wx_bezierPathWithRoundedRect:rect topLeft:radii.topLeft topRight:radii.topRight bottomLeft:radii.bottomLeft bottomRight:radii.bottomRight];
CAShapeLayer *maskLayer = [CAShapeLayer layer];
maskLayer.path = bezierPath.CGPath;
return maskLayer;
Expand Down

0 comments on commit 47c8be3

Please sign in to comment.