@vue/compiler-sfc 3.3.0-beta.2 → 3.3.0-beta.3
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
|
@@ -1109,7 +1109,7 @@ function stripTemplateString(str) {
|
|
|
1109
1109
|
}
|
|
1110
1110
|
|
|
1111
1111
|
const DEFAULT_FILENAME = "anonymous.vue";
|
|
1112
|
-
const
|
|
1112
|
+
const parseCache = createCache();
|
|
1113
1113
|
function parse$2(source, {
|
|
1114
1114
|
sourceMap = true,
|
|
1115
1115
|
filename = DEFAULT_FILENAME,
|
|
@@ -1119,7 +1119,7 @@ function parse$2(source, {
|
|
|
1119
1119
|
compiler = CompilerDOM__namespace
|
|
1120
1120
|
} = {}) {
|
|
1121
1121
|
const sourceKey = source + sourceMap + filename + sourceRoot + pad + compiler.parse;
|
|
1122
|
-
const cache =
|
|
1122
|
+
const cache = parseCache.get(sourceKey);
|
|
1123
1123
|
if (cache) {
|
|
1124
1124
|
return cache;
|
|
1125
1125
|
}
|
|
@@ -1262,7 +1262,7 @@ function parse$2(source, {
|
|
|
1262
1262
|
descriptor,
|
|
1263
1263
|
errors
|
|
1264
1264
|
};
|
|
1265
|
-
|
|
1265
|
+
parseCache.set(sourceKey, result);
|
|
1266
1266
|
return result;
|
|
1267
1267
|
}
|
|
1268
1268
|
function createDuplicateBlockError(node, isScriptSetup = false) {
|
|
@@ -20525,7 +20525,7 @@ function isStaticNode(node) {
|
|
|
20525
20525
|
}
|
|
20526
20526
|
}
|
|
20527
20527
|
|
|
20528
|
-
const version = "3.3.0-beta.
|
|
20528
|
+
const version = "3.3.0-beta.3";
|
|
20529
20529
|
const walk = estreeWalker.walk;
|
|
20530
20530
|
|
|
20531
20531
|
exports.babelParse = parser$2.parse;
|
|
@@ -20545,6 +20545,7 @@ exports.compileTemplate = compileTemplate;
|
|
|
20545
20545
|
exports.inferRuntimeType = inferRuntimeType;
|
|
20546
20546
|
exports.invalidateTypeCache = invalidateTypeCache;
|
|
20547
20547
|
exports.parse = parse$2;
|
|
20548
|
+
exports.parseCache = parseCache;
|
|
20548
20549
|
exports.registerTS = registerTS;
|
|
20549
20550
|
exports.resolveTypeElements = resolveTypeElements;
|
|
20550
20551
|
exports.rewriteDefault = rewriteDefault;
|
package/dist/compiler-sfc.d.ts
CHANGED
|
@@ -228,6 +228,9 @@ export interface SFCParseResult {
|
|
|
228
228
|
descriptor: SFCDescriptor;
|
|
229
229
|
errors: (CompilerError | SyntaxError)[];
|
|
230
230
|
}
|
|
231
|
+
export declare const parseCache: Map<string, SFCParseResult> & {
|
|
232
|
+
max?: number | undefined;
|
|
233
|
+
};
|
|
231
234
|
export declare function parse(source: string, { sourceMap, filename, sourceRoot, pad, ignoreEmpty, compiler }?: SFCParseOptions): SFCParseResult;
|
|
232
235
|
|
|
233
236
|
type PreprocessLang = 'less' | 'sass' | 'scss' | 'styl' | 'stylus';
|
|
@@ -15783,6 +15783,7 @@ function parseAttributes(context, type) {
|
|
|
15783
15783
|
return props;
|
|
15784
15784
|
}
|
|
15785
15785
|
function parseAttribute(context, nameSet) {
|
|
15786
|
+
var _a;
|
|
15786
15787
|
const start = getCursor(context);
|
|
15787
15788
|
const match = /^[^\t\r\n\f />][^\t\r\n\f />=]*/.exec(context.source);
|
|
15788
15789
|
const name = match[0];
|
|
@@ -15825,7 +15826,10 @@ function parseAttribute(context, nameSet) {
|
|
|
15825
15826
|
let arg;
|
|
15826
15827
|
if (match2[2]) {
|
|
15827
15828
|
const isSlot = dirName === "slot";
|
|
15828
|
-
const startOffset = name.lastIndexOf(
|
|
15829
|
+
const startOffset = name.lastIndexOf(
|
|
15830
|
+
match2[2],
|
|
15831
|
+
name.length - (((_a = match2[3]) == null ? void 0 : _a.length) || 0)
|
|
15832
|
+
);
|
|
15829
15833
|
const loc2 = getSelection(
|
|
15830
15834
|
context,
|
|
15831
15835
|
getNewPosition(context, start, startOffset),
|
|
@@ -26699,7 +26703,7 @@ var __spreadValues$a = (a, b) => {
|
|
|
26699
26703
|
return a;
|
|
26700
26704
|
};
|
|
26701
26705
|
const DEFAULT_FILENAME = "anonymous.vue";
|
|
26702
|
-
const
|
|
26706
|
+
const parseCache = createCache();
|
|
26703
26707
|
function parse$7(source, {
|
|
26704
26708
|
sourceMap = true,
|
|
26705
26709
|
filename = DEFAULT_FILENAME,
|
|
@@ -26709,7 +26713,7 @@ function parse$7(source, {
|
|
|
26709
26713
|
compiler = CompilerDOM
|
|
26710
26714
|
} = {}) {
|
|
26711
26715
|
const sourceKey = source + sourceMap + filename + sourceRoot + pad + compiler.parse;
|
|
26712
|
-
const cache =
|
|
26716
|
+
const cache = parseCache.get(sourceKey);
|
|
26713
26717
|
if (cache) {
|
|
26714
26718
|
return cache;
|
|
26715
26719
|
}
|
|
@@ -26852,7 +26856,7 @@ function parse$7(source, {
|
|
|
26852
26856
|
descriptor,
|
|
26853
26857
|
errors
|
|
26854
26858
|
};
|
|
26855
|
-
|
|
26859
|
+
parseCache.set(sourceKey, result);
|
|
26856
26860
|
return result;
|
|
26857
26861
|
}
|
|
26858
26862
|
function createDuplicateBlockError(node, isScriptSetup = false) {
|
|
@@ -50217,7 +50221,7 @@ function isStaticNode(node) {
|
|
|
50217
50221
|
}
|
|
50218
50222
|
}
|
|
50219
50223
|
|
|
50220
|
-
const version = "3.3.0-beta.
|
|
50224
|
+
const version = "3.3.0-beta.3";
|
|
50221
50225
|
const walk = walk$1;
|
|
50222
50226
|
|
|
50223
|
-
export { MagicString, parse_1$1 as babelParse, compileScript, compileStyle, compileStyleAsync, compileTemplate, extractIdentifiers, generateCodeFrame, inferRuntimeType, invalidateTypeCache, isInDestructureAssignment, isStaticProperty, parse$7 as parse, registerTS, resolveTypeElements, rewriteDefault, rewriteDefaultAST, shouldTransform as shouldTransformRef, transform as transformRef, transformAST as transformRefAST, version, walk, walkIdentifiers };
|
|
50227
|
+
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 };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@vue/compiler-sfc",
|
|
3
|
-
"version": "3.3.0-beta.
|
|
3
|
+
"version": "3.3.0-beta.3",
|
|
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.20.15",
|
|
36
|
-
"@vue/compiler-core": "3.3.0-beta.
|
|
37
|
-
"@vue/compiler-dom": "3.3.0-beta.
|
|
38
|
-
"@vue/compiler-ssr": "3.3.0-beta.
|
|
39
|
-
"@vue/reactivity-transform": "3.3.0-beta.
|
|
40
|
-
"@vue/shared": "3.3.0-beta.
|
|
36
|
+
"@vue/compiler-core": "3.3.0-beta.3",
|
|
37
|
+
"@vue/compiler-dom": "3.3.0-beta.3",
|
|
38
|
+
"@vue/compiler-ssr": "3.3.0-beta.3",
|
|
39
|
+
"@vue/reactivity-transform": "3.3.0-beta.3",
|
|
40
|
+
"@vue/shared": "3.3.0-beta.3",
|
|
41
41
|
"estree-walker": "^2.0.2",
|
|
42
42
|
"magic-string": "^0.30.0",
|
|
43
43
|
"postcss": "^8.1.10",
|