Repository: incubator-weex Updated Branches: refs/heads/master 889f4a56f -> 3ae8f53a6
[WEEX-461][jsfm] remove useless trace function in js framework (#1358) Project: http://git-wip-us.apache.org/repos/asf/incubator-weex/repo Commit: http://git-wip-us.apache.org/repos/asf/incubator-weex/commit/3ae8f53a Tree: http://git-wip-us.apache.org/repos/asf/incubator-weex/tree/3ae8f53a Diff: http://git-wip-us.apache.org/repos/asf/incubator-weex/diff/3ae8f53a Branch: refs/heads/master Commit: 3ae8f53a608605a6cb76cc66e3e79ddb83214554 Parents: 889f4a5 Author: Hanks <[email protected]> Authored: Mon Jul 23 16:06:38 2018 +0800 Committer: Hanks <[email protected]> Committed: Tue Jul 24 16:54:59 2018 +0800 ---------------------------------------------------------------------- runtime/api/init.js | 3 --- runtime/bridge/debug.js | 29 ----------------------------- 2 files changed, 32 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/incubator-weex/blob/3ae8f53a/runtime/api/init.js ---------------------------------------------------------------------- diff --git a/runtime/api/init.js b/runtime/api/init.js index b5a0044..6813c5f 100644 --- a/runtime/api/init.js +++ b/runtime/api/init.js @@ -22,7 +22,6 @@ import { receiveTasks } from '../bridge/receiver' import { registerModules } from './module' import { registerComponents } from './component' import { services, register, unregister } from './service' -import { track } from '../bridge/debug' import WeexInstance from './WeexInstance' import { getDoc } from '../vdom/operation' @@ -92,7 +91,6 @@ function getFrameworkType (id) { function createInstanceContext (id, options = {}, data) { const weex = new WeexInstance(id, options) - Object.freeze(weex) const bundleType = options.bundleType || 'Vue' instanceTypeMap[id] = bundleType @@ -100,7 +98,6 @@ function createInstanceContext (id, options = {}, data) { if (!framework) { return new Error(`[JS Framework] Invalid bundle type "${bundleType}".`) } - track(id, 'bundleType', bundleType) // prepare js service const services = createServices(id, { http://git-wip-us.apache.org/repos/asf/incubator-weex/blob/3ae8f53a/runtime/bridge/debug.js ---------------------------------------------------------------------- diff --git a/runtime/bridge/debug.js b/runtime/bridge/debug.js index 6e24c6a..2aa9686 100644 --- a/runtime/bridge/debug.js +++ b/runtime/bridge/debug.js @@ -17,35 +17,6 @@ * under the License. */ -import { getTaskCenter } from '../vdom/operation' -import { isRegisteredModule } from '../api/module' - -export function track (id, type, value) { - const taskCenter = getTaskCenter(id) - if (!taskCenter || typeof taskCenter.send !== 'function') { - console.error(`[JS Framework] Failed to create tracker!`) - return - } - if (!type || !value) { - console.warn(`[JS Framework] Invalid track type (${type}) or value (${value})`) - return - } - const label = `jsfm.${type}.${value}` - try { - if (isRegisteredModule('userTrack', 'addPerfPoint')) { - const message = Object.create(null) - message[label] = '4' - taskCenter.send('module', { - module: 'userTrack', - method: 'addPerfPoint' - }, [message]) - } - } - catch (err) { - console.error(`[JS Framework] Failed to trace "${label}"!`) - } -} - export function error (...messages) { if (typeof console.error === 'function') { console.error(`[JS Framework] `, ...messages)
