__TEST__: true,
__VERSION__: require('./package.json').version,
__BROWSER__: false,
- __BUNDLER__: true,
__RUNTIME_COMPILE__: true,
__GLOBAL__: false,
__NODE_JS__: true,
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
vnode.appContext = context
// HMR root reload
- if (__BUNDLER__ && __DEV__) {
+ if (__DEV__) {
context.reload = () => {
render(cloneVNode(vnode), rootContainer)
}
// 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 &&
// 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
import { invokeDirectiveHook } from './directives'
import { startMeasure, endMeasure } from './profiling'
-const __HMR__ = __BUNDLER__ && __DEV__
-
export interface Renderer<HostElement = any> {
render: RootRenderFunction<HostElement>
createApp: CreateAppFunction<HostElement>
invokeDirectiveHook(n2, n1, parentComponent, 'beforeUpdate')
}
- if (__HMR__ && parentComponent && parentComponent.renderUpdated) {
+ if (__DEV__ && parentComponent && parentComponent.renderUpdated) {
// HMR updated, force full diff
patchFlag = 0
optimized = false
optimized = true
}
- if (__HMR__ && parentComponent && parentComponent.renderUpdated) {
+ if (__DEV__ && parentComponent && parentComponent.renderUpdated) {
// HMR updated, force full diff
patchFlag = 0
optimized = false
parentSuspense
))
- if (__HMR__ && instance.type.__hmrId) {
+ if (__DEV__ && instance.type.__hmrId) {
registerHMR(instance)
}
parentSuspense: SuspenseBoundary | null,
doRemove?: boolean
) => {
- if (__HMR__ && instance.type.__hmrId) {
+ if (__DEV__ && instance.type.__hmrId) {
unregisterHMR(instance)
}
export function isSameVNodeType(n1: VNode, n2: VNode): boolean {
if (
- __BUNDLER__ &&
__DEV__ &&
n2.shapeFlag & ShapeFlags.COMPONENT &&
(n2.type as Component).__hmrUpdated
__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,