CompilerDeprecationTypes
} from './compat/compatConfig'
-export { baseParse as newParse } from './parser/index'
+// export { baseParse as newParse } from './parser/index'
import { processExpression } from './transformExpression'
import { validateBrowserExpression } from '../validateExpression'
import { FRAGMENT, CREATE_COMMENT } from '../runtimeHelpers'
-import {
- injectProp,
- findDir,
- findProp,
- isBuiltInType,
- getMemoedVNodeCall
-} from '../utils'
+import { injectProp, findDir, findProp, getMemoedVNodeCall } from '../utils'
import { PatchFlags, PatchFlagNames } from '@vue/shared'
export const transformIf = createStructuralDirectiveTransform(
!(
context.parent &&
context.parent.type === NodeTypes.ELEMENT &&
- isBuiltInType(context.parent.tag, 'transition')
+ (context.parent.tag === 'transition' ||
+ context.parent.tag === 'Transition')
)
) {
branch.children = [...comments, ...branch.children]
GUARD_REACTIVE_PROPS,
WITH_MEMO
} from './runtimeHelpers'
-import { isString, isObject, hyphenate, extend, NOOP } from '@vue/shared'
+import { isString, isObject, extend, NOOP } from '@vue/shared'
import { PropsExpression } from './transforms/transformElement'
import { parseExpression } from '@babel/parser'
import { Expression } from '@babel/types'
export const isStaticExp = (p: JSChildNode): p is SimpleExpressionNode =>
p.type === NodeTypes.SIMPLE_EXPRESSION && p.isStatic
-export const isBuiltInType = (tag: string, expected: string): boolean =>
- tag === expected || tag === hyphenate(expected)
-
export function isCoreComponent(tag: string): symbol | void {
switch (tag) {
case 'Teleport':
TextModes,
ParserOptions,
ElementNode,
- NodeTypes,
- isBuiltInType
+ NodeTypes
} from '@vue/compiler-core'
import { isVoidTag, isHTMLTag, isSVGTag } from '@vue/shared'
import { TRANSITION, TRANSITION_GROUP } from './runtimeHelpers'
decodeEntities: __BROWSER__ ? decodeHtmlBrowser : decodeHtml,
isBuiltInComponent: (tag: string): symbol | undefined => {
- if (isBuiltInType(tag, `Transition`)) {
+ if (tag === 'Transition' || tag === 'transition') {
return TRANSITION
- } else if (isBuiltInType(tag, `TransitionGroup`)) {
+ } else if (tag === 'TransitionGroup' || tag === 'transition-group') {
return TRANSITION_GROUP
}
},
createSimpleExpression,
RootNode,
TemplateChildNode,
- findDir,
- isBuiltInType
+ findDir
} from '@vue/compiler-dom'
export const ssrInjectCssVars: NodeTransform = (node, context) => {
node.tagType === ElementTypes.COMPONENT) &&
!findDir(node, 'for')
) {
- if (isBuiltInType(node.tag, 'Suspense')) {
+ if (node.tag === 'suspense' || node.tag === 'Suspense') {
for (const child of node.children) {
if (
child.type === NodeTypes.ELEMENT &&
RootNode,
TemplateChildNode,
ParentNode,
- findDir,
- isBuiltInType
+ findDir
} from '@vue/compiler-dom'
const filterChild = (node: ParentNode) =>
if (
node.type === NodeTypes.ELEMENT &&
node.tagType === ElementTypes.COMPONENT &&
- (isBuiltInType(node.tag, 'Transition') ||
- isBuiltInType(node.tag, 'KeepAlive'))
+ (node.tag === 'transition' ||
+ node.tag === 'Transition' ||
+ node.tag === 'KeepAlive' ||
+ node.tag === 'keep-alive')
) {
const rootChildren = filterChild(context.root)
if (rootChildren.length === 1 && rootChildren[0] === node) {