vue-i18n icon indicating copy to clipboard operation
vue-i18n copied to clipboard

Can config add new env for disable performance measure in dev mode?

Open houfeng0923 opened this issue 2 years ago • 1 comments

Clear and concise description of the problem

hi @kazupon san, i found in dev mode, my app has more memory by PerformanceMeasure type.

performance invoked frequently by this code: https://github.com/intlify/vue-i18n-next/blob/v9.2.0-beta.21/packages/shared/src/utils.ts#L15

unless __DEV__ false in my dev mode , i have a stable memory usage.

Suggested solution

so, can i18n add a new env like __VUE_I18N_DISABLE_PERF__ , we can close this feature in dev?

Alternative

No response

Additional context

No response

Validations

houfeng0923 avatar Nov 24 '21 09:11 houfeng0923

Also hit by this performance issue on Firefox. I just found a solution. You need to force to use the production version of vue-i18n.

import { createI18n } from "vue-i18n";

Change to:

import { createI18n } from "vue-i18n/dist/vue-i18n.esm-browser.prod.js";

If you are not using esm, check under vue-i18n\dist, you could try other prod.js files.

louislam avatar Oct 10 '22 08:10 louislam

__DEV__ is for development feature flag This falg purpose is for debugging in development.

kazupon avatar Nov 15 '22 16:11 kazupon