@vue/compiler-sfc 3.3.6 → 3.3.8
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 +231 -179
- package/dist/compiler-sfc.d.ts +2 -2
- package/dist/compiler-sfc.esm-browser.js +99 -51
- package/package.json +7 -7
package/dist/compiler-sfc.cjs.js
CHANGED
|
@@ -1734,9 +1734,8 @@ function resolveTemplateUsageCheckString(sfc) {
|
|
|
1734
1734
|
code += `,v${shared.capitalize(shared.camelize(prop.name))}`;
|
|
1735
1735
|
}
|
|
1736
1736
|
if (prop.arg && !prop.arg.isStatic) {
|
|
1737
|
-
code += `,${
|
|
1738
|
-
prop.arg.content
|
|
1739
|
-
prop.name
|
|
1737
|
+
code += `,${stripStrings(
|
|
1738
|
+
prop.arg.content
|
|
1740
1739
|
)}`;
|
|
1741
1740
|
}
|
|
1742
1741
|
if (prop.exp) {
|
|
@@ -1798,7 +1797,7 @@ function stripTemplateString(str) {
|
|
|
1798
1797
|
}
|
|
1799
1798
|
|
|
1800
1799
|
const DEFAULT_FILENAME = "anonymous.vue";
|
|
1801
|
-
const parseCache = createCache();
|
|
1800
|
+
const parseCache$1 = createCache();
|
|
1802
1801
|
function parse$2(source, {
|
|
1803
1802
|
sourceMap = true,
|
|
1804
1803
|
filename = DEFAULT_FILENAME,
|
|
@@ -1808,7 +1807,7 @@ function parse$2(source, {
|
|
|
1808
1807
|
compiler = CompilerDOM__namespace
|
|
1809
1808
|
} = {}) {
|
|
1810
1809
|
const sourceKey = source + sourceMap + filename + sourceRoot + pad + compiler.parse;
|
|
1811
|
-
const cache = parseCache.get(sourceKey);
|
|
1810
|
+
const cache = parseCache$1.get(sourceKey);
|
|
1812
1811
|
if (cache) {
|
|
1813
1812
|
return cache;
|
|
1814
1813
|
}
|
|
@@ -1951,7 +1950,7 @@ function parse$2(source, {
|
|
|
1951
1950
|
descriptor,
|
|
1952
1951
|
errors
|
|
1953
1952
|
};
|
|
1954
|
-
parseCache.set(sourceKey, result);
|
|
1953
|
+
parseCache$1.set(sourceKey, result);
|
|
1955
1954
|
return result;
|
|
1956
1955
|
}
|
|
1957
1956
|
function createDuplicateBlockError(node, isScriptSetup = false) {
|
|
@@ -4257,6 +4256,7 @@ function doCompileTemplate({
|
|
|
4257
4256
|
slotted,
|
|
4258
4257
|
sourceMap: true,
|
|
4259
4258
|
...compilerOptions,
|
|
4259
|
+
hmr: !isProd,
|
|
4260
4260
|
nodeTransforms: nodeTransforms.concat(compilerOptions.nodeTransforms || []),
|
|
4261
4261
|
filename,
|
|
4262
4262
|
onError: (e) => errors.push(e),
|
|
@@ -11857,6 +11857,122 @@ function words(string, pattern, guard) {
|
|
|
11857
11857
|
|
|
11858
11858
|
var lodash_camelcase = camelCase;
|
|
11859
11859
|
|
|
11860
|
+
var BulkUpdateDecorator_1;
|
|
11861
|
+
var hasRequiredBulkUpdateDecorator;
|
|
11862
|
+
|
|
11863
|
+
function requireBulkUpdateDecorator () {
|
|
11864
|
+
if (hasRequiredBulkUpdateDecorator) return BulkUpdateDecorator_1;
|
|
11865
|
+
hasRequiredBulkUpdateDecorator = 1;
|
|
11866
|
+
const BULK_SIZE = 2000;
|
|
11867
|
+
|
|
11868
|
+
// We are using an object instead of a Map as this will stay static during the runtime
|
|
11869
|
+
// so access to it can be optimized by v8
|
|
11870
|
+
const digestCaches = {};
|
|
11871
|
+
|
|
11872
|
+
class BulkUpdateDecorator {
|
|
11873
|
+
/**
|
|
11874
|
+
* @param {Hash | function(): Hash} hashOrFactory function to create a hash
|
|
11875
|
+
* @param {string=} hashKey key for caching
|
|
11876
|
+
*/
|
|
11877
|
+
constructor(hashOrFactory, hashKey) {
|
|
11878
|
+
this.hashKey = hashKey;
|
|
11879
|
+
|
|
11880
|
+
if (typeof hashOrFactory === "function") {
|
|
11881
|
+
this.hashFactory = hashOrFactory;
|
|
11882
|
+
this.hash = undefined;
|
|
11883
|
+
} else {
|
|
11884
|
+
this.hashFactory = undefined;
|
|
11885
|
+
this.hash = hashOrFactory;
|
|
11886
|
+
}
|
|
11887
|
+
|
|
11888
|
+
this.buffer = "";
|
|
11889
|
+
}
|
|
11890
|
+
|
|
11891
|
+
/**
|
|
11892
|
+
* Update hash {@link https://nodejs.org/api/crypto.html#crypto_hash_update_data_inputencoding}
|
|
11893
|
+
* @param {string|Buffer} data data
|
|
11894
|
+
* @param {string=} inputEncoding data encoding
|
|
11895
|
+
* @returns {this} updated hash
|
|
11896
|
+
*/
|
|
11897
|
+
update(data, inputEncoding) {
|
|
11898
|
+
if (
|
|
11899
|
+
inputEncoding !== undefined ||
|
|
11900
|
+
typeof data !== "string" ||
|
|
11901
|
+
data.length > BULK_SIZE
|
|
11902
|
+
) {
|
|
11903
|
+
if (this.hash === undefined) {
|
|
11904
|
+
this.hash = this.hashFactory();
|
|
11905
|
+
}
|
|
11906
|
+
|
|
11907
|
+
if (this.buffer.length > 0) {
|
|
11908
|
+
this.hash.update(this.buffer);
|
|
11909
|
+
this.buffer = "";
|
|
11910
|
+
}
|
|
11911
|
+
|
|
11912
|
+
this.hash.update(data, inputEncoding);
|
|
11913
|
+
} else {
|
|
11914
|
+
this.buffer += data;
|
|
11915
|
+
|
|
11916
|
+
if (this.buffer.length > BULK_SIZE) {
|
|
11917
|
+
if (this.hash === undefined) {
|
|
11918
|
+
this.hash = this.hashFactory();
|
|
11919
|
+
}
|
|
11920
|
+
|
|
11921
|
+
this.hash.update(this.buffer);
|
|
11922
|
+
this.buffer = "";
|
|
11923
|
+
}
|
|
11924
|
+
}
|
|
11925
|
+
|
|
11926
|
+
return this;
|
|
11927
|
+
}
|
|
11928
|
+
|
|
11929
|
+
/**
|
|
11930
|
+
* Calculates the digest {@link https://nodejs.org/api/crypto.html#crypto_hash_digest_encoding}
|
|
11931
|
+
* @param {string=} encoding encoding of the return value
|
|
11932
|
+
* @returns {string|Buffer} digest
|
|
11933
|
+
*/
|
|
11934
|
+
digest(encoding) {
|
|
11935
|
+
let digestCache;
|
|
11936
|
+
|
|
11937
|
+
const buffer = this.buffer;
|
|
11938
|
+
|
|
11939
|
+
if (this.hash === undefined) {
|
|
11940
|
+
// short data for hash, we can use caching
|
|
11941
|
+
const cacheKey = `${this.hashKey}-${encoding}`;
|
|
11942
|
+
|
|
11943
|
+
digestCache = digestCaches[cacheKey];
|
|
11944
|
+
|
|
11945
|
+
if (digestCache === undefined) {
|
|
11946
|
+
digestCache = digestCaches[cacheKey] = new Map();
|
|
11947
|
+
}
|
|
11948
|
+
|
|
11949
|
+
const cacheEntry = digestCache.get(buffer);
|
|
11950
|
+
|
|
11951
|
+
if (cacheEntry !== undefined) {
|
|
11952
|
+
return cacheEntry;
|
|
11953
|
+
}
|
|
11954
|
+
|
|
11955
|
+
this.hash = this.hashFactory();
|
|
11956
|
+
}
|
|
11957
|
+
|
|
11958
|
+
if (buffer.length > 0) {
|
|
11959
|
+
this.hash.update(buffer);
|
|
11960
|
+
}
|
|
11961
|
+
|
|
11962
|
+
const digestResult = this.hash.digest(encoding);
|
|
11963
|
+
|
|
11964
|
+
if (digestCache !== undefined) {
|
|
11965
|
+
digestCache.set(buffer, digestResult);
|
|
11966
|
+
}
|
|
11967
|
+
|
|
11968
|
+
return digestResult;
|
|
11969
|
+
}
|
|
11970
|
+
}
|
|
11971
|
+
|
|
11972
|
+
BulkUpdateDecorator_1 = BulkUpdateDecorator;
|
|
11973
|
+
return BulkUpdateDecorator_1;
|
|
11974
|
+
}
|
|
11975
|
+
|
|
11860
11976
|
var wasmHash = {exports: {}};
|
|
11861
11977
|
|
|
11862
11978
|
/*
|
|
@@ -12079,27 +12195,27 @@ function requireWasmHash () {
|
|
|
12079
12195
|
Author Tobias Koppers @sokra
|
|
12080
12196
|
*/
|
|
12081
12197
|
|
|
12082
|
-
var
|
|
12083
|
-
var
|
|
12198
|
+
var md4_1;
|
|
12199
|
+
var hasRequiredMd4;
|
|
12084
12200
|
|
|
12085
|
-
function
|
|
12086
|
-
if (
|
|
12087
|
-
|
|
12201
|
+
function requireMd4 () {
|
|
12202
|
+
if (hasRequiredMd4) return md4_1;
|
|
12203
|
+
hasRequiredMd4 = 1;
|
|
12088
12204
|
|
|
12089
12205
|
const create = requireWasmHash();
|
|
12090
12206
|
|
|
12091
|
-
//#region wasm code:
|
|
12092
|
-
const
|
|
12207
|
+
//#region wasm code: md4 (../../../assembly/hash/md4.asm.ts) --initialMemory 1
|
|
12208
|
+
const md4 = new WebAssembly.Module(
|
|
12093
12209
|
Buffer.from(
|
|
12094
|
-
//
|
|
12095
|
-
"
|
|
12210
|
+
// 2150 bytes
|
|
12211
|
+
"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",
|
|
12096
12212
|
"base64"
|
|
12097
12213
|
)
|
|
12098
12214
|
);
|
|
12099
12215
|
//#endregion
|
|
12100
12216
|
|
|
12101
|
-
|
|
12102
|
-
return
|
|
12217
|
+
md4_1 = create.bind(null, md4, [], 64, 32);
|
|
12218
|
+
return md4_1;
|
|
12103
12219
|
}
|
|
12104
12220
|
|
|
12105
12221
|
var BatchedHash_1;
|
|
@@ -12180,143 +12296,27 @@ function requireBatchedHash () {
|
|
|
12180
12296
|
Author Tobias Koppers @sokra
|
|
12181
12297
|
*/
|
|
12182
12298
|
|
|
12183
|
-
var
|
|
12184
|
-
var
|
|
12299
|
+
var xxhash64_1;
|
|
12300
|
+
var hasRequiredXxhash64;
|
|
12185
12301
|
|
|
12186
|
-
function
|
|
12187
|
-
if (
|
|
12188
|
-
|
|
12302
|
+
function requireXxhash64 () {
|
|
12303
|
+
if (hasRequiredXxhash64) return xxhash64_1;
|
|
12304
|
+
hasRequiredXxhash64 = 1;
|
|
12189
12305
|
|
|
12190
12306
|
const create = requireWasmHash();
|
|
12191
12307
|
|
|
12192
|
-
//#region wasm code:
|
|
12193
|
-
const
|
|
12308
|
+
//#region wasm code: xxhash64 (../../../assembly/hash/xxhash64.asm.ts) --initialMemory 1
|
|
12309
|
+
const xxhash64 = new WebAssembly.Module(
|
|
12194
12310
|
Buffer.from(
|
|
12195
|
-
//
|
|
12196
|
-
"
|
|
12311
|
+
// 1173 bytes
|
|
12312
|
+
"AGFzbQEAAAABCAJgAX8AYAAAAwQDAQAABQMBAAEGGgV+AUIAC34BQgALfgFCAAt+AUIAC34BQgALByIEBGluaXQAAAZ1cGRhdGUAAQVmaW5hbAACBm1lbW9yeQIACrUIAzAAQtbrgu7q/Yn14AAkAELP1tO+0ser2UIkAUIAJAJC+erQ0OfJoeThACQDQgAkBAvUAQIBfwR+IABFBEAPCyMEIACtfCQEIwAhAiMBIQMjAiEEIwMhBQNAIAIgASkDAELP1tO+0ser2UJ+fEIfiUKHla+vmLbem55/fiECIAMgASkDCELP1tO+0ser2UJ+fEIfiUKHla+vmLbem55/fiEDIAQgASkDEELP1tO+0ser2UJ+fEIfiUKHla+vmLbem55/fiEEIAUgASkDGELP1tO+0ser2UJ+fEIfiUKHla+vmLbem55/fiEFIAAgAUEgaiIBSw0ACyACJAAgAyQBIAQkAiAFJAMLqwYCAX8EfiMEQgBSBH4jACICQgGJIwEiA0IHiXwjAiIEQgyJfCMDIgVCEol8IAJCz9bTvtLHq9lCfkIfiUKHla+vmLbem55/foVCh5Wvr5i23puef35CnaO16oOxjYr6AH0gA0LP1tO+0ser2UJ+Qh+JQoeVr6+Ytt6bnn9+hUKHla+vmLbem55/fkKdo7Xqg7GNivoAfSAEQs/W077Sx6vZQn5CH4lCh5Wvr5i23puef36FQoeVr6+Ytt6bnn9+Qp2jteqDsY2K+gB9IAVCz9bTvtLHq9lCfkIfiUKHla+vmLbem55/foVCh5Wvr5i23puef35CnaO16oOxjYr6AH0FQsXP2bLx5brqJwsjBCAArXx8IQIDQCABQQhqIABNBEAgAiABKQMAQs/W077Sx6vZQn5CH4lCh5Wvr5i23puef36FQhuJQoeVr6+Ytt6bnn9+Qp2jteqDsY2K+gB9IQIgAUEIaiEBDAELCyABQQRqIABNBEACfyACIAE1AgBCh5Wvr5i23puef36FQheJQs/W077Sx6vZQn5C+fPd8Zn2masWfCECIAFBBGoLIQELA0AgACABRwRAIAIgATEAAELFz9my8eW66id+hUILiUKHla+vmLbem55/fiECIAFBAWohAQwBCwtBACACIAJCIYiFQs/W077Sx6vZQn4iAiACQh2IhUL5893xmfaZqxZ+IgIgAkIgiIUiAkIgiCIDQv//A4NCIIYgA0KAgPz/D4NCEIiEIgNC/4GAgPAfg0IQhiADQoD+g4CA4D+DQgiIhCIDQo+AvIDwgcAHg0IIhiADQvCBwIeAnoD4AINCBIiEIgNChoyYsODAgYMGfEIEiEKBgoSIkKDAgAGDQid+IANCsODAgYOGjJgwhHw3AwBBCCACQv////8PgyICQv//A4NCIIYgAkKAgPz/D4NCEIiEIgJC/4GAgPAfg0IQhiACQoD+g4CA4D+DQgiIhCICQo+AvIDwgcAHg0IIhiACQvCBwIeAnoD4AINCBIiEIgJChoyYsODAgYMGfEIEiEKBgoSIkKDAgAGDQid+IAJCsODAgYOGjJgwhHw3AwAL",
|
|
12197
12313
|
"base64"
|
|
12198
12314
|
)
|
|
12199
12315
|
);
|
|
12200
12316
|
//#endregion
|
|
12201
12317
|
|
|
12202
|
-
|
|
12203
|
-
return
|
|
12204
|
-
}
|
|
12205
|
-
|
|
12206
|
-
var BulkUpdateDecorator_1;
|
|
12207
|
-
var hasRequiredBulkUpdateDecorator;
|
|
12208
|
-
|
|
12209
|
-
function requireBulkUpdateDecorator () {
|
|
12210
|
-
if (hasRequiredBulkUpdateDecorator) return BulkUpdateDecorator_1;
|
|
12211
|
-
hasRequiredBulkUpdateDecorator = 1;
|
|
12212
|
-
const BULK_SIZE = 2000;
|
|
12213
|
-
|
|
12214
|
-
// We are using an object instead of a Map as this will stay static during the runtime
|
|
12215
|
-
// so access to it can be optimized by v8
|
|
12216
|
-
const digestCaches = {};
|
|
12217
|
-
|
|
12218
|
-
class BulkUpdateDecorator {
|
|
12219
|
-
/**
|
|
12220
|
-
* @param {Hash | function(): Hash} hashOrFactory function to create a hash
|
|
12221
|
-
* @param {string=} hashKey key for caching
|
|
12222
|
-
*/
|
|
12223
|
-
constructor(hashOrFactory, hashKey) {
|
|
12224
|
-
this.hashKey = hashKey;
|
|
12225
|
-
|
|
12226
|
-
if (typeof hashOrFactory === "function") {
|
|
12227
|
-
this.hashFactory = hashOrFactory;
|
|
12228
|
-
this.hash = undefined;
|
|
12229
|
-
} else {
|
|
12230
|
-
this.hashFactory = undefined;
|
|
12231
|
-
this.hash = hashOrFactory;
|
|
12232
|
-
}
|
|
12233
|
-
|
|
12234
|
-
this.buffer = "";
|
|
12235
|
-
}
|
|
12236
|
-
|
|
12237
|
-
/**
|
|
12238
|
-
* Update hash {@link https://nodejs.org/api/crypto.html#crypto_hash_update_data_inputencoding}
|
|
12239
|
-
* @param {string|Buffer} data data
|
|
12240
|
-
* @param {string=} inputEncoding data encoding
|
|
12241
|
-
* @returns {this} updated hash
|
|
12242
|
-
*/
|
|
12243
|
-
update(data, inputEncoding) {
|
|
12244
|
-
if (
|
|
12245
|
-
inputEncoding !== undefined ||
|
|
12246
|
-
typeof data !== "string" ||
|
|
12247
|
-
data.length > BULK_SIZE
|
|
12248
|
-
) {
|
|
12249
|
-
if (this.hash === undefined) {
|
|
12250
|
-
this.hash = this.hashFactory();
|
|
12251
|
-
}
|
|
12252
|
-
|
|
12253
|
-
if (this.buffer.length > 0) {
|
|
12254
|
-
this.hash.update(this.buffer);
|
|
12255
|
-
this.buffer = "";
|
|
12256
|
-
}
|
|
12257
|
-
|
|
12258
|
-
this.hash.update(data, inputEncoding);
|
|
12259
|
-
} else {
|
|
12260
|
-
this.buffer += data;
|
|
12261
|
-
|
|
12262
|
-
if (this.buffer.length > BULK_SIZE) {
|
|
12263
|
-
if (this.hash === undefined) {
|
|
12264
|
-
this.hash = this.hashFactory();
|
|
12265
|
-
}
|
|
12266
|
-
|
|
12267
|
-
this.hash.update(this.buffer);
|
|
12268
|
-
this.buffer = "";
|
|
12269
|
-
}
|
|
12270
|
-
}
|
|
12271
|
-
|
|
12272
|
-
return this;
|
|
12273
|
-
}
|
|
12274
|
-
|
|
12275
|
-
/**
|
|
12276
|
-
* Calculates the digest {@link https://nodejs.org/api/crypto.html#crypto_hash_digest_encoding}
|
|
12277
|
-
* @param {string=} encoding encoding of the return value
|
|
12278
|
-
* @returns {string|Buffer} digest
|
|
12279
|
-
*/
|
|
12280
|
-
digest(encoding) {
|
|
12281
|
-
let digestCache;
|
|
12282
|
-
|
|
12283
|
-
const buffer = this.buffer;
|
|
12284
|
-
|
|
12285
|
-
if (this.hash === undefined) {
|
|
12286
|
-
// short data for hash, we can use caching
|
|
12287
|
-
const cacheKey = `${this.hashKey}-${encoding}`;
|
|
12288
|
-
|
|
12289
|
-
digestCache = digestCaches[cacheKey];
|
|
12290
|
-
|
|
12291
|
-
if (digestCache === undefined) {
|
|
12292
|
-
digestCache = digestCaches[cacheKey] = new Map();
|
|
12293
|
-
}
|
|
12294
|
-
|
|
12295
|
-
const cacheEntry = digestCache.get(buffer);
|
|
12296
|
-
|
|
12297
|
-
if (cacheEntry !== undefined) {
|
|
12298
|
-
return cacheEntry;
|
|
12299
|
-
}
|
|
12300
|
-
|
|
12301
|
-
this.hash = this.hashFactory();
|
|
12302
|
-
}
|
|
12303
|
-
|
|
12304
|
-
if (buffer.length > 0) {
|
|
12305
|
-
this.hash.update(buffer);
|
|
12306
|
-
}
|
|
12307
|
-
|
|
12308
|
-
const digestResult = this.hash.digest(encoding);
|
|
12309
|
-
|
|
12310
|
-
if (digestCache !== undefined) {
|
|
12311
|
-
digestCache.set(buffer, digestResult);
|
|
12312
|
-
}
|
|
12313
|
-
|
|
12314
|
-
return digestResult;
|
|
12315
|
-
}
|
|
12316
|
-
}
|
|
12317
|
-
|
|
12318
|
-
BulkUpdateDecorator_1 = BulkUpdateDecorator;
|
|
12319
|
-
return BulkUpdateDecorator_1;
|
|
12318
|
+
xxhash64_1 = create.bind(null, xxhash64, [], 32, 16);
|
|
12319
|
+
return xxhash64_1;
|
|
12320
12320
|
}
|
|
12321
12321
|
|
|
12322
12322
|
const baseEncodeTables = {
|
|
@@ -13821,9 +13821,19 @@ function localizeNode(rule, mode, localAliasMap) {
|
|
|
13821
13821
|
hasLocals: false,
|
|
13822
13822
|
explicit: context.explicit,
|
|
13823
13823
|
};
|
|
13824
|
-
newNodes = node.map((childNode) =>
|
|
13825
|
-
|
|
13826
|
-
|
|
13824
|
+
newNodes = node.map((childNode) => {
|
|
13825
|
+
const newContext = {
|
|
13826
|
+
...childContext,
|
|
13827
|
+
enforceNoSpacing: false,
|
|
13828
|
+
};
|
|
13829
|
+
|
|
13830
|
+
const result = transform(childNode, newContext);
|
|
13831
|
+
|
|
13832
|
+
childContext.global = newContext.global;
|
|
13833
|
+
childContext.hasLocals = newContext.hasLocals;
|
|
13834
|
+
|
|
13835
|
+
return result;
|
|
13836
|
+
});
|
|
13827
13837
|
|
|
13828
13838
|
node = node.clone();
|
|
13829
13839
|
node.nodes = normalizeNodeArray(newNodes);
|
|
@@ -13964,19 +13974,34 @@ function localizeDeclNode(node, context) {
|
|
|
13964
13974
|
return node;
|
|
13965
13975
|
}
|
|
13966
13976
|
|
|
13967
|
-
|
|
13968
|
-
|
|
13969
|
-
|
|
13970
|
-
|
|
13971
|
-
|
|
13972
|
-
|
|
13973
|
-
|
|
13974
|
-
|
|
13977
|
+
// `none` is special value, other is global values
|
|
13978
|
+
const specialKeywords = [
|
|
13979
|
+
"none",
|
|
13980
|
+
"inherit",
|
|
13981
|
+
"initial",
|
|
13982
|
+
"revert",
|
|
13983
|
+
"revert-layer",
|
|
13984
|
+
"unset",
|
|
13985
|
+
];
|
|
13975
13986
|
|
|
13976
13987
|
function localizeDeclarationValues(localize, declaration, context) {
|
|
13977
13988
|
const valueNodes = valueParser(declaration.value);
|
|
13978
13989
|
|
|
13979
13990
|
valueNodes.walk((node, index, nodes) => {
|
|
13991
|
+
if (
|
|
13992
|
+
node.type === "function" &&
|
|
13993
|
+
(node.value.toLowerCase() === "var" || node.value.toLowerCase() === "env")
|
|
13994
|
+
) {
|
|
13995
|
+
return false;
|
|
13996
|
+
}
|
|
13997
|
+
|
|
13998
|
+
if (
|
|
13999
|
+
node.type === "word" &&
|
|
14000
|
+
specialKeywords.includes(node.value.toLowerCase())
|
|
14001
|
+
) {
|
|
14002
|
+
return;
|
|
14003
|
+
}
|
|
14004
|
+
|
|
13980
14005
|
const subContext = {
|
|
13981
14006
|
options: context.options,
|
|
13982
14007
|
global: context.global,
|
|
@@ -13993,57 +14018,80 @@ function localizeDeclaration(declaration, context) {
|
|
|
13993
14018
|
const isAnimation = /animation$/i.test(declaration.prop);
|
|
13994
14019
|
|
|
13995
14020
|
if (isAnimation) {
|
|
13996
|
-
|
|
14021
|
+
// letter
|
|
14022
|
+
// An uppercase letter or a lowercase letter.
|
|
14023
|
+
//
|
|
14024
|
+
// ident-start code point
|
|
14025
|
+
// A letter, a non-ASCII code point, or U+005F LOW LINE (_).
|
|
14026
|
+
//
|
|
14027
|
+
// ident code point
|
|
14028
|
+
// An ident-start code point, a digit, or U+002D HYPHEN-MINUS (-).
|
|
14029
|
+
|
|
14030
|
+
// We don't validate `hex digits`, because we don't need it, it is work of linters.
|
|
14031
|
+
const validIdent =
|
|
14032
|
+
/^-?([a-z\u0080-\uFFFF_]|(\\[^\r\n\f])|-)((\\[^\r\n\f])|[a-z\u0080-\uFFFF_0-9-])*$/i;
|
|
13997
14033
|
|
|
13998
14034
|
/*
|
|
13999
14035
|
The spec defines some keywords that you can use to describe properties such as the timing
|
|
14000
14036
|
function. These are still valid animation names, so as long as there is a property that accepts
|
|
14001
14037
|
a keyword, it is given priority. Only when all the properties that can take a keyword are
|
|
14002
14038
|
exhausted can the animation name be set to the keyword. I.e.
|
|
14003
|
-
|
|
14039
|
+
|
|
14004
14040
|
animation: infinite infinite;
|
|
14005
|
-
|
|
14041
|
+
|
|
14006
14042
|
The animation will repeat an infinite number of times from the first argument, and will have an
|
|
14007
14043
|
animation name of infinite from the second.
|
|
14008
14044
|
*/
|
|
14009
14045
|
const animationKeywords = {
|
|
14046
|
+
// animation-direction
|
|
14047
|
+
$normal: 1,
|
|
14048
|
+
$reverse: 1,
|
|
14010
14049
|
$alternate: 1,
|
|
14011
14050
|
"$alternate-reverse": 1,
|
|
14051
|
+
// animation-fill-mode
|
|
14052
|
+
$forwards: 1,
|
|
14012
14053
|
$backwards: 1,
|
|
14013
14054
|
$both: 1,
|
|
14055
|
+
// animation-iteration-count
|
|
14056
|
+
$infinite: 1,
|
|
14057
|
+
// animation-play-state
|
|
14058
|
+
$paused: 1,
|
|
14059
|
+
$running: 1,
|
|
14060
|
+
// animation-timing-function
|
|
14014
14061
|
$ease: 1,
|
|
14015
14062
|
"$ease-in": 1,
|
|
14016
|
-
"$ease-in-out": 1,
|
|
14017
14063
|
"$ease-out": 1,
|
|
14018
|
-
$
|
|
14019
|
-
$infinite: 1,
|
|
14064
|
+
"$ease-in-out": 1,
|
|
14020
14065
|
$linear: 1,
|
|
14021
|
-
$none: Infinity, // No matter how many times you write none, it will never be an animation name
|
|
14022
|
-
$normal: 1,
|
|
14023
|
-
$paused: 1,
|
|
14024
|
-
$reverse: 1,
|
|
14025
|
-
$running: 1,
|
|
14026
14066
|
"$step-end": 1,
|
|
14027
14067
|
"$step-start": 1,
|
|
14068
|
+
// Special
|
|
14069
|
+
$none: Infinity, // No matter how many times you write none, it will never be an animation name
|
|
14070
|
+
// Global values
|
|
14028
14071
|
$initial: Infinity,
|
|
14029
14072
|
$inherit: Infinity,
|
|
14030
14073
|
$unset: Infinity,
|
|
14074
|
+
$revert: Infinity,
|
|
14075
|
+
"$revert-layer": Infinity,
|
|
14031
14076
|
};
|
|
14032
14077
|
let parsedAnimationKeywords = {};
|
|
14033
|
-
let stepsFunctionNode = null;
|
|
14034
14078
|
const valueNodes = valueParser(declaration.value).walk((node) => {
|
|
14035
|
-
|
|
14079
|
+
// If div-token appeared (represents as comma ','), a possibility of an animation-keywords should be reflesh.
|
|
14036
14080
|
if (node.type === "div") {
|
|
14037
14081
|
parsedAnimationKeywords = {};
|
|
14082
|
+
|
|
14083
|
+
return;
|
|
14084
|
+
}
|
|
14085
|
+
// Do not handle nested functions
|
|
14086
|
+
else if (node.type === "function") {
|
|
14087
|
+
return false;
|
|
14038
14088
|
}
|
|
14039
|
-
|
|
14040
|
-
|
|
14089
|
+
// Ignore all except word
|
|
14090
|
+
else if (node.type !== "word") {
|
|
14091
|
+
return;
|
|
14041
14092
|
}
|
|
14042
|
-
|
|
14043
|
-
|
|
14044
|
-
!isWordAFunctionArgument(node, stepsFunctionNode)
|
|
14045
|
-
? node.value.toLowerCase()
|
|
14046
|
-
: null;
|
|
14093
|
+
|
|
14094
|
+
const value = node.type === "word" ? node.value.toLowerCase() : null;
|
|
14047
14095
|
|
|
14048
14096
|
let shouldParseAnimationName = false;
|
|
14049
14097
|
|
|
@@ -14068,6 +14116,7 @@ function localizeDeclaration(declaration, context) {
|
|
|
14068
14116
|
localizeNextItem: shouldParseAnimationName && !context.global,
|
|
14069
14117
|
localAliasMap: context.localAliasMap,
|
|
14070
14118
|
};
|
|
14119
|
+
|
|
14071
14120
|
return localizeDeclNode(node, subContext);
|
|
14072
14121
|
});
|
|
14073
14122
|
|
|
@@ -15472,6 +15521,7 @@ function specifierEnd(s, end, nodeEnd) {
|
|
|
15472
15521
|
|
|
15473
15522
|
const normalScriptDefaultVar = `__default__`;
|
|
15474
15523
|
function processNormalScript(ctx, scopeId) {
|
|
15524
|
+
var _a;
|
|
15475
15525
|
const script = ctx.descriptor.script;
|
|
15476
15526
|
if (script.lang && !ctx.isJS && !ctx.isTS) {
|
|
15477
15527
|
return script;
|
|
@@ -15510,7 +15560,7 @@ function processNormalScript(ctx, scopeId) {
|
|
|
15510
15560
|
const s = new MagicString(content);
|
|
15511
15561
|
rewriteDefaultAST(scriptAst.body, s, defaultVar);
|
|
15512
15562
|
content = s.toString();
|
|
15513
|
-
if (cssVars.length) {
|
|
15563
|
+
if (cssVars.length && !((_a = ctx.options.templateOptions) == null ? void 0 : _a.ssr)) {
|
|
15514
15564
|
content += genNormalScriptCssVarsCode(
|
|
15515
15565
|
cssVars,
|
|
15516
15566
|
bindings,
|
|
@@ -18195,7 +18245,7 @@ function importSourceToScope(ctx, node, scope, source) {
|
|
|
18195
18245
|
let resolved = scope.resolvedImportSources[source];
|
|
18196
18246
|
if (!resolved) {
|
|
18197
18247
|
if (source.startsWith(".")) {
|
|
18198
|
-
const filename = joinPaths(scope.filename,
|
|
18248
|
+
const filename = joinPaths(path$3.dirname(scope.filename), source);
|
|
18199
18249
|
resolved = resolveExt(filename, fs);
|
|
18200
18250
|
} else {
|
|
18201
18251
|
if (!ts) {
|
|
@@ -18664,6 +18714,7 @@ function inferRuntimeType(ctx, node, scope = node._ownerScope || ctxToScope(ctx)
|
|
|
18664
18714
|
case "WeakMap":
|
|
18665
18715
|
case "Date":
|
|
18666
18716
|
case "Promise":
|
|
18717
|
+
case "Error":
|
|
18667
18718
|
return [node.typeName.name];
|
|
18668
18719
|
case "Partial":
|
|
18669
18720
|
case "Required":
|
|
@@ -20024,7 +20075,7 @@ const ${normalScriptDefaultVar} = ${defaultSpecifier.local.name}
|
|
|
20024
20075
|
}
|
|
20025
20076
|
}
|
|
20026
20077
|
if (sfc.cssVars.length && // no need to do this when targeting SSR
|
|
20027
|
-
!(
|
|
20078
|
+
!((_a = options.templateOptions) == null ? void 0 : _a.ssr)) {
|
|
20028
20079
|
ctx.helperImports.add(CSS_VARS_HELPER);
|
|
20029
20080
|
ctx.helperImports.add("unref");
|
|
20030
20081
|
ctx.s.prependLeft(
|
|
@@ -20410,7 +20461,8 @@ function isStaticNode(node) {
|
|
|
20410
20461
|
return false;
|
|
20411
20462
|
}
|
|
20412
20463
|
|
|
20413
|
-
const version = "3.3.
|
|
20464
|
+
const version = "3.3.8";
|
|
20465
|
+
const parseCache = parseCache$1;
|
|
20414
20466
|
const walk = estreeWalker.walk;
|
|
20415
20467
|
|
|
20416
20468
|
exports.babelParse = parser$2.parse;
|
package/dist/compiler-sfc.d.ts
CHANGED
|
@@ -1,4 +1,3 @@
|
|
|
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
3
|
import { CompilerOptions, CodegenResult, ParserOptions, RootNode, CompilerError, SourceLocation, ElementNode, BindingMetadata as BindingMetadata$1 } from '@vue/compiler-core';
|
|
@@ -230,7 +229,6 @@ export interface SFCParseResult {
|
|
|
230
229
|
descriptor: SFCDescriptor;
|
|
231
230
|
errors: (CompilerError | SyntaxError)[];
|
|
232
231
|
}
|
|
233
|
-
export declare const parseCache: Map<string, SFCParseResult> | lru_cache_min.LRUCache<string, SFCParseResult, unknown>;
|
|
234
232
|
export declare function parse(source: string, { sourceMap, filename, sourceRoot, pad, ignoreEmpty, compiler }?: SFCParseOptions): SFCParseResult;
|
|
235
233
|
|
|
236
234
|
type PreprocessLang = 'less' | 'sass' | 'scss' | 'styl' | 'stylus';
|
|
@@ -470,5 +468,7 @@ export declare function inferRuntimeType(ctx: TypeResolveContext, node: Node & M
|
|
|
470
468
|
|
|
471
469
|
export declare const version: string;
|
|
472
470
|
|
|
471
|
+
export declare const parseCache: Map<string, SFCParseResult>;
|
|
472
|
+
|
|
473
473
|
export declare const walk: any;
|
|
474
474
|
|
|
@@ -16281,9 +16281,13 @@ function walk$2(node, context, doNotHoistNode = false) {
|
|
|
16281
16281
|
context.transformHoist(children, context, node);
|
|
16282
16282
|
}
|
|
16283
16283
|
if (hoistedCount && hoistedCount === originalCount && node.type === 1 && node.tagType === 0 && node.codegenNode && node.codegenNode.type === 13 && isArray$3(node.codegenNode.children)) {
|
|
16284
|
-
|
|
16284
|
+
const hoisted = context.hoist(
|
|
16285
16285
|
createArrayExpression(node.codegenNode.children)
|
|
16286
16286
|
);
|
|
16287
|
+
if (context.hmr) {
|
|
16288
|
+
hoisted.content = `[...${hoisted.content}]`;
|
|
16289
|
+
}
|
|
16290
|
+
node.codegenNode.children = hoisted;
|
|
16287
16291
|
}
|
|
16288
16292
|
}
|
|
16289
16293
|
function getConstantType(node, context) {
|
|
@@ -16456,6 +16460,7 @@ function createTransformContext(root, {
|
|
|
16456
16460
|
filename = "",
|
|
16457
16461
|
prefixIdentifiers = false,
|
|
16458
16462
|
hoistStatic: hoistStatic2 = false,
|
|
16463
|
+
hmr = false,
|
|
16459
16464
|
cacheHandlers = false,
|
|
16460
16465
|
nodeTransforms = [],
|
|
16461
16466
|
directiveTransforms = {},
|
|
@@ -16481,6 +16486,7 @@ function createTransformContext(root, {
|
|
|
16481
16486
|
selfName: nameMatch && capitalize$1(camelize(nameMatch[1])),
|
|
16482
16487
|
prefixIdentifiers,
|
|
16483
16488
|
hoistStatic: hoistStatic2,
|
|
16489
|
+
hmr,
|
|
16484
16490
|
cacheHandlers,
|
|
16485
16491
|
nodeTransforms,
|
|
16486
16492
|
directiveTransforms,
|
|
@@ -21370,8 +21376,8 @@ function processExpression(node, context, asParams = false, asRawStatements = fa
|
|
|
21370
21376
|
const isScopeVarReference = context.identifiers[rawExp];
|
|
21371
21377
|
const isAllowedGlobal = isGloballyAllowed(rawExp);
|
|
21372
21378
|
const isLiteral = isLiteralWhitelisted(rawExp);
|
|
21373
|
-
if (!asParams && !isScopeVarReference && !
|
|
21374
|
-
if (isConst(bindingMetadata[
|
|
21379
|
+
if (!asParams && !isScopeVarReference && !isLiteral && (!isAllowedGlobal || bindingMetadata[rawExp])) {
|
|
21380
|
+
if (isConst(bindingMetadata[rawExp])) {
|
|
21375
21381
|
node.constType = 1;
|
|
21376
21382
|
}
|
|
21377
21383
|
node.content = rewriteIdentifier(rawExp);
|
|
@@ -22029,7 +22035,7 @@ const trackVForSlotScopes = (node, context) => {
|
|
|
22029
22035
|
}
|
|
22030
22036
|
}
|
|
22031
22037
|
};
|
|
22032
|
-
const buildClientSlotFn = (props, children, loc) => createFunctionExpression(
|
|
22038
|
+
const buildClientSlotFn = (props, _vForExp, children, loc) => createFunctionExpression(
|
|
22033
22039
|
props,
|
|
22034
22040
|
children,
|
|
22035
22041
|
false,
|
|
@@ -22054,7 +22060,7 @@ function buildSlots(node, context, buildSlotFn = buildClientSlotFn) {
|
|
|
22054
22060
|
slotsProperties.push(
|
|
22055
22061
|
createObjectProperty(
|
|
22056
22062
|
arg || createSimpleExpression("default", true),
|
|
22057
|
-
buildSlotFn(exp, children, loc)
|
|
22063
|
+
buildSlotFn(exp, void 0, children, loc)
|
|
22058
22064
|
)
|
|
22059
22065
|
);
|
|
22060
22066
|
}
|
|
@@ -22091,10 +22097,15 @@ function buildSlots(node, context, buildSlotFn = buildClientSlotFn) {
|
|
|
22091
22097
|
} else {
|
|
22092
22098
|
hasDynamicSlots = true;
|
|
22093
22099
|
}
|
|
22094
|
-
const
|
|
22100
|
+
const vFor = findDir(slotElement, "for");
|
|
22101
|
+
const slotFunction = buildSlotFn(
|
|
22102
|
+
slotProps,
|
|
22103
|
+
vFor == null ? void 0 : vFor.exp,
|
|
22104
|
+
slotChildren,
|
|
22105
|
+
slotLoc
|
|
22106
|
+
);
|
|
22095
22107
|
let vIf;
|
|
22096
22108
|
let vElse;
|
|
22097
|
-
let vFor;
|
|
22098
22109
|
if (vIf = findDir(slotElement, "if")) {
|
|
22099
22110
|
hasDynamicSlots = true;
|
|
22100
22111
|
dynamicSlots.push(
|
|
@@ -22139,7 +22150,7 @@ function buildSlots(node, context, buildSlotFn = buildClientSlotFn) {
|
|
|
22139
22150
|
createCompilerError(30, vElse.loc)
|
|
22140
22151
|
);
|
|
22141
22152
|
}
|
|
22142
|
-
} else if (vFor
|
|
22153
|
+
} else if (vFor) {
|
|
22143
22154
|
hasDynamicSlots = true;
|
|
22144
22155
|
const parseResult = vFor.parseResult || parseForExpression(vFor.exp, context);
|
|
22145
22156
|
if (parseResult) {
|
|
@@ -22180,7 +22191,7 @@ function buildSlots(node, context, buildSlotFn = buildClientSlotFn) {
|
|
|
22180
22191
|
}
|
|
22181
22192
|
if (!onComponentSlot) {
|
|
22182
22193
|
const buildDefaultSlotProperty = (props, children2) => {
|
|
22183
|
-
const fn = buildSlotFn(props, children2, loc);
|
|
22194
|
+
const fn = buildSlotFn(props, void 0, children2, loc);
|
|
22184
22195
|
return createObjectProperty(`default`, fn);
|
|
22185
22196
|
};
|
|
22186
22197
|
if (!hasTemplateSlots) {
|
|
@@ -27288,9 +27299,8 @@ function resolveTemplateUsageCheckString(sfc) {
|
|
|
27288
27299
|
code += `,v${capitalize$1(camelize(prop.name))}`;
|
|
27289
27300
|
}
|
|
27290
27301
|
if (prop.arg && !prop.arg.isStatic) {
|
|
27291
|
-
code += `,${
|
|
27292
|
-
prop.arg.content
|
|
27293
|
-
prop.name
|
|
27302
|
+
code += `,${stripStrings(
|
|
27303
|
+
prop.arg.content
|
|
27294
27304
|
)}`;
|
|
27295
27305
|
}
|
|
27296
27306
|
if (prop.exp) {
|
|
@@ -27368,7 +27378,7 @@ var __spreadValues$a = (a, b) => {
|
|
|
27368
27378
|
return a;
|
|
27369
27379
|
};
|
|
27370
27380
|
const DEFAULT_FILENAME = "anonymous.vue";
|
|
27371
|
-
const parseCache = createCache();
|
|
27381
|
+
const parseCache$1 = createCache();
|
|
27372
27382
|
function parse$7(source, {
|
|
27373
27383
|
sourceMap = true,
|
|
27374
27384
|
filename = DEFAULT_FILENAME,
|
|
@@ -27378,7 +27388,7 @@ function parse$7(source, {
|
|
|
27378
27388
|
compiler = CompilerDOM
|
|
27379
27389
|
} = {}) {
|
|
27380
27390
|
const sourceKey = source + sourceMap + filename + sourceRoot + pad + compiler.parse;
|
|
27381
|
-
const cache = parseCache.get(sourceKey);
|
|
27391
|
+
const cache = parseCache$1.get(sourceKey);
|
|
27382
27392
|
if (cache) {
|
|
27383
27393
|
return cache;
|
|
27384
27394
|
}
|
|
@@ -27521,7 +27531,7 @@ function parse$7(source, {
|
|
|
27521
27531
|
descriptor,
|
|
27522
27532
|
errors
|
|
27523
27533
|
};
|
|
27524
|
-
parseCache.set(sourceKey, result);
|
|
27534
|
+
parseCache$1.set(sourceKey, result);
|
|
27525
27535
|
return result;
|
|
27526
27536
|
}
|
|
27527
27537
|
function createDuplicateBlockError(node, isScriptSetup = false) {
|
|
@@ -32031,7 +32041,7 @@ function ssrProcessTeleport(node, context) {
|
|
|
32031
32041
|
);
|
|
32032
32042
|
}
|
|
32033
32043
|
|
|
32034
|
-
const wipMap$
|
|
32044
|
+
const wipMap$3 = /* @__PURE__ */ new WeakMap();
|
|
32035
32045
|
function ssrTransformSuspense(node, context) {
|
|
32036
32046
|
return () => {
|
|
32037
32047
|
if (node.children.length) {
|
|
@@ -32040,29 +32050,33 @@ function ssrTransformSuspense(node, context) {
|
|
|
32040
32050
|
// to be immediately set
|
|
32041
32051
|
wipSlots: []
|
|
32042
32052
|
};
|
|
32043
|
-
wipMap$
|
|
32044
|
-
wipEntry.slotsExp = buildSlots(
|
|
32045
|
-
|
|
32046
|
-
|
|
32047
|
-
|
|
32048
|
-
|
|
32049
|
-
|
|
32050
|
-
|
|
32051
|
-
|
|
32052
|
-
|
|
32053
|
-
|
|
32054
|
-
|
|
32055
|
-
|
|
32056
|
-
|
|
32057
|
-
|
|
32058
|
-
|
|
32059
|
-
|
|
32060
|
-
|
|
32053
|
+
wipMap$3.set(node, wipEntry);
|
|
32054
|
+
wipEntry.slotsExp = buildSlots(
|
|
32055
|
+
node,
|
|
32056
|
+
context,
|
|
32057
|
+
(_props, _vForExp, children, loc) => {
|
|
32058
|
+
const fn = createFunctionExpression(
|
|
32059
|
+
[],
|
|
32060
|
+
void 0,
|
|
32061
|
+
// no return, assign body later
|
|
32062
|
+
true,
|
|
32063
|
+
// newline
|
|
32064
|
+
false,
|
|
32065
|
+
// suspense slots are not treated as normal slots
|
|
32066
|
+
loc
|
|
32067
|
+
);
|
|
32068
|
+
wipEntry.wipSlots.push({
|
|
32069
|
+
fn,
|
|
32070
|
+
children
|
|
32071
|
+
});
|
|
32072
|
+
return fn;
|
|
32073
|
+
}
|
|
32074
|
+
).slots;
|
|
32061
32075
|
}
|
|
32062
32076
|
};
|
|
32063
32077
|
}
|
|
32064
32078
|
function ssrProcessSuspense(node, context) {
|
|
32065
|
-
const wipEntry = wipMap$
|
|
32079
|
+
const wipEntry = wipMap$3.get(node);
|
|
32066
32080
|
if (!wipEntry) {
|
|
32067
32081
|
return;
|
|
32068
32082
|
}
|
|
@@ -32368,7 +32382,7 @@ function ssrProcessElement(node, context) {
|
|
|
32368
32382
|
}
|
|
32369
32383
|
}
|
|
32370
32384
|
|
|
32371
|
-
const wipMap$
|
|
32385
|
+
const wipMap$2 = /* @__PURE__ */ new WeakMap();
|
|
32372
32386
|
function ssrTransformTransitionGroup(node, context) {
|
|
32373
32387
|
return () => {
|
|
32374
32388
|
const tag = findProp(node, "tag");
|
|
@@ -32389,7 +32403,7 @@ function ssrTransformTransitionGroup(node, context) {
|
|
|
32389
32403
|
buildSSRProps(props, directives, context)
|
|
32390
32404
|
]);
|
|
32391
32405
|
}
|
|
32392
|
-
wipMap$
|
|
32406
|
+
wipMap$2.set(node, {
|
|
32393
32407
|
tag,
|
|
32394
32408
|
propsExp,
|
|
32395
32409
|
scopeId: context.scopeId || null
|
|
@@ -32398,7 +32412,7 @@ function ssrTransformTransitionGroup(node, context) {
|
|
|
32398
32412
|
};
|
|
32399
32413
|
}
|
|
32400
32414
|
function ssrProcessTransitionGroup(node, context) {
|
|
32401
|
-
const entry = wipMap$
|
|
32415
|
+
const entry = wipMap$2.get(node);
|
|
32402
32416
|
if (entry) {
|
|
32403
32417
|
const { tag, propsExp, scopeId } = entry;
|
|
32404
32418
|
if (tag.type === 7) {
|
|
@@ -32443,6 +32457,25 @@ function ssrProcessTransitionGroup(node, context) {
|
|
|
32443
32457
|
}
|
|
32444
32458
|
}
|
|
32445
32459
|
|
|
32460
|
+
const wipMap$1 = /* @__PURE__ */ new WeakMap();
|
|
32461
|
+
function ssrTransformTransition(node, context) {
|
|
32462
|
+
return () => {
|
|
32463
|
+
const appear = findProp(node, "appear", false, true);
|
|
32464
|
+
wipMap$1.set(node, !!appear);
|
|
32465
|
+
};
|
|
32466
|
+
}
|
|
32467
|
+
function ssrProcessTransition(node, context) {
|
|
32468
|
+
node.children = node.children.filter((c) => c.type !== 3);
|
|
32469
|
+
const appear = wipMap$1.get(node);
|
|
32470
|
+
if (appear) {
|
|
32471
|
+
context.pushStringPart(`<template>`);
|
|
32472
|
+
processChildren(node, context, false, true);
|
|
32473
|
+
context.pushStringPart(`</template>`);
|
|
32474
|
+
} else {
|
|
32475
|
+
processChildren(node, context, false, true);
|
|
32476
|
+
}
|
|
32477
|
+
}
|
|
32478
|
+
|
|
32446
32479
|
var __defProp$8 = Object.defineProperty;
|
|
32447
32480
|
var __defProps$8 = Object.defineProperties;
|
|
32448
32481
|
var __getOwnPropDescs$8 = Object.getOwnPropertyDescriptors;
|
|
@@ -32480,9 +32513,10 @@ const ssrTransformComponent = (node, context) => {
|
|
|
32480
32513
|
if (isSymbol$1(component)) {
|
|
32481
32514
|
if (component === SUSPENSE) {
|
|
32482
32515
|
return ssrTransformSuspense(node, context);
|
|
32483
|
-
}
|
|
32484
|
-
if (component === TRANSITION_GROUP) {
|
|
32516
|
+
} else if (component === TRANSITION_GROUP) {
|
|
32485
32517
|
return ssrTransformTransitionGroup(node, context);
|
|
32518
|
+
} else if (component === TRANSITION) {
|
|
32519
|
+
return ssrTransformTransition(node);
|
|
32486
32520
|
}
|
|
32487
32521
|
return;
|
|
32488
32522
|
}
|
|
@@ -32490,8 +32524,10 @@ const ssrTransformComponent = (node, context) => {
|
|
|
32490
32524
|
const clonedNode = clone(node);
|
|
32491
32525
|
return function ssrPostTransformComponent() {
|
|
32492
32526
|
if (clonedNode.children.length) {
|
|
32493
|
-
buildSlots(clonedNode, context, (props, children) => {
|
|
32494
|
-
vnodeBranches.push(
|
|
32527
|
+
buildSlots(clonedNode, context, (props, vFor, children) => {
|
|
32528
|
+
vnodeBranches.push(
|
|
32529
|
+
createVNodeSlotBranch(props, vFor, children, context)
|
|
32530
|
+
);
|
|
32495
32531
|
return createFunctionExpression(void 0);
|
|
32496
32532
|
});
|
|
32497
32533
|
}
|
|
@@ -32510,7 +32546,7 @@ const ssrTransformComponent = (node, context) => {
|
|
|
32510
32546
|
}
|
|
32511
32547
|
const wipEntries = [];
|
|
32512
32548
|
wipMap.set(node, wipEntries);
|
|
32513
|
-
const buildSSRSlotFn = (props, children, loc) => {
|
|
32549
|
+
const buildSSRSlotFn = (props, _vForExp, children, loc) => {
|
|
32514
32550
|
const param0 = props && stringifyExpression(props) || `_`;
|
|
32515
32551
|
const fn = createFunctionExpression(
|
|
32516
32552
|
[param0, `_push`, `_parent`, `_scopeId`],
|
|
@@ -32567,7 +32603,7 @@ function ssrProcessComponent(node, context, parent) {
|
|
|
32567
32603
|
context.pushStringPart(``);
|
|
32568
32604
|
}
|
|
32569
32605
|
if (component === TRANSITION) {
|
|
32570
|
-
|
|
32606
|
+
return ssrProcessTransition(node, context);
|
|
32571
32607
|
}
|
|
32572
32608
|
processChildren(node, context);
|
|
32573
32609
|
}
|
|
@@ -32603,7 +32639,7 @@ const rawOptionsMap = /* @__PURE__ */ new WeakMap();
|
|
|
32603
32639
|
const [baseNodeTransforms, baseDirectiveTransforms] = getBaseTransformPreset(true);
|
|
32604
32640
|
const vnodeNodeTransforms = [...baseNodeTransforms, ...DOMNodeTransforms];
|
|
32605
32641
|
const vnodeDirectiveTransforms = __spreadValues$8(__spreadValues$8({}, baseDirectiveTransforms), DOMDirectiveTransforms);
|
|
32606
|
-
function createVNodeSlotBranch(props, children, parentContext) {
|
|
32642
|
+
function createVNodeSlotBranch(props, vForExp, children, parentContext) {
|
|
32607
32643
|
const rawOptions = rawOptionsMap.get(parentContext.root);
|
|
32608
32644
|
const subOptions = __spreadProps$8(__spreadValues$8({}, rawOptions), {
|
|
32609
32645
|
// overwrite with vnode-based transforms
|
|
@@ -32619,8 +32655,8 @@ function createVNodeSlotBranch(props, children, parentContext) {
|
|
|
32619
32655
|
tag: "template",
|
|
32620
32656
|
tagType: 3,
|
|
32621
32657
|
isSelfClosing: false,
|
|
32622
|
-
// important: provide v-slot="props" on the wrapper for
|
|
32623
|
-
// scope analysis
|
|
32658
|
+
// important: provide v-slot="props" and v-for="exp" on the wrapper for
|
|
32659
|
+
// proper scope analysis
|
|
32624
32660
|
props: [
|
|
32625
32661
|
{
|
|
32626
32662
|
type: 7,
|
|
@@ -32629,6 +32665,14 @@ function createVNodeSlotBranch(props, children, parentContext) {
|
|
|
32629
32665
|
arg: void 0,
|
|
32630
32666
|
modifiers: [],
|
|
32631
32667
|
loc: locStub
|
|
32668
|
+
},
|
|
32669
|
+
{
|
|
32670
|
+
type: 7,
|
|
32671
|
+
name: "for",
|
|
32672
|
+
exp: vForExp,
|
|
32673
|
+
arg: void 0,
|
|
32674
|
+
modifiers: [],
|
|
32675
|
+
loc: locStub
|
|
32632
32676
|
}
|
|
32633
32677
|
],
|
|
32634
32678
|
children,
|
|
@@ -33310,6 +33354,7 @@ function doCompileTemplate({
|
|
|
33310
33354
|
slotted,
|
|
33311
33355
|
sourceMap: true
|
|
33312
33356
|
}, compilerOptions), {
|
|
33357
|
+
hmr: !isProd,
|
|
33313
33358
|
nodeTransforms: nodeTransforms.concat(compilerOptions.nodeTransforms || []),
|
|
33314
33359
|
filename,
|
|
33315
33360
|
onError: (e) => errors.push(e),
|
|
@@ -46877,6 +46922,7 @@ var __spreadValues$2 = (a, b) => {
|
|
|
46877
46922
|
var __spreadProps$2 = (a, b) => __defProps$2(a, __getOwnPropDescs$2(b));
|
|
46878
46923
|
const normalScriptDefaultVar = `__default__`;
|
|
46879
46924
|
function processNormalScript(ctx, scopeId) {
|
|
46925
|
+
var _a;
|
|
46880
46926
|
const script = ctx.descriptor.script;
|
|
46881
46927
|
if (script.lang && !ctx.isJS && !ctx.isTS) {
|
|
46882
46928
|
return script;
|
|
@@ -46915,7 +46961,7 @@ function processNormalScript(ctx, scopeId) {
|
|
|
46915
46961
|
const s = new MagicString(content);
|
|
46916
46962
|
rewriteDefaultAST(scriptAst.body, s, defaultVar);
|
|
46917
46963
|
content = s.toString();
|
|
46918
|
-
if (cssVars.length) {
|
|
46964
|
+
if (cssVars.length && !((_a = ctx.options.templateOptions) == null ? void 0 : _a.ssr)) {
|
|
46919
46965
|
content += genNormalScriptCssVarsCode(
|
|
46920
46966
|
cssVars,
|
|
46921
46967
|
bindings,
|
|
@@ -47585,7 +47631,7 @@ function importSourceToScope(ctx, node, scope, source) {
|
|
|
47585
47631
|
let resolved = scope.resolvedImportSources[source];
|
|
47586
47632
|
if (!resolved) {
|
|
47587
47633
|
if (source.startsWith(".")) {
|
|
47588
|
-
const filename = joinPaths(scope.filename,
|
|
47634
|
+
const filename = joinPaths(dirname$2(scope.filename), source);
|
|
47589
47635
|
resolved = resolveExt(filename, fs);
|
|
47590
47636
|
} else {
|
|
47591
47637
|
{
|
|
@@ -47970,6 +48016,7 @@ function inferRuntimeType(ctx, node, scope = node._ownerScope || ctxToScope(ctx)
|
|
|
47970
48016
|
case "WeakMap":
|
|
47971
48017
|
case "Date":
|
|
47972
48018
|
case "Promise":
|
|
48019
|
+
case "Error":
|
|
47973
48020
|
return [node.typeName.name];
|
|
47974
48021
|
case "Partial":
|
|
47975
48022
|
case "Required":
|
|
@@ -49349,7 +49396,7 @@ const ${normalScriptDefaultVar} = ${defaultSpecifier.local.name}
|
|
|
49349
49396
|
}
|
|
49350
49397
|
}
|
|
49351
49398
|
if (sfc.cssVars.length && // no need to do this when targeting SSR
|
|
49352
|
-
!(
|
|
49399
|
+
!((_a = options.templateOptions) == null ? void 0 : _a.ssr)) {
|
|
49353
49400
|
ctx.helperImports.add(CSS_VARS_HELPER);
|
|
49354
49401
|
ctx.helperImports.add("unref");
|
|
49355
49402
|
ctx.s.prependLeft(
|
|
@@ -49730,7 +49777,8 @@ function isStaticNode(node) {
|
|
|
49730
49777
|
return false;
|
|
49731
49778
|
}
|
|
49732
49779
|
|
|
49733
|
-
const version = "3.3.
|
|
49780
|
+
const version = "3.3.8";
|
|
49781
|
+
const parseCache = parseCache$1;
|
|
49734
49782
|
const walk = walk$1;
|
|
49735
49783
|
|
|
49736
49784
|
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.
|
|
3
|
+
"version": "3.3.8",
|
|
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.3.
|
|
37
|
-
"@vue/compiler-dom": "3.3.
|
|
38
|
-
"@vue/compiler-ssr": "3.3.
|
|
39
|
-
"@vue/reactivity-transform": "3.3.
|
|
40
|
-
"@vue/shared": "3.3.
|
|
36
|
+
"@vue/compiler-core": "3.3.8",
|
|
37
|
+
"@vue/compiler-dom": "3.3.8",
|
|
38
|
+
"@vue/compiler-ssr": "3.3.8",
|
|
39
|
+
"@vue/reactivity-transform": "3.3.8",
|
|
40
|
+
"@vue/shared": "3.3.8",
|
|
41
41
|
"estree-walker": "^2.0.2",
|
|
42
42
|
"magic-string": "^0.30.5",
|
|
43
43
|
"postcss": "^8.4.31",
|
|
@@ -53,6 +53,6 @@
|
|
|
53
53
|
"postcss-modules": "^4.3.1",
|
|
54
54
|
"postcss-selector-parser": "^6.0.13",
|
|
55
55
|
"pug": "^3.0.2",
|
|
56
|
-
"sass": "^1.69.
|
|
56
|
+
"sass": "^1.69.5"
|
|
57
57
|
}
|
|
58
58
|
}
|