Skip to content

Commit 4670763

Browse files
committed
wip: warn against <template functional>
1 parent 3ea6869 commit 4670763

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

packages/compiler-sfc/src/parse.ts

+12
Original file line numberDiff line numberDiff line change
@@ -155,6 +155,18 @@ export function parse(
155155
false
156156
) as SFCTemplateBlock)
157157
templateBlock.ast = node
158+
159+
// warn against 2.x <template functional>
160+
if (templateBlock.attrs.functional) {
161+
const err = new SyntaxError(
162+
`<template functional> is no longer supported in Vue 3, since ` +
163+
`functional components no longer have significant performance ` +
164+
`difference from stateful ones. Just use a normal <template> ` +
165+
`instead.`
166+
) as CompilerError
167+
err.loc = node.props.find(p => p.name === 'functional')!.loc
168+
errors.push(err)
169+
}
158170
} else {
159171
errors.push(createDuplicateBlockError(node))
160172
}

0 commit comments

Comments
 (0)