PORTAL,
RESOLVE_DYNAMIC_COMPONENT,
SUSPENSE,
- KEEP_ALIVE
+ KEEP_ALIVE,
+ BASE_TRANSITION
} from '../../src/runtimeHelpers'
import {
CallExpression,
assert(`KeepAlive`)
})
+ test('should handle <BaseTransition>', () => {
+ function assert(tag: string) {
+ const { root, node } = parseWithElementTransform(
+ `<${tag}><span /></${tag}>`
+ )
+ expect(root.components.length).toBe(0)
+ expect(root.helpers).toContain(BASE_TRANSITION)
+ expect(node.callee).toBe(CREATE_VNODE)
+ expect(node.arguments).toMatchObject([
+ BASE_TRANSITION,
+ `null`,
+ createObjectMatcher({
+ default: {
+ type: NodeTypes.JS_FUNCTION_EXPRESSION
+ },
+ _compiled: `[true]`
+ })
+ ])
+ }
+
+ assert(`base-transition`)
+ assert(`BaseTransition`)
+ })
+
test('error on v-bind with no argument', () => {
const onError = jest.fn()
parseWithElementTransform(`<div v-bind/>`, { onError })
// Portal and Fragment are native types, not components
const isBuiltInComponent = /*#__PURE__*/ makeMap(
- `suspense,keep-alive,keepalive,transition`,
+ `suspense,keep-alive,keepalive,base-transition`,
true
)
export const PORTAL = Symbol(__DEV__ ? `Portal` : ``)
export const SUSPENSE = Symbol(__DEV__ ? `Suspense` : ``)
export const KEEP_ALIVE = Symbol(__DEV__ ? `KeepAlive` : ``)
-export const TRANSITION = Symbol(__DEV__ ? `Transition` : ``)
export const BASE_TRANSITION = Symbol(__DEV__ ? `BaseTransition` : ``)
export const OPEN_BLOCK = Symbol(__DEV__ ? `openBlock` : ``)
export const CREATE_BLOCK = Symbol(__DEV__ ? `createBlock` : ``)
[PORTAL]: `Portal`,
[SUSPENSE]: `Suspense`,
[KEEP_ALIVE]: `KeepAlive`,
- [TRANSITION]: `Transition`,
[BASE_TRANSITION]: `BaseTransition`,
[OPEN_BLOCK]: `openBlock`,
[CREATE_BLOCK]: `createBlock`,
PORTAL,
SUSPENSE,
KEEP_ALIVE,
- TRANSITION
+ BASE_TRANSITION
} from '../runtimeHelpers'
import { getInnerRange, isVSlot, toValidAssetId, findProp } from '../utils'
import { buildSlots } from './vSlot'
const isPortal = isBuiltInType(tag, 'Portal')
const isSuspense = isBuiltInType(tag, 'Suspense')
const isKeepAlive = isBuiltInType(tag, 'KeepAlive')
- const isTransition = isBuiltInType(tag, 'Transition')
+ const isBaseTransition = isBuiltInType(tag, 'BaseTransition')
const isComponent = tagType === ElementTypes.COMPONENT
let hasProps = props.length > 0
nodeType = context.helper(SUSPENSE)
} else if (isKeepAlive) {
nodeType = context.helper(KEEP_ALIVE)
- } else if (isTransition) {
- nodeType = context.helper(TRANSITION)
+ } else if (isBaseTransition) {
+ nodeType = context.helper(BASE_TRANSITION)
} else if (isComponent) {
// user component w/ resolve
context.helper(RESOLVE_COMPONENT)