@vue/compiler-sfc 3.2.21 → 3.2.25
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/compiler-sfc.cjs.js +14146 -14087
- package/dist/compiler-sfc.d.ts +37 -8
- package/dist/compiler-sfc.esm-browser.js +19405 -18722
- package/package.json +8 -8
package/dist/compiler-sfc.d.ts
CHANGED
|
@@ -15,13 +15,13 @@ import { ParserPlugin } from '@babel/parser';
|
|
|
15
15
|
import { RawSourceMap } from 'source-map';
|
|
16
16
|
import { Result } from 'postcss';
|
|
17
17
|
import { RootNode } from '@vue/compiler-core';
|
|
18
|
-
import { shouldTransform as shouldTransformRef } from '@vue/
|
|
18
|
+
import { shouldTransform as shouldTransformRef } from '@vue/reactivity-transform';
|
|
19
19
|
import { SourceLocation } from '@vue/compiler-core';
|
|
20
|
-
import { transform as transformRef } from '@vue/
|
|
21
|
-
import { transformAST as transformRefAST } from '@vue/
|
|
20
|
+
import { transform as transformRef } from '@vue/reactivity-transform';
|
|
21
|
+
import { transformAST as transformRefAST } from '@vue/reactivity-transform';
|
|
22
22
|
import { walkIdentifiers } from '@vue/compiler-core';
|
|
23
23
|
|
|
24
|
-
declare interface AssetURLOptions {
|
|
24
|
+
export declare interface AssetURLOptions {
|
|
25
25
|
/**
|
|
26
26
|
* If base is provided, instead of transforming relative asset urls into
|
|
27
27
|
* imports, they will be directly rewritten to absolute urls.
|
|
@@ -34,7 +34,7 @@ declare interface AssetURLOptions {
|
|
|
34
34
|
tags?: AssetURLTagConfig;
|
|
35
35
|
}
|
|
36
36
|
|
|
37
|
-
declare interface AssetURLTagConfig {
|
|
37
|
+
export declare interface AssetURLTagConfig {
|
|
38
38
|
[name: string]: string[];
|
|
39
39
|
}
|
|
40
40
|
|
|
@@ -76,6 +76,14 @@ export { extractIdentifiers }
|
|
|
76
76
|
|
|
77
77
|
export { generateCodeFrame }
|
|
78
78
|
|
|
79
|
+
declare interface ImportBinding {
|
|
80
|
+
isType: boolean;
|
|
81
|
+
imported: string;
|
|
82
|
+
source: string;
|
|
83
|
+
isFromSetup: boolean;
|
|
84
|
+
isUsedInTemplate: boolean;
|
|
85
|
+
}
|
|
86
|
+
|
|
79
87
|
export { isInDestructureAssignment }
|
|
80
88
|
|
|
81
89
|
export { isStaticProperty }
|
|
@@ -117,7 +125,20 @@ export declare interface SFCDescriptor {
|
|
|
117
125
|
styles: SFCStyleBlock[];
|
|
118
126
|
customBlocks: SFCBlock[];
|
|
119
127
|
cssVars: string[];
|
|
128
|
+
/**
|
|
129
|
+
* whether the SFC uses :slotted() modifier.
|
|
130
|
+
* this is used as a compiler optimization hint.
|
|
131
|
+
*/
|
|
120
132
|
slotted: boolean;
|
|
133
|
+
/**
|
|
134
|
+
* compare with an existing descriptor to determine whether HMR should perform
|
|
135
|
+
* a reload vs. re-render.
|
|
136
|
+
*
|
|
137
|
+
* Note: this comparison assumes the prev/next script are already identical,
|
|
138
|
+
* and only checks the special case where <script setup lang="ts"> unused import
|
|
139
|
+
* pruning result changes due to template changes.
|
|
140
|
+
*/
|
|
141
|
+
shouldForceReload: (prevImports: Record<string, ImportBinding>) => boolean;
|
|
121
142
|
}
|
|
122
143
|
|
|
123
144
|
export declare interface SFCParseOptions {
|
|
@@ -129,7 +150,7 @@ export declare interface SFCParseOptions {
|
|
|
129
150
|
compiler?: TemplateCompiler;
|
|
130
151
|
}
|
|
131
152
|
|
|
132
|
-
declare interface SFCParseResult {
|
|
153
|
+
export declare interface SFCParseResult {
|
|
133
154
|
descriptor: SFCDescriptor;
|
|
134
155
|
errors: (CompilerError | SyntaxError)[];
|
|
135
156
|
}
|
|
@@ -138,6 +159,7 @@ export declare interface SFCScriptBlock extends SFCBlock {
|
|
|
138
159
|
type: 'script';
|
|
139
160
|
setup?: string | boolean;
|
|
140
161
|
bindings?: BindingMetadata;
|
|
162
|
+
imports?: Record<string, ImportBinding>;
|
|
141
163
|
/**
|
|
142
164
|
* import('\@babel/types').Statement
|
|
143
165
|
*/
|
|
@@ -150,7 +172,7 @@ export declare interface SFCScriptBlock extends SFCBlock {
|
|
|
150
172
|
|
|
151
173
|
export declare interface SFCScriptCompileOptions {
|
|
152
174
|
/**
|
|
153
|
-
* Scope ID for prefixing injected CSS
|
|
175
|
+
* Scope ID for prefixing injected CSS variables.
|
|
154
176
|
* This must be consistent with the `id` passed to `compileStyle`.
|
|
155
177
|
*/
|
|
156
178
|
id: string;
|
|
@@ -166,15 +188,22 @@ export declare interface SFCScriptCompileOptions {
|
|
|
166
188
|
* https://babeljs.io/docs/en/babel-parser#plugins
|
|
167
189
|
*/
|
|
168
190
|
babelParserPlugins?: ParserPlugin[];
|
|
191
|
+
/**
|
|
192
|
+
* (Experimental) Enable syntax transform for using refs without `.value` and
|
|
193
|
+
* using destructured props with reactivity
|
|
194
|
+
*/
|
|
195
|
+
reactivityTransform?: boolean;
|
|
169
196
|
/**
|
|
170
197
|
* (Experimental) Enable syntax transform for using refs without `.value`
|
|
171
198
|
* https://github.com/vuejs/rfcs/discussions/369
|
|
199
|
+
* @deprecated now part of `reactivityTransform`
|
|
172
200
|
* @default false
|
|
173
201
|
*/
|
|
174
202
|
refTransform?: boolean;
|
|
175
203
|
/**
|
|
176
204
|
* (Experimental) Enable syntax transform for destructuring from defineProps()
|
|
177
205
|
* https://github.com/vuejs/rfcs/discussions/394
|
|
206
|
+
* @deprecated now part of `reactivityTransform`
|
|
178
207
|
* @default false
|
|
179
208
|
*/
|
|
180
209
|
propsDestructureTransform?: boolean;
|
|
@@ -192,7 +221,7 @@ export declare interface SFCScriptCompileOptions {
|
|
|
192
221
|
inlineTemplate?: boolean;
|
|
193
222
|
/**
|
|
194
223
|
* Options for template compilation when inlining. Note these are options that
|
|
195
|
-
* would normally be
|
|
224
|
+
* would normally be passed to `compiler-sfc`'s own `compileTemplate()`, not
|
|
196
225
|
* options passed to `compiler-dom`.
|
|
197
226
|
*/
|
|
198
227
|
templateOptions?: Partial<SFCTemplateCompileOptions>;
|