refactor: remove deprecated scopeId codegen
BREAKING CHANGE: Output of SFC using `<style scoped>` generated by 3.2+ will be incompatible w/ runtime <3.2.
This commit is contained in:
@@ -234,14 +234,7 @@ export function generate(
|
||||
? args.map(arg => `${arg}: any`).join(',')
|
||||
: args.join(', ')
|
||||
|
||||
if (genScopeId && !isSetupInlined) {
|
||||
// root-level _withId wrapping is no longer necessary after 3.0.8 and is
|
||||
// a noop, it's only kept so that code compiled with 3.0.8+ can run with
|
||||
// runtime < 3.0.8.
|
||||
// TODO: consider removing in 3.1
|
||||
push(`const ${functionName} = ${PURE_ANNOTATION}${WITH_ID}(`)
|
||||
}
|
||||
if (isSetupInlined || genScopeId) {
|
||||
if (isSetupInlined) {
|
||||
push(`(${signature}) => {`)
|
||||
} else {
|
||||
push(`function ${functionName}(${signature}) {`)
|
||||
@@ -390,14 +383,7 @@ function genModulePreamble(
|
||||
genScopeId: boolean,
|
||||
inline?: boolean
|
||||
) {
|
||||
const {
|
||||
push,
|
||||
newline,
|
||||
optimizeImports,
|
||||
runtimeModuleName,
|
||||
scopeId,
|
||||
helper
|
||||
} = context
|
||||
const { push, newline, optimizeImports, runtimeModuleName } = context
|
||||
|
||||
if (genScopeId) {
|
||||
ast.helpers.push(WITH_SCOPE_ID)
|
||||
@@ -446,18 +432,6 @@ function genModulePreamble(
|
||||
newline()
|
||||
}
|
||||
|
||||
// we technically don't need this anymore since `withCtx` already sets the
|
||||
// correct scopeId, but this is necessary for backwards compat
|
||||
// TODO: consider removing in 3.1
|
||||
if (genScopeId) {
|
||||
push(
|
||||
`const ${WITH_ID} = ${PURE_ANNOTATION}${helper(
|
||||
WITH_SCOPE_ID
|
||||
)}("${scopeId}")`
|
||||
)
|
||||
newline()
|
||||
}
|
||||
|
||||
genHoists(ast.hoists, context)
|
||||
newline()
|
||||
|
||||
|
||||
Reference in New Issue
Block a user