@vue/compiler-sfc 3.6.0-rc.11 → 3.6.0-rc.13
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 +30 -21
- package/dist/compiler-sfc.esm-browser.js +493 -187
- package/package.json +10 -10
package/dist/compiler-sfc.cjs.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* @vue/compiler-sfc v3.6.0-rc.
|
|
2
|
+
* @vue/compiler-sfc v3.6.0-rc.13
|
|
3
3
|
* (c) 2018-present Yuxi (Evan) You and Vue contributors
|
|
4
4
|
* @license MIT
|
|
5
5
|
**/
|
|
@@ -9141,7 +9141,7 @@ const processors = {
|
|
|
9141
9141
|
stylus: styl
|
|
9142
9142
|
};
|
|
9143
9143
|
//#endregion
|
|
9144
|
-
//#region node_modules/.pnpm/postcss-modules@6.0.1_postcss@8.5.
|
|
9144
|
+
//#region node_modules/.pnpm/postcss-modules@6.0.1_postcss@8.5.29/node_modules/postcss-modules/build/fs.js
|
|
9145
9145
|
var require_fs = /* @__PURE__ */ __commonJSMin(((exports) => {
|
|
9146
9146
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
9147
9147
|
exports.getFileSystem = getFileSystem;
|
|
@@ -9163,7 +9163,7 @@ var require_fs = /* @__PURE__ */ __commonJSMin(((exports) => {
|
|
|
9163
9163
|
}
|
|
9164
9164
|
}));
|
|
9165
9165
|
//#endregion
|
|
9166
|
-
//#region node_modules/.pnpm/postcss-modules@6.0.1_postcss@8.5.
|
|
9166
|
+
//#region node_modules/.pnpm/postcss-modules@6.0.1_postcss@8.5.29/node_modules/postcss-modules/build/unquote.js
|
|
9167
9167
|
var require_unquote = /* @__PURE__ */ __commonJSMin(((exports) => {
|
|
9168
9168
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
9169
9169
|
exports.default = unquote;
|
|
@@ -9176,7 +9176,7 @@ var require_unquote = /* @__PURE__ */ __commonJSMin(((exports) => {
|
|
|
9176
9176
|
}
|
|
9177
9177
|
}));
|
|
9178
9178
|
//#endregion
|
|
9179
|
-
//#region node_modules/.pnpm/icss-utils@5.1.0_postcss@8.5.
|
|
9179
|
+
//#region node_modules/.pnpm/icss-utils@5.1.0_postcss@8.5.29/node_modules/icss-utils/src/replaceValueSymbols.js
|
|
9180
9180
|
var require_replaceValueSymbols = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
9181
9181
|
const matchValueName = /[$]?[\w-]+/g;
|
|
9182
9182
|
const replaceValueSymbols = (value, replacements) => {
|
|
@@ -9193,7 +9193,7 @@ var require_replaceValueSymbols = /* @__PURE__ */ __commonJSMin(((exports, modul
|
|
|
9193
9193
|
module.exports = replaceValueSymbols;
|
|
9194
9194
|
}));
|
|
9195
9195
|
//#endregion
|
|
9196
|
-
//#region node_modules/.pnpm/icss-utils@5.1.0_postcss@8.5.
|
|
9196
|
+
//#region node_modules/.pnpm/icss-utils@5.1.0_postcss@8.5.29/node_modules/icss-utils/src/replaceSymbols.js
|
|
9197
9197
|
var require_replaceSymbols = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
9198
9198
|
const replaceValueSymbols = require_replaceValueSymbols();
|
|
9199
9199
|
const replaceSymbols = (css, replacements) => {
|
|
@@ -9206,7 +9206,7 @@ var require_replaceSymbols = /* @__PURE__ */ __commonJSMin(((exports, module) =>
|
|
|
9206
9206
|
module.exports = replaceSymbols;
|
|
9207
9207
|
}));
|
|
9208
9208
|
//#endregion
|
|
9209
|
-
//#region node_modules/.pnpm/icss-utils@5.1.0_postcss@8.5.
|
|
9209
|
+
//#region node_modules/.pnpm/icss-utils@5.1.0_postcss@8.5.29/node_modules/icss-utils/src/extractICSS.js
|
|
9210
9210
|
var require_extractICSS = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
9211
9211
|
const importPattern = /^:import\(("[^"]*"|'[^']*'|[^"']+)\)$/;
|
|
9212
9212
|
const balancedQuotes = /^("[^"]*"|'[^']*'|[^"']+)$/;
|
|
@@ -9260,7 +9260,7 @@ var require_extractICSS = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
|
9260
9260
|
module.exports = extractICSS;
|
|
9261
9261
|
}));
|
|
9262
9262
|
//#endregion
|
|
9263
|
-
//#region node_modules/.pnpm/icss-utils@5.1.0_postcss@8.5.
|
|
9263
|
+
//#region node_modules/.pnpm/icss-utils@5.1.0_postcss@8.5.29/node_modules/icss-utils/src/createICSSRules.js
|
|
9264
9264
|
var require_createICSSRules = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
9265
9265
|
const createImports = (imports, postcss, mode = "rule") => {
|
|
9266
9266
|
return Object.keys(imports).map((path) => {
|
|
@@ -9304,7 +9304,7 @@ var require_createICSSRules = /* @__PURE__ */ __commonJSMin(((exports, module) =
|
|
|
9304
9304
|
module.exports = createICSSRules;
|
|
9305
9305
|
}));
|
|
9306
9306
|
//#endregion
|
|
9307
|
-
//#region node_modules/.pnpm/icss-utils@5.1.0_postcss@8.5.
|
|
9307
|
+
//#region node_modules/.pnpm/icss-utils@5.1.0_postcss@8.5.29/node_modules/icss-utils/src/index.js
|
|
9308
9308
|
var require_src$4 = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
9309
9309
|
module.exports = {
|
|
9310
9310
|
replaceValueSymbols: require_replaceValueSymbols(),
|
|
@@ -9314,7 +9314,7 @@ var require_src$4 = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
|
9314
9314
|
};
|
|
9315
9315
|
}));
|
|
9316
9316
|
//#endregion
|
|
9317
|
-
//#region node_modules/.pnpm/postcss-modules@6.0.1_postcss@8.5.
|
|
9317
|
+
//#region node_modules/.pnpm/postcss-modules@6.0.1_postcss@8.5.29/node_modules/postcss-modules/build/Parser.js
|
|
9318
9318
|
var require_Parser = /* @__PURE__ */ __commonJSMin(((exports) => {
|
|
9319
9319
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
9320
9320
|
exports.default = void 0;
|
|
@@ -9382,7 +9382,7 @@ var require_Parser = /* @__PURE__ */ __commonJSMin(((exports) => {
|
|
|
9382
9382
|
exports.default = Parser;
|
|
9383
9383
|
}));
|
|
9384
9384
|
//#endregion
|
|
9385
|
-
//#region node_modules/.pnpm/postcss-modules@6.0.1_postcss@8.5.
|
|
9385
|
+
//#region node_modules/.pnpm/postcss-modules@6.0.1_postcss@8.5.29/node_modules/postcss-modules/build/saveJSON.js
|
|
9386
9386
|
var require_saveJSON = /* @__PURE__ */ __commonJSMin(((exports) => {
|
|
9387
9387
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
9388
9388
|
exports.default = saveJSON;
|
|
@@ -10063,7 +10063,7 @@ var require_lodash_camelcase = /* @__PURE__ */ __commonJSMin(((exports, module)
|
|
|
10063
10063
|
module.exports = camelCase;
|
|
10064
10064
|
}));
|
|
10065
10065
|
//#endregion
|
|
10066
|
-
//#region node_modules/.pnpm/postcss-modules@6.0.1_postcss@8.5.
|
|
10066
|
+
//#region node_modules/.pnpm/postcss-modules@6.0.1_postcss@8.5.29/node_modules/postcss-modules/build/localsConvention.js
|
|
10067
10067
|
var require_localsConvention = /* @__PURE__ */ __commonJSMin(((exports) => {
|
|
10068
10068
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
10069
10069
|
exports.makeLocalsConventionReducer = makeLocalsConventionReducer;
|
|
@@ -10101,7 +10101,7 @@ var require_localsConvention = /* @__PURE__ */ __commonJSMin(((exports) => {
|
|
|
10101
10101
|
}
|
|
10102
10102
|
}));
|
|
10103
10103
|
//#endregion
|
|
10104
|
-
//#region node_modules/.pnpm/postcss-modules@6.0.1_postcss@8.5.
|
|
10104
|
+
//#region node_modules/.pnpm/postcss-modules@6.0.1_postcss@8.5.29/node_modules/postcss-modules/build/FileSystemLoader.js
|
|
10105
10105
|
var require_FileSystemLoader = /* @__PURE__ */ __commonJSMin(((exports) => {
|
|
10106
10106
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
10107
10107
|
exports.default = void 0;
|
|
@@ -10186,7 +10186,7 @@ var require_FileSystemLoader = /* @__PURE__ */ __commonJSMin(((exports) => {
|
|
|
10186
10186
|
exports.default = FileSystemLoader;
|
|
10187
10187
|
}));
|
|
10188
10188
|
//#endregion
|
|
10189
|
-
//#region node_modules/.pnpm/postcss-modules-extract-imports@3.1.0_postcss@8.5.
|
|
10189
|
+
//#region node_modules/.pnpm/postcss-modules-extract-imports@3.1.0_postcss@8.5.29/node_modules/postcss-modules-extract-imports/src/topologicalSort.js
|
|
10190
10190
|
var require_topologicalSort = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
10191
10191
|
const PERMANENT_MARKER = 2;
|
|
10192
10192
|
const TEMPORARY_MARKER = 1;
|
|
@@ -10225,7 +10225,7 @@ var require_topologicalSort = /* @__PURE__ */ __commonJSMin(((exports, module) =
|
|
|
10225
10225
|
module.exports = topologicalSort;
|
|
10226
10226
|
}));
|
|
10227
10227
|
//#endregion
|
|
10228
|
-
//#region node_modules/.pnpm/postcss-modules-extract-imports@3.1.0_postcss@8.5.
|
|
10228
|
+
//#region node_modules/.pnpm/postcss-modules-extract-imports@3.1.0_postcss@8.5.29/node_modules/postcss-modules-extract-imports/src/index.js
|
|
10229
10229
|
var require_src$3 = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
10230
10230
|
const topologicalSort = require_topologicalSort();
|
|
10231
10231
|
const matchImports = /^(.+?)\s+from\s+(?:"([^"]+)"|'([^']+)'|(global))$/;
|
|
@@ -11148,7 +11148,7 @@ var require_lib = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
|
11148
11148
|
module.exports = ValueParser;
|
|
11149
11149
|
}));
|
|
11150
11150
|
//#endregion
|
|
11151
|
-
//#region node_modules/.pnpm/postcss-modules-local-by-default@4.2.0_postcss@8.5.
|
|
11151
|
+
//#region node_modules/.pnpm/postcss-modules-local-by-default@4.2.0_postcss@8.5.29/node_modules/postcss-modules-local-by-default/src/index.js
|
|
11152
11152
|
var require_src$2 = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
11153
11153
|
const selectorParser = require_dist();
|
|
11154
11154
|
const valueParser = require_lib();
|
|
@@ -11545,7 +11545,7 @@ var require_src$2 = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
|
11545
11545
|
module.exports.postcss = true;
|
|
11546
11546
|
}));
|
|
11547
11547
|
//#endregion
|
|
11548
|
-
//#region node_modules/.pnpm/postcss-modules-scope@3.2.1_postcss@8.5.
|
|
11548
|
+
//#region node_modules/.pnpm/postcss-modules-scope@3.2.1_postcss@8.5.29/node_modules/postcss-modules-scope/src/index.js
|
|
11549
11549
|
var require_src$1 = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
11550
11550
|
const selectorParser = require_dist();
|
|
11551
11551
|
const hasOwnProperty = Object.prototype.hasOwnProperty;
|
|
@@ -11723,7 +11723,7 @@ var require_string_hash = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
|
11723
11723
|
module.exports = hash;
|
|
11724
11724
|
}));
|
|
11725
11725
|
//#endregion
|
|
11726
|
-
//#region node_modules/.pnpm/postcss-modules-values@4.0.0_postcss@8.5.
|
|
11726
|
+
//#region node_modules/.pnpm/postcss-modules-values@4.0.0_postcss@8.5.29/node_modules/postcss-modules-values/src/index.js
|
|
11727
11727
|
var require_src = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
11728
11728
|
const ICSSUtils = require_src$4();
|
|
11729
11729
|
const matchImports = /^(.+?|\([\s\S]+?\))\s+from\s+("[^"]*"|'[^']*'|[\w-]+)$/;
|
|
@@ -11810,7 +11810,7 @@ var require_src = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
|
11810
11810
|
module.exports.postcss = true;
|
|
11811
11811
|
}));
|
|
11812
11812
|
//#endregion
|
|
11813
|
-
//#region node_modules/.pnpm/postcss-modules@6.0.1_postcss@8.5.
|
|
11813
|
+
//#region node_modules/.pnpm/postcss-modules@6.0.1_postcss@8.5.29/node_modules/postcss-modules/build/scoping.js
|
|
11814
11814
|
var require_scoping = /* @__PURE__ */ __commonJSMin(((exports) => {
|
|
11815
11815
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
11816
11816
|
exports.behaviours = void 0;
|
|
@@ -11872,7 +11872,7 @@ var require_scoping = /* @__PURE__ */ __commonJSMin(((exports) => {
|
|
|
11872
11872
|
}
|
|
11873
11873
|
}));
|
|
11874
11874
|
//#endregion
|
|
11875
|
-
//#region node_modules/.pnpm/postcss-modules@6.0.1_postcss@8.5.
|
|
11875
|
+
//#region node_modules/.pnpm/postcss-modules@6.0.1_postcss@8.5.29/node_modules/postcss-modules/build/pluginFactory.js
|
|
11876
11876
|
var require_pluginFactory = /* @__PURE__ */ __commonJSMin(((exports) => {
|
|
11877
11877
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
11878
11878
|
exports.makePlugin = makePlugin;
|
|
@@ -15171,11 +15171,14 @@ function transformDestructuredProps(ctx, vueImportAliases) {
|
|
|
15171
15171
|
const excludedIds = /* @__PURE__ */ new WeakSet();
|
|
15172
15172
|
const parentStack = [];
|
|
15173
15173
|
const propsLocalToPublicMap = Object.create(null);
|
|
15174
|
+
const modelOptionNodes = /* @__PURE__ */ new Set();
|
|
15175
|
+
let currentModelOption = null;
|
|
15174
15176
|
for (const key in ctx.propsDestructuredBindings) {
|
|
15175
15177
|
const { local } = ctx.propsDestructuredBindings[key];
|
|
15176
15178
|
rootScope[local] = true;
|
|
15177
15179
|
propsLocalToPublicMap[local] = key;
|
|
15178
15180
|
}
|
|
15181
|
+
for (const { runtimeOptionNodes } of Object.values(ctx.modelDecls)) for (const node of runtimeOptionNodes) modelOptionNodes.add(node);
|
|
15179
15182
|
function pushScope(isFunctionScope = false) {
|
|
15180
15183
|
const scope = currentScope = Object.create(currentScope);
|
|
15181
15184
|
scopeStack.push(scope);
|
|
@@ -15216,6 +15219,10 @@ function transformDestructuredProps(ctx, vueImportAliases) {
|
|
|
15216
15219
|
} });
|
|
15217
15220
|
}
|
|
15218
15221
|
function rewriteId(id, parent, parentStack) {
|
|
15222
|
+
if (currentModelOption) {
|
|
15223
|
+
const isDefault = (currentModelOption.type === "ObjectProperty" || currentModelOption.type === "ObjectMethod") && resolveObjectKey(currentModelOption.key, currentModelOption.computed) === "default";
|
|
15224
|
+
ctx.error(`\`${DEFINE_MODEL}()\` prop options cannot reference destructured props because they are hoisted outside of the setup() function.` + (isDefault ? ` Use the props argument of the default factory instead, e.g. default: props => props${(0, _vue_shared.genPropsAccessExp)(propsLocalToPublicMap[id.name]).slice(`__props`.length)}` : ``), id);
|
|
15225
|
+
}
|
|
15219
15226
|
if (parent.type === "AssignmentExpression" && id === parent.left || parent.type === "UpdateExpression") ctx.error(`Cannot assign to destructured props as they are readonly.`, id);
|
|
15220
15227
|
if ((0, _vue_compiler_dom.isStaticProperty)(parent) && parent.shorthand) {
|
|
15221
15228
|
if (!parent.inPattern || (0, _vue_compiler_dom.isInDestructureAssignment)(parent, parentStack)) ctx.s.appendLeft(id.end + ctx.startOffset, `: ${(0, _vue_shared.genPropsAccessExp)(propsLocalToPublicMap[id.name])}`);
|
|
@@ -15234,6 +15241,7 @@ function transformDestructuredProps(ctx, vueImportAliases) {
|
|
|
15234
15241
|
enter(node, parent) {
|
|
15235
15242
|
parent && parentStack.push(parent);
|
|
15236
15243
|
if (parent && parent.type.startsWith("TS") && !_vue_compiler_dom.TS_NODE_TYPES.includes(parent.type)) return this.skip();
|
|
15244
|
+
if (modelOptionNodes.has(node)) currentModelOption = node;
|
|
15237
15245
|
checkUsage(node, "watch", vueImportAliases.watch);
|
|
15238
15246
|
checkUsage(node, "toRef", vueImportAliases.toRef);
|
|
15239
15247
|
if ((0, _vue_compiler_dom.isFunctionType)(node)) {
|
|
@@ -15271,6 +15279,7 @@ function transformDestructuredProps(ctx, vueImportAliases) {
|
|
|
15271
15279
|
},
|
|
15272
15280
|
leave(node, parent) {
|
|
15273
15281
|
parent && parentStack.pop();
|
|
15282
|
+
if (node === currentModelOption) currentModelOption = null;
|
|
15274
15283
|
if ((0, _vue_compiler_dom.isFunctionType)(node)) popScope(true);
|
|
15275
15284
|
else if (node.type === "BlockStatement" && !(0, _vue_compiler_dom.isFunctionType)(parent)) popScope();
|
|
15276
15285
|
else if (node.type === "CatchClause" || node.type === "ForOfStatement" || node.type === "ForInStatement" || node.type === "ForStatement") popScope();
|
|
@@ -15818,7 +15827,7 @@ function compileScript(sfc, options) {
|
|
|
15818
15827
|
if (cssModuleBindings.length) returned = `{\n${cssModuleBindings.join("\n")}\n${returned}\n}`;
|
|
15819
15828
|
} else returned = `() => {}`;
|
|
15820
15829
|
if (!inlineMode && true) ctx.s.appendRight(endOffset, `\nconst __returned__ = ${returned}\nObject.defineProperty(__returned__, '__isScriptSetup', { enumerable: false, value: true })\nreturn __returned__\n}\n\n`);
|
|
15821
|
-
else ctx.s.appendRight(endOffset, `\n${vapor && !ssr && inlineMode ? `` : `return `}${returned}\n}\n\n`);
|
|
15830
|
+
else ctx.s.appendRight(endOffset, `\n${vapor && !ssr && inlineMode && !(!sfc.template && ctx.hasDefaultExportRender) ? `` : `return `}${returned}\n}\n\n`);
|
|
15822
15831
|
const genDefaultAs = options.genDefaultAs ? `const ${options.genDefaultAs} =` : `export default`;
|
|
15823
15832
|
let runtimeOptions = ``;
|
|
15824
15833
|
if (!ctx.hasDefaultExportName && filename && filename !== "anonymous.vue") {
|
|
@@ -15991,7 +16000,7 @@ function mergeSourceMaps(scriptMap, templateMap, templateLineOffset) {
|
|
|
15991
16000
|
}
|
|
15992
16001
|
//#endregion
|
|
15993
16002
|
//#region packages/compiler-sfc/src/index.ts
|
|
15994
|
-
const version = "3.6.0-rc.
|
|
16003
|
+
const version = "3.6.0-rc.13";
|
|
15995
16004
|
const parseCache = parseCache$1;
|
|
15996
16005
|
const errorMessages = {
|
|
15997
16006
|
..._vue_compiler_dom.errorMessages,
|