) {
if (isFunction(setupResult)) {
// setup returned an inline render function
- if (!__BROWSER__ && (instance.type as ComponentOptions).__ssrInlineRender) {
+ if (__NODE_JS__ && (instance.type as ComponentOptions).__ssrInlineRender) {
// when the function's name is `ssrRender` (compiled by SFC inline mode),
// set it as ssrRender instead.
instance.ssrRender = setupResult
import { ComponentPublicInstance } from './componentPublicInstance'
export function initCustomFormatter() {
- if (!__DEV__ || !__BROWSER__) {
+ /* eslint-disable no-restricted-globals */
+ if (!__DEV__ || typeof window === 'undefined') {
return
}
return `Ref`
}
- /* eslint-disable no-restricted-globals */
if ((window as any).devtoolsFormatters) {
;(window as any).devtoolsFormatters.push(formatter)
} else {
// 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 (__DEV__ && (__BROWSER__ || __TEST__)) {
+if (__DEV__) {
const globalObject: any =
typeof global !== 'undefined'
? global
invokeDirectiveHook(n2, n1, parentComponent, 'beforeUpdate')
}
- if (__DEV__ && (__BROWSER__ || __TEST__) && isHmrUpdating) {
+ if (__DEV__ && isHmrUpdating) {
// HMR updated, force full diff
patchFlag = 0
optimized = false
parentSuspense,
areChildrenSVG
)
- if (
- __DEV__ &&
- (__BROWSER__ || __TEST__) &&
- parentComponent &&
- parentComponent.type.__hmrId
- ) {
+ if (__DEV__ && parentComponent && parentComponent.type.__hmrId) {
traverseStaticChildren(n1, n2)
}
} else if (!optimized) {
parentSuspense
))
- if (__DEV__ && (__BROWSER__ || __TEST__) && instance.type.__hmrId) {
+ if (__DEV__ && instance.type.__hmrId) {
registerHMR(instance)
}
parentSuspense: SuspenseBoundary | null,
doRemove?: boolean
) => {
- if (__DEV__ && (__BROWSER__ || __TEST__) && instance.type.__hmrId) {
+ if (__DEV__ && instance.type.__hmrId) {
unregisterHMR(instance)
}