wip(ssr): proper scope analysis for ssr vnode slot fallback
This commit is contained in:
@@ -3,7 +3,6 @@ import {
|
||||
baseParse,
|
||||
CompilerOptions,
|
||||
CodegenResult,
|
||||
isBuiltInType,
|
||||
ParserOptions,
|
||||
RootNode,
|
||||
noopDirectiveTransform,
|
||||
@@ -18,21 +17,12 @@ import { transformVText } from './transforms/vText'
|
||||
import { transformModel } from './transforms/vModel'
|
||||
import { transformOn } from './transforms/vOn'
|
||||
import { transformShow } from './transforms/vShow'
|
||||
import { TRANSITION, TRANSITION_GROUP } from './runtimeHelpers'
|
||||
import { warnTransitionChildren } from './transforms/warnTransitionChildren'
|
||||
|
||||
export const parserOptions = __BROWSER__
|
||||
? parserOptionsMinimal
|
||||
: parserOptionsStandard
|
||||
|
||||
export const isBuiltInDOMComponent = (tag: string): symbol | undefined => {
|
||||
if (isBuiltInType(tag, `Transition`)) {
|
||||
return TRANSITION
|
||||
} else if (isBuiltInType(tag, `TransitionGroup`)) {
|
||||
return TRANSITION_GROUP
|
||||
}
|
||||
}
|
||||
|
||||
export function getDOMTransformPreset(
|
||||
prefixIdentifiers?: boolean
|
||||
): TransformPreset {
|
||||
@@ -71,8 +61,7 @@ export function compile(
|
||||
directiveTransforms: {
|
||||
...directiveTransforms,
|
||||
...(options.directiveTransforms || {})
|
||||
},
|
||||
isBuiltInComponent: isBuiltInDOMComponent
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
|
||||
@@ -3,9 +3,11 @@ import {
|
||||
ParserOptions,
|
||||
ElementNode,
|
||||
Namespaces,
|
||||
NodeTypes
|
||||
NodeTypes,
|
||||
isBuiltInType
|
||||
} from '@vue/compiler-core'
|
||||
import { makeMap, isVoidTag, isHTMLTag, isSVGTag } from '@vue/shared'
|
||||
import { TRANSITION, TRANSITION_GROUP } from './runtimeHelpers'
|
||||
|
||||
const isRawTextContainer = /*#__PURE__*/ makeMap(
|
||||
'style,iframe,script,noscript',
|
||||
@@ -23,6 +25,14 @@ export const parserOptionsMinimal: ParserOptions = {
|
||||
isNativeTag: tag => isHTMLTag(tag) || isSVGTag(tag),
|
||||
isPreTag: tag => tag === 'pre',
|
||||
|
||||
isBuiltInComponent: (tag: string): symbol | undefined => {
|
||||
if (isBuiltInType(tag, `Transition`)) {
|
||||
return TRANSITION
|
||||
} else if (isBuiltInType(tag, `TransitionGroup`)) {
|
||||
return TRANSITION_GROUP
|
||||
}
|
||||
},
|
||||
|
||||
// https://html.spec.whatwg.org/multipage/parsing.html#tree-construction-dispatcher
|
||||
getNamespace(tag: string, parent: ElementNode | undefined): DOMNamespaces {
|
||||
let ns = parent ? parent.ns : DOMNamespaces.HTML
|
||||
|
||||
Reference in New Issue
Block a user