@vue/compiler-sfc 3.4.0-alpha.1 → 3.4.0-alpha.2

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.
@@ -1,7 +1,6 @@
1
- import * as lru_cache_min from 'lru-cache/min';
2
1
  import * as _babel_types from '@babel/types';
3
2
  import { Statement, Expression, TSType, Program, CallExpression, Node, ObjectPattern, TSModuleDeclaration, TSPropertySignature, TSMethodSignature, TSCallSignatureDeclaration, TSFunctionType } from '@babel/types';
4
- import { CompilerOptions, CodegenResult, ParserOptions, RootNode, CompilerError, SourceLocation, ElementNode, BindingMetadata as BindingMetadata$1 } from '@vue/compiler-core';
3
+ import { RootNode, CompilerOptions, CodegenResult, ParserOptions, CompilerError, SourceLocation, BindingMetadata as BindingMetadata$1 } from '@vue/compiler-core';
5
4
  export { BindingMetadata, CompilerError, CompilerOptions, extractIdentifiers, generateCodeFrame, isInDestructureAssignment, isStaticProperty, walkIdentifiers } from '@vue/compiler-core';
6
5
  import { RawSourceMap } from 'source-map-js';
7
6
  import { ParserPlugin } from '@babel/parser';
@@ -10,7 +9,6 @@ import { Result, LazyResult } from 'postcss';
10
9
  import MagicString from 'magic-string';
11
10
  export { default as MagicString } from 'magic-string';
12
11
  import TS from 'typescript';
13
- export { shouldTransform as shouldTransformRef, transform as transformRef, transformAST as transformRefAST } from '@vue/reactivity-transform';
14
12
 
15
13
  export interface AssetURLTagConfig {
16
14
  [name: string]: string[];
@@ -29,7 +27,7 @@ export interface AssetURLOptions {
29
27
  }
30
28
 
31
29
  export interface TemplateCompiler {
32
- compile(template: string, options: CompilerOptions): CodegenResult;
30
+ compile(source: string | RootNode, options: CompilerOptions): CodegenResult;
33
31
  parse(template: string, options: ParserOptions): RootNode;
34
32
  }
35
33
  export interface SFCTemplateCompileResults {
@@ -43,6 +41,7 @@ export interface SFCTemplateCompileResults {
43
41
  }
44
42
  export interface SFCTemplateCompileOptions {
45
43
  source: string;
44
+ ast?: RootNode;
46
45
  filename: string;
47
46
  id: string;
48
47
  scoped?: boolean;
@@ -137,14 +136,6 @@ export interface SFCScriptCompileOptions {
137
136
  fileExists(file: string): boolean;
138
137
  readFile(file: string): string | undefined;
139
138
  };
140
- /**
141
- * (Experimental) Enable syntax transform for using refs without `.value` and
142
- * using destructured props with reactivity
143
- * @deprecated the Reactivity Transform proposal has been dropped. This
144
- * feature will be removed from Vue core in 3.4. If you intend to continue
145
- * using it, disable this and switch to the [Vue Macros implementation](https://vue-macros.sxzz.moe/features/reactivity-transform.html).
146
- */
147
- reactivityTransform?: boolean;
148
139
  }
149
140
  interface ImportBinding {
150
141
  isType: boolean;
@@ -180,7 +171,7 @@ export interface SFCBlock {
180
171
  }
181
172
  export interface SFCTemplateBlock extends SFCBlock {
182
173
  type: 'template';
183
- ast: ElementNode;
174
+ ast?: RootNode;
184
175
  }
185
176
  export interface SFCScriptBlock extends SFCBlock {
186
177
  type: 'script';
@@ -230,7 +221,6 @@ export interface SFCParseResult {
230
221
  descriptor: SFCDescriptor;
231
222
  errors: (CompilerError | SyntaxError)[];
232
223
  }
233
- export declare const parseCache: Map<string, SFCParseResult> | lru_cache_min.LRUCache<string, SFCParseResult, unknown>;
234
224
  export declare function parse(source: string, { sourceMap, filename, sourceRoot, pad, ignoreEmpty, compiler }?: SFCParseOptions): SFCParseResult;
235
225
 
236
226
  type PreprocessLang = 'less' | 'sass' | 'scss' | 'styl' | 'stylus';
@@ -475,5 +465,14 @@ export declare function extractRuntimeEmits(ctx: TypeResolveContext): Set<string
475
465
 
476
466
  export declare const version: string;
477
467
 
468
+ export declare const parseCache: Map<string, SFCParseResult>;
469
+
478
470
  export declare const walk: any;
479
471
 
472
+ /**
473
+ * @deprecated this is preserved to avoid breaking vite-plugin-vue < 5.0
474
+ * with reactivityTransform: true. The desired behavior should be silently
475
+ * ignoring the option instead of breaking.
476
+ */
477
+ export declare const shouldTransformRef: () => boolean;
478
+