@vue/compiler-sfc 3.3.6 → 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.
@@ -4257,6 +4257,7 @@ function doCompileTemplate({
4257
4257
  slotted,
4258
4258
  sourceMap: true,
4259
4259
  ...compilerOptions,
4260
+ hmr: !isProd,
4260
4261
  nodeTransforms: nodeTransforms.concat(compilerOptions.nodeTransforms || []),
4261
4262
  filename,
4262
4263
  onError: (e) => errors.push(e),
@@ -11857,6 +11858,122 @@ function words(string, pattern, guard) {
11857
11858
 
11858
11859
  var lodash_camelcase = camelCase;
11859
11860
 
11861
+ var BulkUpdateDecorator_1;
11862
+ var hasRequiredBulkUpdateDecorator;
11863
+
11864
+ function requireBulkUpdateDecorator () {
11865
+ if (hasRequiredBulkUpdateDecorator) return BulkUpdateDecorator_1;
11866
+ hasRequiredBulkUpdateDecorator = 1;
11867
+ const BULK_SIZE = 2000;
11868
+
11869
+ // We are using an object instead of a Map as this will stay static during the runtime
11870
+ // so access to it can be optimized by v8
11871
+ const digestCaches = {};
11872
+
11873
+ class BulkUpdateDecorator {
11874
+ /**
11875
+ * @param {Hash | function(): Hash} hashOrFactory function to create a hash
11876
+ * @param {string=} hashKey key for caching
11877
+ */
11878
+ constructor(hashOrFactory, hashKey) {
11879
+ this.hashKey = hashKey;
11880
+
11881
+ if (typeof hashOrFactory === "function") {
11882
+ this.hashFactory = hashOrFactory;
11883
+ this.hash = undefined;
11884
+ } else {
11885
+ this.hashFactory = undefined;
11886
+ this.hash = hashOrFactory;
11887
+ }
11888
+
11889
+ this.buffer = "";
11890
+ }
11891
+
11892
+ /**
11893
+ * Update hash {@link https://nodejs.org/api/crypto.html#crypto_hash_update_data_inputencoding}
11894
+ * @param {string|Buffer} data data
11895
+ * @param {string=} inputEncoding data encoding
11896
+ * @returns {this} updated hash
11897
+ */
11898
+ update(data, inputEncoding) {
11899
+ if (
11900
+ inputEncoding !== undefined ||
11901
+ typeof data !== "string" ||
11902
+ data.length > BULK_SIZE
11903
+ ) {
11904
+ if (this.hash === undefined) {
11905
+ this.hash = this.hashFactory();
11906
+ }
11907
+
11908
+ if (this.buffer.length > 0) {
11909
+ this.hash.update(this.buffer);
11910
+ this.buffer = "";
11911
+ }
11912
+
11913
+ this.hash.update(data, inputEncoding);
11914
+ } else {
11915
+ this.buffer += data;
11916
+
11917
+ if (this.buffer.length > BULK_SIZE) {
11918
+ if (this.hash === undefined) {
11919
+ this.hash = this.hashFactory();
11920
+ }
11921
+
11922
+ this.hash.update(this.buffer);
11923
+ this.buffer = "";
11924
+ }
11925
+ }
11926
+
11927
+ return this;
11928
+ }
11929
+
11930
+ /**
11931
+ * Calculates the digest {@link https://nodejs.org/api/crypto.html#crypto_hash_digest_encoding}
11932
+ * @param {string=} encoding encoding of the return value
11933
+ * @returns {string|Buffer} digest
11934
+ */
11935
+ digest(encoding) {
11936
+ let digestCache;
11937
+
11938
+ const buffer = this.buffer;
11939
+
11940
+ if (this.hash === undefined) {
11941
+ // short data for hash, we can use caching
11942
+ const cacheKey = `${this.hashKey}-${encoding}`;
11943
+
11944
+ digestCache = digestCaches[cacheKey];
11945
+
11946
+ if (digestCache === undefined) {
11947
+ digestCache = digestCaches[cacheKey] = new Map();
11948
+ }
11949
+
11950
+ const cacheEntry = digestCache.get(buffer);
11951
+
11952
+ if (cacheEntry !== undefined) {
11953
+ return cacheEntry;
11954
+ }
11955
+
11956
+ this.hash = this.hashFactory();
11957
+ }
11958
+
11959
+ if (buffer.length > 0) {
11960
+ this.hash.update(buffer);
11961
+ }
11962
+
11963
+ const digestResult = this.hash.digest(encoding);
11964
+
11965
+ if (digestCache !== undefined) {
11966
+ digestCache.set(buffer, digestResult);
11967
+ }
11968
+
11969
+ return digestResult;
11970
+ }
11971
+ }
11972
+
11973
+ BulkUpdateDecorator_1 = BulkUpdateDecorator;
11974
+ return BulkUpdateDecorator_1;
11975
+ }
11976
+
11860
11977
  var wasmHash = {exports: {}};
11861
11978
 
11862
11979
  /*
@@ -12079,27 +12196,27 @@ function requireWasmHash () {
12079
12196
  Author Tobias Koppers @sokra
12080
12197
  */
12081
12198
 
12082
- var xxhash64_1;
12083
- var hasRequiredXxhash64;
12199
+ var md4_1;
12200
+ var hasRequiredMd4;
12084
12201
 
12085
- function requireXxhash64 () {
12086
- if (hasRequiredXxhash64) return xxhash64_1;
12087
- hasRequiredXxhash64 = 1;
12202
+ function requireMd4 () {
12203
+ if (hasRequiredMd4) return md4_1;
12204
+ hasRequiredMd4 = 1;
12088
12205
 
12089
12206
  const create = requireWasmHash();
12090
12207
 
12091
- //#region wasm code: xxhash64 (../../../assembly/hash/xxhash64.asm.ts) --initialMemory 1
12092
- const xxhash64 = new WebAssembly.Module(
12208
+ //#region wasm code: md4 (../../../assembly/hash/md4.asm.ts) --initialMemory 1
12209
+ const md4 = new WebAssembly.Module(
12093
12210
  Buffer.from(
12094
- // 1173 bytes
12095
- "AGFzbQEAAAABCAJgAX8AYAAAAwQDAQAABQMBAAEGGgV+AUIAC34BQgALfgFCAAt+AUIAC34BQgALByIEBGluaXQAAAZ1cGRhdGUAAQVmaW5hbAACBm1lbW9yeQIACrUIAzAAQtbrgu7q/Yn14AAkAELP1tO+0ser2UIkAUIAJAJC+erQ0OfJoeThACQDQgAkBAvUAQIBfwR+IABFBEAPCyMEIACtfCQEIwAhAiMBIQMjAiEEIwMhBQNAIAIgASkDAELP1tO+0ser2UJ+fEIfiUKHla+vmLbem55/fiECIAMgASkDCELP1tO+0ser2UJ+fEIfiUKHla+vmLbem55/fiEDIAQgASkDEELP1tO+0ser2UJ+fEIfiUKHla+vmLbem55/fiEEIAUgASkDGELP1tO+0ser2UJ+fEIfiUKHla+vmLbem55/fiEFIAAgAUEgaiIBSw0ACyACJAAgAyQBIAQkAiAFJAMLqwYCAX8EfiMEQgBSBH4jACICQgGJIwEiA0IHiXwjAiIEQgyJfCMDIgVCEol8IAJCz9bTvtLHq9lCfkIfiUKHla+vmLbem55/foVCh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EgBCAOIAIgFiABIAMgAiAEcnEgAiAEcXJqakGZ84nUBWpBDXciASADIARycSADIARxcmpqQZnzidQFakEDdyICIAEgA3JxIAEgA3FyampBmfOJ1AVqQQV3IgQgASACcnEgASACcXJqakGZ84nUBWpBCXciAyAMIAIgAyAJIAEgAyACIARycSACIARxcmpqQZnzidQFakENdyIBcyAEc2pqQaHX5/YGakEDdyICIAQgASACcyADc2ogEmpBodfn9gZqQQl3IgRzIAFzampBodfn9gZqQQt3IgMgAiADIBggASADIARzIAJzampBodfn9gZqQQ93IgFzIARzaiANakGh1+f2BmpBA3ciAiAUIAQgASACcyADc2pqQaHX5/YGakEJdyIEcyABc2pqQaHX5/YGakELdyIDIAsgAiADIBYgASADIARzIAJzampBodfn9gZqQQ93IgFzIARzampBodfn9gZqQQN3IgIgEyAEIAEgAnMgA3NqakGh1+f2BmpBCXciBHMgAXNqakGh1+f2BmpBC3chAyAKIA4gAiADIBcgASADIARzIAJzampBodfn9gZqQQ93IgFzIARzampBodfn9gZqQQN3IgJqIQogBiAJIAEgESADIAIgFSAEIAEgAnMgA3NqakGh1+f2BmpBCXciBHMgAXNqakGh1+f2BmpBC3ciAyAEcyACc2pqQaHX5/YGakEPd2ohBiADIAdqIQcgBCAIaiEIIAVBQGshBQwBCwsgCiQBIAYkAiAHJAMgCCQECw0AIAAQASMAIABqJAAL/wQCA38BfiMAIABqrUIDhiEEIABByABqQUBxIgJBCGshAyAAIgFBAWohACABQYABOgAAA0AgACACSUEAIABBB3EbBEAgAEEAOgAAIABBAWohAAwBCwsDQCAAIAJJBEAgAEIANwMAIABBCGohAAwBCwsgAyAENwMAIAIQAUEAIwGtIgRC//8DgyAEQoCA/P8Pg0IQhoQiBEL/gYCA8B+DIARCgP6DgIDgP4NCCIaEIgRCj4C8gPCBwAeDQgiGIARC8IHAh4CegPgAg0IEiIQiBEKGjJiw4MCBgwZ8QgSIQoGChIiQoMCAAYNCJ34gBEKw4MCBg4aMmDCEfDcDAEEIIwKtIgRC//8DgyAEQoCA/P8Pg0IQhoQiBEL/gYCA8B+DIARCgP6DgIDgP4NCCIaEIgRCj4C8gPCBwAeDQgiGIARC8IHAh4CegPgAg0IEiIQiBEKGjJiw4MCBgwZ8QgSIQoGChIiQoMCAAYNCJ34gBEKw4MCBg4aMmDCEfDcDAEEQIwOtIgRC//8DgyAEQoCA/P8Pg0IQhoQiBEL/gYCA8B+DIARCgP6DgIDgP4NCCIaEIgRCj4C8gPCBwAeDQgiGIARC8IHAh4CegPgAg0IEiIQiBEKGjJiw4MCBgwZ8QgSIQoGChIiQoMCAAYNCJ34gBEKw4MCBg4aMmDCEfDcDAEEYIwStIgRC//8DgyAEQoCA/P8Pg0IQhoQiBEL/gYCA8B+DIARCgP6DgIDgP4NCCIaEIgRCj4C8gPCBwAeDQgiGIARC8IHAh4CegPgAg0IEiIQiBEKGjJiw4MCBgwZ8QgSIQoGChIiQoMCAAYNCJ34gBEKw4MCBg4aMmDCEfDcDAAs=",
12096
12213
  "base64"
12097
12214
  )
12098
12215
  );
12099
12216
  //#endregion
12100
12217
 
12101
- xxhash64_1 = create.bind(null, xxhash64, [], 32, 16);
12102
- return xxhash64_1;
12218
+ md4_1 = create.bind(null, md4, [], 64, 32);
12219
+ return md4_1;
12103
12220
  }
12104
12221
 
12105
12222
  var BatchedHash_1;
@@ -12180,143 +12297,27 @@ function requireBatchedHash () {
12180
12297
  Author Tobias Koppers @sokra
12181
12298
  */
12182
12299
 
12183
- var md4_1;
12184
- var hasRequiredMd4;
12300
+ var xxhash64_1;
12301
+ var hasRequiredXxhash64;
12185
12302
 
12186
- function requireMd4 () {
12187
- if (hasRequiredMd4) return md4_1;
12188
- hasRequiredMd4 = 1;
12303
+ function requireXxhash64 () {
12304
+ if (hasRequiredXxhash64) return xxhash64_1;
12305
+ hasRequiredXxhash64 = 1;
12189
12306
 
12190
12307
  const create = requireWasmHash();
12191
12308
 
12192
- //#region wasm code: md4 (../../../assembly/hash/md4.asm.ts) --initialMemory 1
12193
- const md4 = new WebAssembly.Module(
12309
+ //#region wasm code: xxhash64 (../../../assembly/hash/xxhash64.asm.ts) --initialMemory 1
12310
+ const xxhash64 = new WebAssembly.Module(
12194
12311
  Buffer.from(
12195
- // 2150 bytes
12196
- "AGFzbQEAAAABCAJgAX8AYAAAAwUEAQAAAAUDAQABBhoFfwFBAAt/AUEAC38BQQALfwFBAAt/AUEACwciBARpbml0AAAGdXBkYXRlAAIFZmluYWwAAwZtZW1vcnkCAAqFEAQmAEGBxpS6BiQBQYnXtv5+JAJB/rnrxXkkA0H2qMmBASQEQQAkAAvMCgEYfyMBIQojAiEGIwMhByMEIQgDQCAAIAVLBEAgBSgCCCINIAcgBiAFKAIEIgsgCCAHIAUoAgAiDCAKIAggBiAHIAhzcXNqakEDdyIDIAYgB3Nxc2pqQQd3IgEgAyAGc3FzampBC3chAiAFKAIUIg8gASACIAUoAhAiCSADIAEgBSgCDCIOIAYgAyACIAEgA3Nxc2pqQRN3IgQgASACc3FzampBA3ciAyACIARzcXNqakEHdyEBIAUoAiAiEiADIAEgBSgCHCIRIAQgAyAFKAIYIhAgAiAEIAEgAyAEc3FzampBC3ciAiABIANzcXNqakETdyIEIAEgAnNxc2pqQQN3IQMgBSgCLCIVIAQgAyAFKAIoIhQgAiAEIAUoAiQiEyABIAIgAyACIARzcXNqakEHdyIBIAMgBHNxc2pqQQt3IgIgASADc3FzampBE3chBCAPIBAgCSAVIBQgEyAFKAI4IhYgAiAEIAUoAjQiFyABIAIgBSgCMCIYIAMgASAEIAEgAnNxc2pqQQN3IgEgAiAEc3FzampBB3ciAiABIARzcXNqakELdyIDIAkgAiAMIAEgBSgCPCIJIAQgASADIAEgAnNxc2pqQRN3IgEgAiADcnEgAiADcXJqakGZ84nUBWpBA3ciAiABIANycSABIANxcmpqQZnzidQFakEFdyIEIAEgAnJxIAEgAnFyaiASakGZ84nUBWpBCXciAyAPIAQgCyACIBggASADIAIgBHJxIAIgBHFyampBmfOJ1AVqQQ13IgEgAyAEcnEgAyAEcXJqakGZ84nUBWpBA3ciAiABIANycSABIANxcmpqQZnzidQFakEFdyIEIAEgAnJxIAEgAnFyampBmfOJ1AVqQQl3IgMgECAEIAIgFyABIAMgAiAEcnEgAiAEcXJqakGZ84nUBWpBDXciASADIARycSADIARxcmogDWpBmfOJ1AVqQQN3IgIgASADcnEgASADcXJqakGZ84nUBWpBBXciBCABIAJycSABIAJxcmpqQZnzidQFakEJdyIDIBEgBCAOIAIgFiABIAMgAiAEcnEgAiAEcXJqakGZ84nUBWpBDXciASADIARycSADIARxcmpqQZnzidQFakEDdyICIAEgA3JxIAEgA3FyampBmfOJ1AVqQQV3IgQgASACcnEgASACcXJqakGZ84nUBWpBCXciAyAMIAIgAyAJIAEgAyACIARycSACIARxcmpqQZnzidQFakENdyIBcyAEc2pqQaHX5/YGakEDdyICIAQgASACcyADc2ogEmpBodfn9gZqQQl3IgRzIAFzampBodfn9gZqQQt3IgMgAiADIBggASADIARzIAJzampBodfn9gZqQQ93IgFzIARzaiANakGh1+f2BmpBA3ciAiAUIAQgASACcyADc2pqQaHX5/YGakEJdyIEcyABc2pqQaHX5/YGakELdyIDIAsgAiADIBYgASADIARzIAJzampBodfn9gZqQQ93IgFzIARzampBodfn9gZqQQN3IgIgEyAEIAEgAnMgA3NqakGh1+f2BmpBCXciBHMgAXNqakGh1+f2BmpBC3chAyAKIA4gAiADIBcgASADIARzIAJzampBodfn9gZqQQ93IgFzIARzampBodfn9gZqQQN3IgJqIQogBiAJIAEgESADIAIgFSAEIAEgAnMgA3NqakGh1+f2BmpBCXciBHMgAXNqakGh1+f2BmpBC3ciAyAEcyACc2pqQaHX5/YGakEPd2ohBiADIAdqIQcgBCAIaiEIIAVBQGshBQwBCwsgCiQBIAYkAiAHJAMgCCQECw0AIAAQASMAIABqJAAL/wQCA38BfiMAIABqrUIDhiEEIABByABqQUBxIgJBCGshAyAAIgFBAWohACABQYABOgAAA0AgACACSUEAIABBB3EbBEAgAEEAOgAAIABBAWohAAwBCwsDQCAAIA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C/4GAgPAfg0IQhiACQoD+g4CA4D+DQgiIhCICQo+AvIDwgcAHg0IIhiACQvCBwIeAnoD4AINCBIiEIgJChoyYsODAgYMGfEIEiEKBgoSIkKDAgAGDQid+IAJCsODAgYOGjJgwhHw3AwAL",
12197
12314
  "base64"
12198
12315
  )
12199
12316
  );
12200
12317
  //#endregion
12201
12318
 
12202
- md4_1 = create.bind(null, md4, [], 64, 32);
12203
- return md4_1;
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;
12319
+ xxhash64_1 = create.bind(null, xxhash64, [], 32, 16);
12320
+ return xxhash64_1;
12320
12321
  }
12321
12322
 
12322
12323
  const baseEncodeTables = {
@@ -13821,9 +13822,19 @@ function localizeNode(rule, mode, localAliasMap) {
13821
13822
  hasLocals: false,
13822
13823
  explicit: context.explicit,
13823
13824
  };
13824
- newNodes = node.map((childNode) =>
13825
- transform(childNode, childContext)
13826
- );
13825
+ newNodes = node.map((childNode) => {
13826
+ const newContext = {
13827
+ ...childContext,
13828
+ enforceNoSpacing: false,
13829
+ };
13830
+
13831
+ const result = transform(childNode, newContext);
13832
+
13833
+ childContext.global = newContext.global;
13834
+ childContext.hasLocals = newContext.hasLocals;
13835
+
13836
+ return result;
13837
+ });
13827
13838
 
13828
13839
  node = node.clone();
13829
13840
  node.nodes = normalizeNodeArray(newNodes);
@@ -13964,19 +13975,34 @@ function localizeDeclNode(node, context) {
13964
13975
  return node;
13965
13976
  }
13966
13977
 
13967
- function isWordAFunctionArgument(wordNode, functionNode) {
13968
- return functionNode
13969
- ? functionNode.nodes.some(
13970
- (functionNodeChild) =>
13971
- functionNodeChild.sourceIndex === wordNode.sourceIndex
13972
- )
13973
- : false;
13974
- }
13978
+ // `none` is special value, other is global values
13979
+ const specialKeywords = [
13980
+ "none",
13981
+ "inherit",
13982
+ "initial",
13983
+ "revert",
13984
+ "revert-layer",
13985
+ "unset",
13986
+ ];
13975
13987
 
13976
13988
  function localizeDeclarationValues(localize, declaration, context) {
13977
13989
  const valueNodes = valueParser(declaration.value);
13978
13990
 
13979
13991
  valueNodes.walk((node, index, nodes) => {
13992
+ if (
13993
+ node.type === "function" &&
13994
+ (node.value.toLowerCase() === "var" || node.value.toLowerCase() === "env")
13995
+ ) {
13996
+ return false;
13997
+ }
13998
+
13999
+ if (
14000
+ node.type === "word" &&
14001
+ specialKeywords.includes(node.value.toLowerCase())
14002
+ ) {
14003
+ return;
14004
+ }
14005
+
13980
14006
  const subContext = {
13981
14007
  options: context.options,
13982
14008
  global: context.global,
@@ -13993,57 +14019,80 @@ function localizeDeclaration(declaration, context) {
13993
14019
  const isAnimation = /animation$/i.test(declaration.prop);
13994
14020
 
13995
14021
  if (isAnimation) {
13996
- const validIdent = /^-?[_a-z][_a-z0-9-]*$/i;
14022
+ // letter
14023
+ // An uppercase letter or a lowercase letter.
14024
+ //
14025
+ // ident-start code point
14026
+ // A letter, a non-ASCII code point, or U+005F LOW LINE (_).
14027
+ //
14028
+ // ident code point
14029
+ // An ident-start code point, a digit, or U+002D HYPHEN-MINUS (-).
14030
+
14031
+ // We don't validate `hex digits`, because we don't need it, it is work of linters.
14032
+ const validIdent =
14033
+ /^-?([a-z\u0080-\uFFFF_]|(\\[^\r\n\f])|-)((\\[^\r\n\f])|[a-z\u0080-\uFFFF_0-9-])*$/i;
13997
14034
 
13998
14035
  /*
13999
14036
  The spec defines some keywords that you can use to describe properties such as the timing
14000
14037
  function. These are still valid animation names, so as long as there is a property that accepts
14001
14038
  a keyword, it is given priority. Only when all the properties that can take a keyword are
14002
14039
  exhausted can the animation name be set to the keyword. I.e.
14003
-
14040
+
14004
14041
  animation: infinite infinite;
14005
-
14042
+
14006
14043
  The animation will repeat an infinite number of times from the first argument, and will have an
14007
14044
  animation name of infinite from the second.
14008
14045
  */
14009
14046
  const animationKeywords = {
14047
+ // animation-direction
14048
+ $normal: 1,
14049
+ $reverse: 1,
14010
14050
  $alternate: 1,
14011
14051
  "$alternate-reverse": 1,
14052
+ // animation-fill-mode
14053
+ $forwards: 1,
14012
14054
  $backwards: 1,
14013
14055
  $both: 1,
14056
+ // animation-iteration-count
14057
+ $infinite: 1,
14058
+ // animation-play-state
14059
+ $paused: 1,
14060
+ $running: 1,
14061
+ // animation-timing-function
14014
14062
  $ease: 1,
14015
14063
  "$ease-in": 1,
14016
- "$ease-in-out": 1,
14017
14064
  "$ease-out": 1,
14018
- $forwards: 1,
14019
- $infinite: 1,
14065
+ "$ease-in-out": 1,
14020
14066
  $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
14067
  "$step-end": 1,
14027
14068
  "$step-start": 1,
14069
+ // Special
14070
+ $none: Infinity, // No matter how many times you write none, it will never be an animation name
14071
+ // Global values
14028
14072
  $initial: Infinity,
14029
14073
  $inherit: Infinity,
14030
14074
  $unset: Infinity,
14075
+ $revert: Infinity,
14076
+ "$revert-layer": Infinity,
14031
14077
  };
14032
14078
  let parsedAnimationKeywords = {};
14033
- let stepsFunctionNode = null;
14034
14079
  const valueNodes = valueParser(declaration.value).walk((node) => {
14035
- /* If div-token appeared (represents as comma ','), a possibility of an animation-keywords should be reflesh. */
14080
+ // If div-token appeared (represents as comma ','), a possibility of an animation-keywords should be reflesh.
14036
14081
  if (node.type === "div") {
14037
14082
  parsedAnimationKeywords = {};
14083
+
14084
+ return;
14085
+ }
14086
+ // Do not handle nested functions
14087
+ else if (node.type === "function") {
14088
+ return false;
14038
14089
  }
14039
- if (node.type === "function" && node.value.toLowerCase() === "steps") {
14040
- stepsFunctionNode = node;
14090
+ // Ignore all except word
14091
+ else if (node.type !== "word") {
14092
+ return;
14041
14093
  }
14042
- const value =
14043
- node.type === "word" &&
14044
- !isWordAFunctionArgument(node, stepsFunctionNode)
14045
- ? node.value.toLowerCase()
14046
- : null;
14094
+
14095
+ const value = node.type === "word" ? node.value.toLowerCase() : null;
14047
14096
 
14048
14097
  let shouldParseAnimationName = false;
14049
14098
 
@@ -14068,6 +14117,7 @@ function localizeDeclaration(declaration, context) {
14068
14117
  localizeNextItem: shouldParseAnimationName && !context.global,
14069
14118
  localAliasMap: context.localAliasMap,
14070
14119
  };
14120
+
14071
14121
  return localizeDeclNode(node, subContext);
14072
14122
  });
14073
14123
 
@@ -15472,6 +15522,7 @@ function specifierEnd(s, end, nodeEnd) {
15472
15522
 
15473
15523
  const normalScriptDefaultVar = `__default__`;
15474
15524
  function processNormalScript(ctx, scopeId) {
15525
+ var _a;
15475
15526
  const script = ctx.descriptor.script;
15476
15527
  if (script.lang && !ctx.isJS && !ctx.isTS) {
15477
15528
  return script;
@@ -15510,7 +15561,7 @@ function processNormalScript(ctx, scopeId) {
15510
15561
  const s = new MagicString(content);
15511
15562
  rewriteDefaultAST(scriptAst.body, s, defaultVar);
15512
15563
  content = s.toString();
15513
- if (cssVars.length) {
15564
+ if (cssVars.length && !((_a = ctx.options.templateOptions) == null ? void 0 : _a.ssr)) {
15514
15565
  content += genNormalScriptCssVarsCode(
15515
15566
  cssVars,
15516
15567
  bindings,
@@ -18195,7 +18246,7 @@ function importSourceToScope(ctx, node, scope, source) {
18195
18246
  let resolved = scope.resolvedImportSources[source];
18196
18247
  if (!resolved) {
18197
18248
  if (source.startsWith(".")) {
18198
- const filename = joinPaths(scope.filename, "..", source);
18249
+ const filename = joinPaths(path$3.dirname(scope.filename), source);
18199
18250
  resolved = resolveExt(filename, fs);
18200
18251
  } else {
18201
18252
  if (!ts) {
@@ -19075,7 +19126,7 @@ function genRuntimeProps(ctx) {
19075
19126
  }
19076
19127
  }
19077
19128
  } else if (ctx.propsTypeDecl) {
19078
- propsDecls = genRuntimePropsFromTypes(ctx);
19129
+ propsDecls = extractRuntimeProps(ctx);
19079
19130
  }
19080
19131
  const modelsDecls = genModelProps(ctx);
19081
19132
  if (propsDecls && modelsDecls) {
@@ -19084,7 +19135,7 @@ function genRuntimeProps(ctx) {
19084
19135
  return modelsDecls || propsDecls;
19085
19136
  }
19086
19137
  }
19087
- function genRuntimePropsFromTypes(ctx) {
19138
+ function extractRuntimeProps(ctx) {
19088
19139
  const props = resolveRuntimePropsFromType(ctx, ctx.propsTypeDecl);
19089
19140
  if (!props.length) {
19090
19141
  return;
@@ -19093,7 +19144,7 @@ function genRuntimePropsFromTypes(ctx) {
19093
19144
  const hasStaticDefaults = hasStaticWithDefaults(ctx);
19094
19145
  for (const prop of props) {
19095
19146
  propStrings.push(genRuntimePropFromType(ctx, prop, hasStaticDefaults));
19096
- if (!(prop.key in ctx.bindingMetadata)) {
19147
+ if ("bindingMetadata" in ctx && !(prop.key in ctx.bindingMetadata)) {
19097
19148
  ctx.bindingMetadata[prop.key] = "props";
19098
19149
  }
19099
19150
  }
@@ -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
- !(options.inlineTemplate && ((_a = options.templateOptions) == null ? void 0 : _a.ssr))) {
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,7 @@ function isStaticNode(node) {
20410
20461
  return false;
20411
20462
  }
20412
20463
 
20413
- const version = "3.3.6";
20464
+ const version = "3.4.0-alpha.1";
20414
20465
  const walk = estreeWalker.walk;
20415
20466
 
20416
20467
  exports.babelParse = parser$2.parse;
@@ -20427,6 +20478,8 @@ exports.compileScript = compileScript;
20427
20478
  exports.compileStyle = compileStyle;
20428
20479
  exports.compileStyleAsync = compileStyleAsync;
20429
20480
  exports.compileTemplate = compileTemplate;
20481
+ exports.extractRuntimeEmits = extractRuntimeEmits;
20482
+ exports.extractRuntimeProps = extractRuntimeProps;
20430
20483
  exports.inferRuntimeType = inferRuntimeType;
20431
20484
  exports.invalidateTypeCache = invalidateTypeCache;
20432
20485
  exports.parse = parse$2;
@@ -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' | 'options'> & Partial<Pick<ScriptCompileContext, 'scope' | 'globalScopes' | 'deps' | 'fs'>> & {
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;
@@ -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
- node.codegenNode.children = context.hoist(
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,
@@ -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 slotFunction = buildSlotFn(slotProps, slotChildren, slotLoc);
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 = findDir(slotElement, "for")) {
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) {
@@ -26389,6 +26400,7 @@ var CompilerDOM = /*#__PURE__*/Object.freeze({
26389
26400
  CREATE_TEXT: CREATE_TEXT,
26390
26401
  CREATE_VNODE: CREATE_VNODE,
26391
26402
  DOMDirectiveTransforms: DOMDirectiveTransforms,
26403
+ DOMErrorMessages: DOMErrorMessages,
26392
26404
  DOMNodeTransforms: DOMNodeTransforms,
26393
26405
  FRAGMENT: FRAGMENT,
26394
26406
  GUARD_REACTIVE_PROPS: GUARD_REACTIVE_PROPS,
@@ -26463,6 +26475,7 @@ var CompilerDOM = /*#__PURE__*/Object.freeze({
26463
26475
  createTemplateLiteral: createTemplateLiteral,
26464
26476
  createTransformContext: createTransformContext,
26465
26477
  createVNodeCall: createVNodeCall,
26478
+ errorMessages: errorMessages,
26466
26479
  extractIdentifiers: extractIdentifiers,
26467
26480
  findDir: findDir,
26468
26481
  findProp: findProp,
@@ -32031,7 +32044,7 @@ function ssrProcessTeleport(node, context) {
32031
32044
  );
32032
32045
  }
32033
32046
 
32034
- const wipMap$2 = /* @__PURE__ */ new WeakMap();
32047
+ const wipMap$3 = /* @__PURE__ */ new WeakMap();
32035
32048
  function ssrTransformSuspense(node, context) {
32036
32049
  return () => {
32037
32050
  if (node.children.length) {
@@ -32040,29 +32053,33 @@ function ssrTransformSuspense(node, context) {
32040
32053
  // to be immediately set
32041
32054
  wipSlots: []
32042
32055
  };
32043
- wipMap$2.set(node, wipEntry);
32044
- wipEntry.slotsExp = buildSlots(node, context, (_props, children, loc) => {
32045
- const fn = createFunctionExpression(
32046
- [],
32047
- void 0,
32048
- // no return, assign body later
32049
- true,
32050
- // newline
32051
- false,
32052
- // suspense slots are not treated as normal slots
32053
- loc
32054
- );
32055
- wipEntry.wipSlots.push({
32056
- fn,
32057
- children
32058
- });
32059
- return fn;
32060
- }).slots;
32056
+ wipMap$3.set(node, wipEntry);
32057
+ wipEntry.slotsExp = buildSlots(
32058
+ node,
32059
+ context,
32060
+ (_props, _vForExp, children, loc) => {
32061
+ const fn = createFunctionExpression(
32062
+ [],
32063
+ void 0,
32064
+ // no return, assign body later
32065
+ true,
32066
+ // newline
32067
+ false,
32068
+ // suspense slots are not treated as normal slots
32069
+ loc
32070
+ );
32071
+ wipEntry.wipSlots.push({
32072
+ fn,
32073
+ children
32074
+ });
32075
+ return fn;
32076
+ }
32077
+ ).slots;
32061
32078
  }
32062
32079
  };
32063
32080
  }
32064
32081
  function ssrProcessSuspense(node, context) {
32065
- const wipEntry = wipMap$2.get(node);
32082
+ const wipEntry = wipMap$3.get(node);
32066
32083
  if (!wipEntry) {
32067
32084
  return;
32068
32085
  }
@@ -32368,7 +32385,7 @@ function ssrProcessElement(node, context) {
32368
32385
  }
32369
32386
  }
32370
32387
 
32371
- const wipMap$1 = /* @__PURE__ */ new WeakMap();
32388
+ const wipMap$2 = /* @__PURE__ */ new WeakMap();
32372
32389
  function ssrTransformTransitionGroup(node, context) {
32373
32390
  return () => {
32374
32391
  const tag = findProp(node, "tag");
@@ -32389,7 +32406,7 @@ function ssrTransformTransitionGroup(node, context) {
32389
32406
  buildSSRProps(props, directives, context)
32390
32407
  ]);
32391
32408
  }
32392
- wipMap$1.set(node, {
32409
+ wipMap$2.set(node, {
32393
32410
  tag,
32394
32411
  propsExp,
32395
32412
  scopeId: context.scopeId || null
@@ -32398,7 +32415,7 @@ function ssrTransformTransitionGroup(node, context) {
32398
32415
  };
32399
32416
  }
32400
32417
  function ssrProcessTransitionGroup(node, context) {
32401
- const entry = wipMap$1.get(node);
32418
+ const entry = wipMap$2.get(node);
32402
32419
  if (entry) {
32403
32420
  const { tag, propsExp, scopeId } = entry;
32404
32421
  if (tag.type === 7) {
@@ -32443,6 +32460,25 @@ function ssrProcessTransitionGroup(node, context) {
32443
32460
  }
32444
32461
  }
32445
32462
 
32463
+ const wipMap$1 = /* @__PURE__ */ new WeakMap();
32464
+ function ssrTransformTransition(node, context) {
32465
+ return () => {
32466
+ const appear = findProp(node, "appear", false, true);
32467
+ wipMap$1.set(node, !!appear);
32468
+ };
32469
+ }
32470
+ function ssrProcessTransition(node, context) {
32471
+ node.children = node.children.filter((c) => c.type !== 3);
32472
+ const appear = wipMap$1.get(node);
32473
+ if (appear) {
32474
+ context.pushStringPart(`<template>`);
32475
+ processChildren(node, context, false, true);
32476
+ context.pushStringPart(`</template>`);
32477
+ } else {
32478
+ processChildren(node, context, false, true);
32479
+ }
32480
+ }
32481
+
32446
32482
  var __defProp$8 = Object.defineProperty;
32447
32483
  var __defProps$8 = Object.defineProperties;
32448
32484
  var __getOwnPropDescs$8 = Object.getOwnPropertyDescriptors;
@@ -32480,9 +32516,10 @@ const ssrTransformComponent = (node, context) => {
32480
32516
  if (isSymbol$1(component)) {
32481
32517
  if (component === SUSPENSE) {
32482
32518
  return ssrTransformSuspense(node, context);
32483
- }
32484
- if (component === TRANSITION_GROUP) {
32519
+ } else if (component === TRANSITION_GROUP) {
32485
32520
  return ssrTransformTransitionGroup(node, context);
32521
+ } else if (component === TRANSITION) {
32522
+ return ssrTransformTransition(node);
32486
32523
  }
32487
32524
  return;
32488
32525
  }
@@ -32490,8 +32527,10 @@ const ssrTransformComponent = (node, context) => {
32490
32527
  const clonedNode = clone(node);
32491
32528
  return function ssrPostTransformComponent() {
32492
32529
  if (clonedNode.children.length) {
32493
- buildSlots(clonedNode, context, (props, children) => {
32494
- vnodeBranches.push(createVNodeSlotBranch(props, children, context));
32530
+ buildSlots(clonedNode, context, (props, vFor, children) => {
32531
+ vnodeBranches.push(
32532
+ createVNodeSlotBranch(props, vFor, children, context)
32533
+ );
32495
32534
  return createFunctionExpression(void 0);
32496
32535
  });
32497
32536
  }
@@ -32510,7 +32549,7 @@ const ssrTransformComponent = (node, context) => {
32510
32549
  }
32511
32550
  const wipEntries = [];
32512
32551
  wipMap.set(node, wipEntries);
32513
- const buildSSRSlotFn = (props, children, loc) => {
32552
+ const buildSSRSlotFn = (props, _vForExp, children, loc) => {
32514
32553
  const param0 = props && stringifyExpression(props) || `_`;
32515
32554
  const fn = createFunctionExpression(
32516
32555
  [param0, `_push`, `_parent`, `_scopeId`],
@@ -32567,7 +32606,7 @@ function ssrProcessComponent(node, context, parent) {
32567
32606
  context.pushStringPart(``);
32568
32607
  }
32569
32608
  if (component === TRANSITION) {
32570
- node.children = node.children.filter((c) => c.type !== 3);
32609
+ return ssrProcessTransition(node, context);
32571
32610
  }
32572
32611
  processChildren(node, context);
32573
32612
  }
@@ -32603,7 +32642,7 @@ const rawOptionsMap = /* @__PURE__ */ new WeakMap();
32603
32642
  const [baseNodeTransforms, baseDirectiveTransforms] = getBaseTransformPreset(true);
32604
32643
  const vnodeNodeTransforms = [...baseNodeTransforms, ...DOMNodeTransforms];
32605
32644
  const vnodeDirectiveTransforms = __spreadValues$8(__spreadValues$8({}, baseDirectiveTransforms), DOMDirectiveTransforms);
32606
- function createVNodeSlotBranch(props, children, parentContext) {
32645
+ function createVNodeSlotBranch(props, vForExp, children, parentContext) {
32607
32646
  const rawOptions = rawOptionsMap.get(parentContext.root);
32608
32647
  const subOptions = __spreadProps$8(__spreadValues$8({}, rawOptions), {
32609
32648
  // overwrite with vnode-based transforms
@@ -32619,8 +32658,8 @@ function createVNodeSlotBranch(props, children, parentContext) {
32619
32658
  tag: "template",
32620
32659
  tagType: 3,
32621
32660
  isSelfClosing: false,
32622
- // important: provide v-slot="props" on the wrapper for proper
32623
- // scope analysis
32661
+ // important: provide v-slot="props" and v-for="exp" on the wrapper for
32662
+ // proper scope analysis
32624
32663
  props: [
32625
32664
  {
32626
32665
  type: 7,
@@ -32629,6 +32668,14 @@ function createVNodeSlotBranch(props, children, parentContext) {
32629
32668
  arg: void 0,
32630
32669
  modifiers: [],
32631
32670
  loc: locStub
32671
+ },
32672
+ {
32673
+ type: 7,
32674
+ name: "for",
32675
+ exp: vForExp,
32676
+ arg: void 0,
32677
+ modifiers: [],
32678
+ loc: locStub
32632
32679
  }
32633
32680
  ],
32634
32681
  children,
@@ -33310,6 +33357,7 @@ function doCompileTemplate({
33310
33357
  slotted,
33311
33358
  sourceMap: true
33312
33359
  }, compilerOptions), {
33360
+ hmr: !isProd,
33313
33361
  nodeTransforms: nodeTransforms.concat(compilerOptions.nodeTransforms || []),
33314
33362
  filename,
33315
33363
  onError: (e) => errors.push(e),
@@ -46877,6 +46925,7 @@ var __spreadValues$2 = (a, b) => {
46877
46925
  var __spreadProps$2 = (a, b) => __defProps$2(a, __getOwnPropDescs$2(b));
46878
46926
  const normalScriptDefaultVar = `__default__`;
46879
46927
  function processNormalScript(ctx, scopeId) {
46928
+ var _a;
46880
46929
  const script = ctx.descriptor.script;
46881
46930
  if (script.lang && !ctx.isJS && !ctx.isTS) {
46882
46931
  return script;
@@ -46915,7 +46964,7 @@ function processNormalScript(ctx, scopeId) {
46915
46964
  const s = new MagicString(content);
46916
46965
  rewriteDefaultAST(scriptAst.body, s, defaultVar);
46917
46966
  content = s.toString();
46918
- if (cssVars.length) {
46967
+ if (cssVars.length && !((_a = ctx.options.templateOptions) == null ? void 0 : _a.ssr)) {
46919
46968
  content += genNormalScriptCssVarsCode(
46920
46969
  cssVars,
46921
46970
  bindings,
@@ -47585,7 +47634,7 @@ function importSourceToScope(ctx, node, scope, source) {
47585
47634
  let resolved = scope.resolvedImportSources[source];
47586
47635
  if (!resolved) {
47587
47636
  if (source.startsWith(".")) {
47588
- const filename = joinPaths(scope.filename, "..", source);
47637
+ const filename = joinPaths(dirname$2(scope.filename), source);
47589
47638
  resolved = resolveExt(filename, fs);
47590
47639
  } else {
47591
47640
  {
@@ -48381,7 +48430,7 @@ function genRuntimeProps(ctx) {
48381
48430
  }
48382
48431
  }
48383
48432
  } else if (ctx.propsTypeDecl) {
48384
- propsDecls = genRuntimePropsFromTypes(ctx);
48433
+ propsDecls = extractRuntimeProps(ctx);
48385
48434
  }
48386
48435
  const modelsDecls = genModelProps(ctx);
48387
48436
  if (propsDecls && modelsDecls) {
@@ -48390,7 +48439,7 @@ function genRuntimeProps(ctx) {
48390
48439
  return modelsDecls || propsDecls;
48391
48440
  }
48392
48441
  }
48393
- function genRuntimePropsFromTypes(ctx) {
48442
+ function extractRuntimeProps(ctx) {
48394
48443
  const props = resolveRuntimePropsFromType(ctx, ctx.propsTypeDecl);
48395
48444
  if (!props.length) {
48396
48445
  return;
@@ -48399,7 +48448,7 @@ function genRuntimePropsFromTypes(ctx) {
48399
48448
  const hasStaticDefaults = hasStaticWithDefaults(ctx);
48400
48449
  for (const prop of props) {
48401
48450
  propStrings.push(genRuntimePropFromType(ctx, prop, hasStaticDefaults));
48402
- if (!(prop.key in ctx.bindingMetadata)) {
48451
+ if ("bindingMetadata" in ctx && !(prop.key in ctx.bindingMetadata)) {
48403
48452
  ctx.bindingMetadata[prop.key] = "props";
48404
48453
  }
48405
48454
  }
@@ -49349,7 +49398,7 @@ const ${normalScriptDefaultVar} = ${defaultSpecifier.local.name}
49349
49398
  }
49350
49399
  }
49351
49400
  if (sfc.cssVars.length && // no need to do this when targeting SSR
49352
- !(options.inlineTemplate && ((_a = options.templateOptions) == null ? void 0 : _a.ssr))) {
49401
+ !((_a = options.templateOptions) == null ? void 0 : _a.ssr)) {
49353
49402
  ctx.helperImports.add(CSS_VARS_HELPER);
49354
49403
  ctx.helperImports.add("unref");
49355
49404
  ctx.s.prependLeft(
@@ -49730,7 +49779,7 @@ function isStaticNode(node) {
49730
49779
  return false;
49731
49780
  }
49732
49781
 
49733
- const version = "3.3.6";
49782
+ const version = "3.4.0-alpha.1";
49734
49783
  const walk = walk$1;
49735
49784
 
49736
- 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.6",
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.3.6",
37
- "@vue/compiler-dom": "3.3.6",
38
- "@vue/compiler-ssr": "3.3.6",
39
- "@vue/reactivity-transform": "3.3.6",
40
- "@vue/shared": "3.3.6",
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",