diff --git a/jest.config.js b/jest.config.js index 622dd1c9..c88638cb 100644 --- a/jest.config.js +++ b/jest.config.js @@ -5,7 +5,6 @@ module.exports = { __TEST__: true, __VERSION__: require('./package.json').version, __BROWSER__: false, - __BUNDLER__: true, __RUNTIME_COMPILE__: true, __GLOBAL__: false, __NODE_JS__: true, diff --git a/packages/global.d.ts b/packages/global.d.ts index 3f644c9f..11d15fea 100644 --- a/packages/global.d.ts +++ b/packages/global.d.ts @@ -2,7 +2,6 @@ declare var __DEV__: boolean declare var __TEST__: boolean declare var __BROWSER__: boolean -declare var __BUNDLER__: boolean declare var __RUNTIME_COMPILE__: boolean declare var __GLOBAL__: boolean declare var __NODE_JS__: boolean diff --git a/packages/runtime-core/src/apiCreateApp.ts b/packages/runtime-core/src/apiCreateApp.ts index 63d38616..c1e0538c 100644 --- a/packages/runtime-core/src/apiCreateApp.ts +++ b/packages/runtime-core/src/apiCreateApp.ts @@ -209,7 +209,7 @@ export function createAppAPI( vnode.appContext = context // HMR root reload - if (__BUNDLER__ && __DEV__) { + if (__DEV__) { context.reload = () => { render(cloneVNode(vnode), rootContainer) } diff --git a/packages/runtime-core/src/componentRenderUtils.ts b/packages/runtime-core/src/componentRenderUtils.ts index c4b04ae7..1074edf9 100644 --- a/packages/runtime-core/src/componentRenderUtils.ts +++ b/packages/runtime-core/src/componentRenderUtils.ts @@ -213,7 +213,6 @@ export function shouldUpdateComponent( // caused the child component's slots content to have changed, we need to // force the child to update as well. if ( - __BUNDLER__ && __DEV__ && (prevChildren || nextChildren) && parentComponent && diff --git a/packages/runtime-core/src/hmr.ts b/packages/runtime-core/src/hmr.ts index cdbf91be..86115133 100644 --- a/packages/runtime-core/src/hmr.ts +++ b/packages/runtime-core/src/hmr.ts @@ -16,7 +16,7 @@ export interface HMRRuntime { // it easier to be used in toolings like vue-loader // Note: for a component to be eligible for HMR it also needs the __hmrId option // to be set so that its instances can be registered / removed. -if (__BUNDLER__ && __DEV__) { +if (__DEV__) { const globalObject: any = typeof global !== 'undefined' ? global diff --git a/packages/runtime-core/src/renderer.ts b/packages/runtime-core/src/renderer.ts index d143ab88..0df8576e 100644 --- a/packages/runtime-core/src/renderer.ts +++ b/packages/runtime-core/src/renderer.ts @@ -64,8 +64,6 @@ import { createHydrationFunctions, RootHydrateFunction } from './hydration' import { invokeDirectiveHook } from './directives' import { startMeasure, endMeasure } from './profiling' -const __HMR__ = __BUNDLER__ && __DEV__ - export interface Renderer { render: RootRenderFunction createApp: CreateAppFunction @@ -660,7 +658,7 @@ function baseCreateRenderer( invokeDirectiveHook(n2, n1, parentComponent, 'beforeUpdate') } - if (__HMR__ && parentComponent && parentComponent.renderUpdated) { + if (__DEV__ && parentComponent && parentComponent.renderUpdated) { // HMR updated, force full diff patchFlag = 0 optimized = false @@ -884,7 +882,7 @@ function baseCreateRenderer( optimized = true } - if (__HMR__ && parentComponent && parentComponent.renderUpdated) { + if (__DEV__ && parentComponent && parentComponent.renderUpdated) { // HMR updated, force full diff patchFlag = 0 optimized = false @@ -987,7 +985,7 @@ function baseCreateRenderer( parentSuspense )) - if (__HMR__ && instance.type.__hmrId) { + if (__DEV__ && instance.type.__hmrId) { registerHMR(instance) } @@ -1807,7 +1805,7 @@ function baseCreateRenderer( parentSuspense: SuspenseBoundary | null, doRemove?: boolean ) => { - if (__HMR__ && instance.type.__hmrId) { + if (__DEV__ && instance.type.__hmrId) { unregisterHMR(instance) } diff --git a/packages/runtime-core/src/vnode.ts b/packages/runtime-core/src/vnode.ts index 2277d9fd..8f494472 100644 --- a/packages/runtime-core/src/vnode.ts +++ b/packages/runtime-core/src/vnode.ts @@ -200,7 +200,6 @@ export function isVNode(value: any): value is VNode { export function isSameVNodeType(n1: VNode, n2: VNode): boolean { if ( - __BUNDLER__ && __DEV__ && n2.shapeFlag & ShapeFlags.COMPONENT && (n2.type as Component).__hmrUpdated diff --git a/rollup.config.js b/rollup.config.js index cfa8b1ce..c48021c5 100644 --- a/rollup.config.js +++ b/rollup.config.js @@ -178,8 +178,6 @@ function createReplacePlugin( __TEST__: false, // If the build is expected to run directly in the browser (global / esm builds) __BROWSER__: isBrowserBuild, - // is targeting bundlers? - __BUNDLER__: isBundlerESMBuild, __GLOBAL__: isGlobalBuild, // is targeting Node (SSR)? __NODE_JS__: isNodeBuild,