Skip to content

fix(dev): allow performance marking in production (fix #11775) #11776

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: dev
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions packages/weex-vue-framework/factory.js
Original file line number Diff line number Diff line change
Expand Up @@ -4236,7 +4236,7 @@ function mountComponent (

var updateComponent;
/* istanbul ignore if */
if (process.env.NODE_ENV !== 'production' && config.performance && mark) {
if (config.performance && mark) {
updateComponent = function () {
var name = vm._name;
var id = vm._uid;
Expand Down Expand Up @@ -5161,7 +5161,7 @@ function initMixin (Vue) {

var startTag, endTag;
/* istanbul ignore if */
if (process.env.NODE_ENV !== 'production' && config.performance && mark) {
if (config.performance && mark) {
startTag = "vue-perf-start:" + (vm._uid);
endTag = "vue-perf-end:" + (vm._uid);
mark(startTag);
Expand Down Expand Up @@ -5200,7 +5200,7 @@ function initMixin (Vue) {
callHook(vm, 'created');

/* istanbul ignore if */
if (process.env.NODE_ENV !== 'production' && config.performance && mark) {
if (config.performance && mark) {
vm._name = formatComponentName(vm, false);
mark(endTag);
measure(("vue " + (vm._name) + " init"), startTag, endTag);
Expand Down
4 changes: 2 additions & 2 deletions src/core/instance/init.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ export function initMixin (Vue: Class<Component>) {

let startTag, endTag
/* istanbul ignore if */
if (process.env.NODE_ENV !== 'production' && config.performance && mark) {
if (config.performance && mark) {
startTag = `vue-perf-start:${vm._uid}`
endTag = `vue-perf-end:${vm._uid}`
mark(startTag)
Expand Down Expand Up @@ -59,7 +59,7 @@ export function initMixin (Vue: Class<Component>) {
callHook(vm, 'created')

/* istanbul ignore if */
if (process.env.NODE_ENV !== 'production' && config.performance && mark) {
if (config.performance && mark) {
vm._name = formatComponentName(vm, false)
mark(endTag)
measure(`vue ${vm._name} init`, startTag, endTag)
Expand Down
2 changes: 1 addition & 1 deletion src/core/instance/lifecycle.js
Original file line number Diff line number Diff line change
Expand Up @@ -168,7 +168,7 @@ export function mountComponent (

let updateComponent
/* istanbul ignore if */
if (process.env.NODE_ENV !== 'production' && config.performance && mark) {
if (config.performance && mark) {
updateComponent = () => {
const name = vm._name
const id = vm._uid
Expand Down
4 changes: 2 additions & 2 deletions src/platforms/web/entry-runtime-with-compiler.js
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ Vue.prototype.$mount = function (
}
if (template) {
/* istanbul ignore if */
if (process.env.NODE_ENV !== 'production' && config.performance && mark) {
if (config.performance && mark) {
mark('compile')
}

Expand All @@ -73,7 +73,7 @@ Vue.prototype.$mount = function (
options.staticRenderFns = staticRenderFns

/* istanbul ignore if */
if (process.env.NODE_ENV !== 'production' && config.performance && mark) {
if (config.performance && mark) {
mark('compile end')
measure(`vue ${this._name} compile`, 'compile', 'compile end')
}
Expand Down