@vue/compiler-sfc 3.3.7 → 3.4.0-alpha.1
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
CHANGED
|
@@ -19126,7 +19126,7 @@ function genRuntimeProps(ctx) {
|
|
|
19126
19126
|
}
|
|
19127
19127
|
}
|
|
19128
19128
|
} else if (ctx.propsTypeDecl) {
|
|
19129
|
-
propsDecls =
|
|
19129
|
+
propsDecls = extractRuntimeProps(ctx);
|
|
19130
19130
|
}
|
|
19131
19131
|
const modelsDecls = genModelProps(ctx);
|
|
19132
19132
|
if (propsDecls && modelsDecls) {
|
|
@@ -19135,7 +19135,7 @@ function genRuntimeProps(ctx) {
|
|
|
19135
19135
|
return modelsDecls || propsDecls;
|
|
19136
19136
|
}
|
|
19137
19137
|
}
|
|
19138
|
-
function
|
|
19138
|
+
function extractRuntimeProps(ctx) {
|
|
19139
19139
|
const props = resolveRuntimePropsFromType(ctx, ctx.propsTypeDecl);
|
|
19140
19140
|
if (!props.length) {
|
|
19141
19141
|
return;
|
|
@@ -19144,7 +19144,7 @@ function genRuntimePropsFromTypes(ctx) {
|
|
|
19144
19144
|
const hasStaticDefaults = hasStaticWithDefaults(ctx);
|
|
19145
19145
|
for (const prop of props) {
|
|
19146
19146
|
propStrings.push(genRuntimePropFromType(ctx, prop, hasStaticDefaults));
|
|
19147
|
-
if (!(prop.key in ctx.bindingMetadata)) {
|
|
19147
|
+
if ("bindingMetadata" in ctx && !(prop.key in ctx.bindingMetadata)) {
|
|
19148
19148
|
ctx.bindingMetadata[prop.key] = "props";
|
|
19149
19149
|
}
|
|
19150
19150
|
}
|
|
@@ -20461,7 +20461,7 @@ function isStaticNode(node) {
|
|
|
20461
20461
|
return false;
|
|
20462
20462
|
}
|
|
20463
20463
|
|
|
20464
|
-
const version = "3.
|
|
20464
|
+
const version = "3.4.0-alpha.1";
|
|
20465
20465
|
const walk = estreeWalker.walk;
|
|
20466
20466
|
|
|
20467
20467
|
exports.babelParse = parser$2.parse;
|
|
@@ -20478,6 +20478,8 @@ exports.compileScript = compileScript;
|
|
|
20478
20478
|
exports.compileStyle = compileStyle;
|
|
20479
20479
|
exports.compileStyleAsync = compileStyleAsync;
|
|
20480
20480
|
exports.compileTemplate = compileTemplate;
|
|
20481
|
+
exports.extractRuntimeEmits = extractRuntimeEmits;
|
|
20482
|
+
exports.extractRuntimeProps = extractRuntimeProps;
|
|
20481
20483
|
exports.inferRuntimeType = inferRuntimeType;
|
|
20482
20484
|
exports.invalidateTypeCache = invalidateTypeCache;
|
|
20483
20485
|
exports.parse = parse$2;
|
package/dist/compiler-sfc.d.ts
CHANGED
|
@@ -293,6 +293,7 @@ type PropsDestructureBindings = Record<string, // public prop key
|
|
|
293
293
|
local: string;
|
|
294
294
|
default?: Expression;
|
|
295
295
|
}>;
|
|
296
|
+
export declare function extractRuntimeProps(ctx: TypeResolveContext): string | undefined;
|
|
296
297
|
|
|
297
298
|
interface ModelDecl {
|
|
298
299
|
type: TSType | undefined;
|
|
@@ -404,6 +405,7 @@ export declare class ScriptCompileContext {
|
|
|
404
405
|
error(msg: string, node: Node, scope?: TypeScope): never;
|
|
405
406
|
}
|
|
406
407
|
|
|
408
|
+
export type SimpleTypeResolveOptions = Partial<Pick<SFCScriptCompileOptions, 'globalTypeFiles' | 'fs' | 'babelParserPlugins' | 'isProd'>>;
|
|
407
409
|
/**
|
|
408
410
|
* TypeResolveContext is compatible with ScriptCompileContext
|
|
409
411
|
* but also allows a simpler version of it with minimal required properties
|
|
@@ -419,8 +421,9 @@ export declare class ScriptCompileContext {
|
|
|
419
421
|
* }
|
|
420
422
|
* ```
|
|
421
423
|
*/
|
|
422
|
-
export type SimpleTypeResolveContext = Pick<ScriptCompileContext, 'source' | 'filename' | 'error' | '
|
|
424
|
+
export type SimpleTypeResolveContext = Pick<ScriptCompileContext, 'source' | 'filename' | 'error' | 'helper' | 'getString' | 'propsTypeDecl' | 'propsRuntimeDefaults' | 'propsDestructuredBindings' | 'emitsTypeDecl'> & Partial<Pick<ScriptCompileContext, 'scope' | 'globalScopes' | 'deps' | 'fs'>> & {
|
|
423
425
|
ast: Statement[];
|
|
426
|
+
options: SimpleTypeResolveOptions;
|
|
424
427
|
};
|
|
425
428
|
export type TypeResolveContext = ScriptCompileContext | SimpleTypeResolveContext;
|
|
426
429
|
type Import = Pick<ImportBinding, 'source' | 'imported'>;
|
|
@@ -468,6 +471,8 @@ export declare function registerTS(_loadTS: () => typeof TS): void;
|
|
|
468
471
|
export declare function invalidateTypeCache(filename: string): void;
|
|
469
472
|
export declare function inferRuntimeType(ctx: TypeResolveContext, node: Node & MaybeWithScope, scope?: TypeScope): string[];
|
|
470
473
|
|
|
474
|
+
export declare function extractRuntimeEmits(ctx: TypeResolveContext): Set<string>;
|
|
475
|
+
|
|
471
476
|
export declare const version: string;
|
|
472
477
|
|
|
473
478
|
export declare const walk: any;
|
|
@@ -26400,6 +26400,7 @@ var CompilerDOM = /*#__PURE__*/Object.freeze({
|
|
|
26400
26400
|
CREATE_TEXT: CREATE_TEXT,
|
|
26401
26401
|
CREATE_VNODE: CREATE_VNODE,
|
|
26402
26402
|
DOMDirectiveTransforms: DOMDirectiveTransforms,
|
|
26403
|
+
DOMErrorMessages: DOMErrorMessages,
|
|
26403
26404
|
DOMNodeTransforms: DOMNodeTransforms,
|
|
26404
26405
|
FRAGMENT: FRAGMENT,
|
|
26405
26406
|
GUARD_REACTIVE_PROPS: GUARD_REACTIVE_PROPS,
|
|
@@ -26474,6 +26475,7 @@ var CompilerDOM = /*#__PURE__*/Object.freeze({
|
|
|
26474
26475
|
createTemplateLiteral: createTemplateLiteral,
|
|
26475
26476
|
createTransformContext: createTransformContext,
|
|
26476
26477
|
createVNodeCall: createVNodeCall,
|
|
26478
|
+
errorMessages: errorMessages,
|
|
26477
26479
|
extractIdentifiers: extractIdentifiers,
|
|
26478
26480
|
findDir: findDir,
|
|
26479
26481
|
findProp: findProp,
|
|
@@ -48428,7 +48430,7 @@ function genRuntimeProps(ctx) {
|
|
|
48428
48430
|
}
|
|
48429
48431
|
}
|
|
48430
48432
|
} else if (ctx.propsTypeDecl) {
|
|
48431
|
-
propsDecls =
|
|
48433
|
+
propsDecls = extractRuntimeProps(ctx);
|
|
48432
48434
|
}
|
|
48433
48435
|
const modelsDecls = genModelProps(ctx);
|
|
48434
48436
|
if (propsDecls && modelsDecls) {
|
|
@@ -48437,7 +48439,7 @@ function genRuntimeProps(ctx) {
|
|
|
48437
48439
|
return modelsDecls || propsDecls;
|
|
48438
48440
|
}
|
|
48439
48441
|
}
|
|
48440
|
-
function
|
|
48442
|
+
function extractRuntimeProps(ctx) {
|
|
48441
48443
|
const props = resolveRuntimePropsFromType(ctx, ctx.propsTypeDecl);
|
|
48442
48444
|
if (!props.length) {
|
|
48443
48445
|
return;
|
|
@@ -48446,7 +48448,7 @@ function genRuntimePropsFromTypes(ctx) {
|
|
|
48446
48448
|
const hasStaticDefaults = hasStaticWithDefaults(ctx);
|
|
48447
48449
|
for (const prop of props) {
|
|
48448
48450
|
propStrings.push(genRuntimePropFromType(ctx, prop, hasStaticDefaults));
|
|
48449
|
-
if (!(prop.key in ctx.bindingMetadata)) {
|
|
48451
|
+
if ("bindingMetadata" in ctx && !(prop.key in ctx.bindingMetadata)) {
|
|
48450
48452
|
ctx.bindingMetadata[prop.key] = "props";
|
|
48451
48453
|
}
|
|
48452
48454
|
}
|
|
@@ -49777,7 +49779,7 @@ function isStaticNode(node) {
|
|
|
49777
49779
|
return false;
|
|
49778
49780
|
}
|
|
49779
49781
|
|
|
49780
|
-
const version = "3.
|
|
49782
|
+
const version = "3.4.0-alpha.1";
|
|
49781
49783
|
const walk = walk$1;
|
|
49782
49784
|
|
|
49783
|
-
export { MagicString, parse_1$1 as babelParse, compileScript, compileStyle, compileStyleAsync, compileTemplate, extractIdentifiers, generateCodeFrame, inferRuntimeType, invalidateTypeCache, isInDestructureAssignment, isStaticProperty, parse$7 as parse, parseCache, registerTS, resolveTypeElements, rewriteDefault, rewriteDefaultAST, shouldTransform as shouldTransformRef, transform as transformRef, transformAST as transformRefAST, version, walk, walkIdentifiers };
|
|
49785
|
+
export { MagicString, parse_1$1 as babelParse, compileScript, compileStyle, compileStyleAsync, compileTemplate, extractIdentifiers, extractRuntimeEmits, extractRuntimeProps, generateCodeFrame, inferRuntimeType, invalidateTypeCache, isInDestructureAssignment, isStaticProperty, parse$7 as parse, parseCache, registerTS, resolveTypeElements, rewriteDefault, rewriteDefaultAST, shouldTransform as shouldTransformRef, transform as transformRef, transformAST as transformRefAST, version, walk, walkIdentifiers };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@vue/compiler-sfc",
|
|
3
|
-
"version": "3.
|
|
3
|
+
"version": "3.4.0-alpha.1",
|
|
4
4
|
"description": "@vue/compiler-sfc",
|
|
5
5
|
"main": "dist/compiler-sfc.cjs.js",
|
|
6
6
|
"module": "dist/compiler-sfc.esm-browser.js",
|
|
@@ -33,11 +33,11 @@
|
|
|
33
33
|
"homepage": "https://github.com/vuejs/core/tree/main/packages/compiler-sfc#readme",
|
|
34
34
|
"dependencies": {
|
|
35
35
|
"@babel/parser": "^7.23.0",
|
|
36
|
-
"@vue/compiler-core": "3.
|
|
37
|
-
"@vue/compiler-dom": "3.
|
|
38
|
-
"@vue/compiler-ssr": "3.
|
|
39
|
-
"@vue/reactivity-transform": "3.
|
|
40
|
-
"@vue/shared": "3.
|
|
36
|
+
"@vue/compiler-core": "3.4.0-alpha.1",
|
|
37
|
+
"@vue/compiler-dom": "3.4.0-alpha.1",
|
|
38
|
+
"@vue/compiler-ssr": "3.4.0-alpha.1",
|
|
39
|
+
"@vue/reactivity-transform": "3.4.0-alpha.1",
|
|
40
|
+
"@vue/shared": "3.4.0-alpha.1",
|
|
41
41
|
"estree-walker": "^2.0.2",
|
|
42
42
|
"magic-string": "^0.30.5",
|
|
43
43
|
"postcss": "^8.4.31",
|