Skip to content

Commit 2991d54

Browse files
authored
improvement: esm-bundler warning (#997)
bring from: #461 #514 #583 resolve: #810
1 parent 6154508 commit 2991d54

File tree

7 files changed

+2
-21
lines changed

7 files changed

+2
-21
lines changed

docs/guide/advanced/optimization.md

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,6 @@ The `esm-bundler` builds now exposes global feature flags that can be overwritte
9393

9494
- `__VUE_I18N_FULL_INSTALL__` (enable/disable, in addition to vue-i18n APIs, components and directives all fully support installation: `true`)
9595
- `__VUE_I18N_LEGACY_API__` (enable/disable vue-i18n legacy style APIs support, default: `true`)
96-
- `__VUE_I18N_PROD_DEVTOOLS__` (enable/disable vue-devtools support in production, default: `false`)
9796
- `__INTLIFY_PROD_DEVTOOLS__` (enable/disable `@intlify/devtools` support in production, default: `false`)
9897

9998
:::warning NOTICE

jest.config.js

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -72,8 +72,7 @@ module.exports = {
7272
__ESM_BROWSER__: false,
7373
__NODE_JS__: true,
7474
__FEATURE_FULL_INSTALL__: true,
75-
__FEATURE_LEGACY_API__: true,
76-
__FEATURE_ESM_BUNDLER_WARN__: true
75+
__FEATURE_LEGACY_API__: true
7776
},
7877

7978
// The maximum amount of workers used to run your tests. Can be specified as % or a number. E.g. maxWorkers: 10% will use 10% of your CPU amount + 1 as the maximum worker number. maxWorkers: 2 will use a maximum of 2 workers.

packages/global.d.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,6 @@ declare let __FEATURE_PROD_VUE_DEVTOOLS__: boolean
1515
declare let __FEATURE_PROD_INTLIFY_DEVTOOLS__: boolean
1616
declare let __FEATURE_LEGACY_API__: boolean
1717
declare let __FEATURE_FULL_INSTALL__: boolean
18-
declare let __FEATURE_ESM_BUNDLER_WARN__: boolean
1918

2019
// for tests
2120
declare namespace jest {

packages/size-check-vue-i18n/rollup.config.js

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,6 @@ const config = {
2828
__VUE_PROD_DEVTOOLS__: false,
2929
__VUE_I18N_LEGACY_API__: false,
3030
__VUE_I18N_FULL_INSTALL__: false,
31-
__VUE_I18N_PROD_DEVTOOLS__: false,
3231
__INTLIFY_PROD_DEVTOOLS__: false,
3332
'process.env.NODE_ENV': JSON.stringify('production')
3433
}),

packages/vue-i18n/README.md

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,6 @@ The `esm-bundler` builds now exposes global feature flags that can be overwritte
5252

5353
- `__VUE_I18N_FULL_INSTALL__` (enable/disable, in addition to vue-i18n APIs, components and directives all fully support installation: `true`)
5454
- `__VUE_I18N_LEGACY_API__` (enable/disable vue-i18n legacy style APIs support, default: `true`)
55-
- `__VUE_I18N_PROD_DEVTOOLS__` (enable/disable vue-devtools support in production, default: `false`)
5655
- `__INTLIFY_PROD_DEVTOOLS__` (enable/disable `@intlify/devtools` support in production, default: `false`)
5756

5857
> NOTE: `__INTLIFY_PROD_DEVTOOLS__` flag is experimental, and `@intlify/devtools` is WIP yet.
@@ -65,10 +64,6 @@ The build will work without configuring these flags, however it is **strongly re
6564

6665
Note: the replacement value **must be boolean literals** and cannot be strings, otherwise the bundler/minifier will not be able to properly evaluate the conditions.
6766

68-
## Other Feature Flags
69-
70-
- `__FEATURE_ESM_BUNDLER_WARN__` (Suppress / Not suppress feature flags recommended warnings in build for `esm-bulder`)
71-
7267
## :copyright: License
7368

7469
[MIT](http://opensource.org/licenses/MIT)

packages/vue-i18n/src/misc.ts

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -27,19 +27,10 @@ export function initFeatureFlags(): void {
2727
getGlobalThis().__VUE_I18N_LEGACY_API__ = true
2828
}
2929

30-
if (typeof __FEATURE_PROD_VUE_DEVTOOLS__ !== 'boolean') {
31-
needWarn = true
32-
getGlobalThis().__VUE_I18N_PROD_DEVTOOLS__ = false
33-
}
34-
3530
if (typeof __FEATURE_PROD_INTLIFY_DEVTOOLS__ !== 'boolean') {
3631
getGlobalThis().__INTLIFY_PROD_DEVTOOLS__ = false
3732
}
3833

39-
if (__DEV__ && typeof __FEATURE_ESM_BUNDLER_WARN__ === 'boolean') {
40-
needWarn = __FEATURE_ESM_BUNDLER_WARN__
41-
}
42-
4334
if (__DEV__ && needWarn) {
4435
console.warn(
4536
`You are running the esm-bundler build of vue-i18n. It is recommended to ` +

rollup.config.js

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -230,12 +230,11 @@ function createReplacePlugin(
230230
? `__VUE_I18N_LEGACY_API__`
231231
: true,
232232
__FEATURE_PROD_VUE_DEVTOOLS__: isBundlerESMBuild
233-
? `__VUE_I18N_PROD_DEVTOOLS__`
233+
? `__VUE_PROD_DEVTOOLS__`
234234
: false,
235235
__FEATURE_PROD_INTLIFY_DEVTOOLS__: isBundlerESMBuild
236236
? `__INTLIFY_PROD_DEVTOOLS__`
237237
: false,
238-
__FEATURE_ESM_BUNDLER_WARN__: true,
239238
preventAssignment: false,
240239
...(isProduction && isBrowserBuild
241240
? {

0 commit comments

Comments
 (0)