@stencil/core 5.0.0-beta.20 → 5.0.0-beta.21
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/browser.js
CHANGED
|
@@ -1844,7 +1844,7 @@ const validateComponentTag = (tag) => {
|
|
|
1844
1844
|
};
|
|
1845
1845
|
//#endregion
|
|
1846
1846
|
//#region src/version.ts
|
|
1847
|
-
const version = "5.0.0-beta.
|
|
1847
|
+
const version = "5.0.0-beta.21";
|
|
1848
1848
|
//#endregion
|
|
1849
1849
|
//#region src/compiler/events.ts
|
|
1850
1850
|
const buildEvents = () => {
|
|
@@ -15440,13 +15440,13 @@ const parseStaticComponentMeta = (compilerCtx, typeChecker, cmpNode, moduleFile,
|
|
|
15440
15440
|
hasPatchClone: false,
|
|
15441
15441
|
hasPatchInsert: false
|
|
15442
15442
|
};
|
|
15443
|
-
|
|
15444
|
-
|
|
15443
|
+
if (!isCollectionDependency) validateComponentMembers(cmpNode, buildCtx);
|
|
15444
|
+
const visitComponentChildNode = (node) => {
|
|
15445
15445
|
if (ts$1.isCallExpression(node)) parseCallExpression(cmp, node, typeChecker);
|
|
15446
15446
|
else if (ts$1.isStringLiteral(node)) parseStringLiteral(cmp, node);
|
|
15447
|
-
node.forEachChild(
|
|
15447
|
+
node.forEachChild(visitComponentChildNode);
|
|
15448
15448
|
};
|
|
15449
|
-
visitComponentChildNode(cmpNode
|
|
15449
|
+
visitComponentChildNode(cmpNode);
|
|
15450
15450
|
parseClassMethods(classMethods, cmp);
|
|
15451
15451
|
cmp.hasModernPropertyDecls = detectModernPropDeclarations(cmpNode) || doesExtend;
|
|
15452
15452
|
cmp.htmlAttrNames = unique(cmp.htmlAttrNames);
|
|
@@ -15464,31 +15464,32 @@ const parseStaticComponentMeta = (compilerCtx, typeChecker, cmpNode, moduleFile,
|
|
|
15464
15464
|
return cmpNode;
|
|
15465
15465
|
};
|
|
15466
15466
|
/**
|
|
15467
|
-
*
|
|
15468
|
-
*
|
|
15469
|
-
* @param
|
|
15470
|
-
* @returns whether `classNode` is a Stencil component class
|
|
15467
|
+
* Warn about members a Stencil component class should not define.
|
|
15468
|
+
* @param cmpNode the component class declaration
|
|
15469
|
+
* @param buildCtx the current build context, used to surface diagnostics
|
|
15471
15470
|
*/
|
|
15472
|
-
const
|
|
15473
|
-
const
|
|
15474
|
-
|
|
15475
|
-
|
|
15476
|
-
const
|
|
15477
|
-
|
|
15478
|
-
|
|
15479
|
-
|
|
15480
|
-
|
|
15481
|
-
|
|
15482
|
-
|
|
15483
|
-
|
|
15484
|
-
|
|
15485
|
-
|
|
15486
|
-
|
|
15487
|
-
|
|
15488
|
-
|
|
15489
|
-
|
|
15490
|
-
|
|
15491
|
-
|
|
15471
|
+
const validateComponentMembers = (cmpNode, buildCtx) => {
|
|
15472
|
+
const componentName = cmpNode.name?.text ?? "";
|
|
15473
|
+
for (const member of cmpNode.members) {
|
|
15474
|
+
if (!member.name || !ts$1.isIdentifier(member.name)) continue;
|
|
15475
|
+
const memberName = member.name.text;
|
|
15476
|
+
/**
|
|
15477
|
+
* the component has a getter called "shadowRoot"
|
|
15478
|
+
*/
|
|
15479
|
+
if (ts$1.isGetAccessorDeclaration(member) && BLACKLISTED_COMPONENT_METHODS.includes(memberName)) {
|
|
15480
|
+
const err = buildWarn(buildCtx.diagnostics);
|
|
15481
|
+
err.messageText = `The component "${componentName}" has a getter called "${memberName}". This getter is reserved for use by Stencil components and should not be defined by the user.`;
|
|
15482
|
+
augmentDiagnosticWithNode(err, ts$1.getOriginalNode(member));
|
|
15483
|
+
}
|
|
15484
|
+
/**
|
|
15485
|
+
* the component defines a "componentShouldUpdate" method with more than one parameter,
|
|
15486
|
+
* which was the pre-v5 per-prop signature "(newVal, oldVal, propName)"
|
|
15487
|
+
*/
|
|
15488
|
+
if (ts$1.isMethodDeclaration(member) && memberName === "componentShouldUpdate" && member.parameters.length > 1) {
|
|
15489
|
+
const err = buildWarn(buildCtx.diagnostics);
|
|
15490
|
+
err.messageText = `The component "${componentName}" defines "componentShouldUpdate" with ${member.parameters.length} parameters. As of Stencil v5, "componentShouldUpdate" is called once per render with a single "changes" argument (a map of prop/state names to "{ newVal, oldVal }") instead of once per prop with "(newVal, oldVal, propName)". This method will still compile, but any extra parameters will be "undefined" at runtime.`;
|
|
15491
|
+
augmentDiagnosticWithNode(err, ts$1.getOriginalNode(member));
|
|
15492
|
+
}
|
|
15492
15493
|
}
|
|
15493
15494
|
};
|
|
15494
15495
|
const parseVirtualProps = (docs) => {
|
package/dist/compiler/index.mjs
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import { A as version, C as hasStencilHydrateImport, D as parseCssOnlyComponents, E as replaceStencilHydrateImport, M as scopeCss, O as buildId, S as hasStencilGlobalsImport, T as replaceStencilGlobalsImport, _ as cmpMetaToDocsComponent, a as createPrerenderer, b as buildHydrateCss, c as createWorkerContext, d as nodeRequire, f as optimizeCss, g as generateManifest, h as generateComponentTypesFile, i as createSystem, j as versions, k as vermoji, l as createWorkerMessageHandler, m as validateHydrated, n as transpile, o as loadConfig, p as validateConfig, r as transpileSync, s as createCompiler, t as ts, u as optimizeJs, v as getScopeId, w as replaceStencilCssComponentsImport, x as hasStencilCssComponentsImport, y as foldBuildFlags } from "../compiler-
|
|
1
|
+
import { A as version, C as hasStencilHydrateImport, D as parseCssOnlyComponents, E as replaceStencilHydrateImport, M as scopeCss, O as buildId, S as hasStencilGlobalsImport, T as replaceStencilGlobalsImport, _ as cmpMetaToDocsComponent, a as createPrerenderer, b as buildHydrateCss, c as createWorkerContext, d as nodeRequire, f as optimizeCss, g as generateManifest, h as generateComponentTypesFile, i as createSystem, j as versions, k as vermoji, l as createWorkerMessageHandler, m as validateHydrated, n as transpile, o as loadConfig, p as validateConfig, r as transpileSync, s as createCompiler, t as ts, u as optimizeJs, v as getScopeId, w as replaceStencilCssComponentsImport, x as hasStencilCssComponentsImport, y as foldBuildFlags } from "../compiler-ApS_Tn_4.mjs";
|
|
2
2
|
import { a as LOG_LEVELS, i as CustomElementsExportBehaviorOptions } from "../node-Bz2SOK7_.mjs";
|
|
3
3
|
export { CustomElementsExportBehaviorOptions, LOG_LEVELS, buildHydrateCss, buildId, cmpMetaToDocsComponent, createCompiler, createPrerenderer, createSystem, createWorkerContext, createWorkerMessageHandler, foldBuildFlags, generateComponentTypesFile, generateManifest, getScopeId, hasStencilCssComponentsImport, hasStencilGlobalsImport, hasStencilHydrateImport, loadConfig, nodeRequire, optimizeCss, optimizeJs, parseCssOnlyComponents, replaceStencilCssComponentsImport, replaceStencilGlobalsImport, replaceStencilHydrateImport, scopeCss, transpile, transpileSync, ts, validateConfig, validateHydrated, vermoji, version, versions };
|
|
@@ -461,9 +461,9 @@ const scopeCss = (cssText, scopeId, commentOriginalSelector) => {
|
|
|
461
461
|
};
|
|
462
462
|
//#endregion
|
|
463
463
|
//#region src/version.ts
|
|
464
|
-
const version = "5.0.0-beta.
|
|
465
|
-
const buildId = "
|
|
466
|
-
const vermoji = "
|
|
464
|
+
const version = "5.0.0-beta.21";
|
|
465
|
+
const buildId = "1791840744";
|
|
466
|
+
const vermoji = "🍎";
|
|
467
467
|
/**
|
|
468
468
|
* Get the installed version of a tool/dependency.
|
|
469
469
|
* Handles packages with exports maps that point to subdirectories.
|
|
@@ -12778,11 +12778,9 @@ const generateSsrFactory = async (config, compilerCtx, buildCtx) => {
|
|
|
12778
12778
|
format: "cjs",
|
|
12779
12779
|
esModule: false,
|
|
12780
12780
|
strict: false,
|
|
12781
|
-
intro: SSR_FACTORY_INTRO,
|
|
12782
|
-
outro: SSR_FACTORY_OUTRO,
|
|
12783
12781
|
codeSplitting: false
|
|
12784
12782
|
});
|
|
12785
|
-
if (!buildCtx.hasError && rolldownOutput != null && Array.isArray(rolldownOutput.output)) return rolldownOutput.output[0].code;
|
|
12783
|
+
if (!buildCtx.hasError && rolldownOutput != null && Array.isArray(rolldownOutput.output)) return SSR_FACTORY_INTRO + rolldownOutput.output[0].code + SSR_FACTORY_OUTRO;
|
|
12786
12784
|
}
|
|
12787
12785
|
} catch (e) {
|
|
12788
12786
|
catchError(buildCtx.diagnostics, e);
|
|
@@ -18174,13 +18172,13 @@ const parseStaticComponentMeta = (compilerCtx, typeChecker, cmpNode, moduleFile,
|
|
|
18174
18172
|
hasPatchClone: false,
|
|
18175
18173
|
hasPatchInsert: false
|
|
18176
18174
|
};
|
|
18177
|
-
|
|
18178
|
-
|
|
18175
|
+
if (!isCollectionDependency) validateComponentMembers(cmpNode, buildCtx);
|
|
18176
|
+
const visitComponentChildNode = (node) => {
|
|
18179
18177
|
if (ts.isCallExpression(node)) parseCallExpression(cmp, node, typeChecker);
|
|
18180
18178
|
else if (ts.isStringLiteral(node)) parseStringLiteral(cmp, node);
|
|
18181
|
-
node.forEachChild(
|
|
18179
|
+
node.forEachChild(visitComponentChildNode);
|
|
18182
18180
|
};
|
|
18183
|
-
visitComponentChildNode(cmpNode
|
|
18181
|
+
visitComponentChildNode(cmpNode);
|
|
18184
18182
|
parseClassMethods(classMethods, cmp);
|
|
18185
18183
|
cmp.hasModernPropertyDecls = detectModernPropDeclarations(cmpNode) || doesExtend;
|
|
18186
18184
|
cmp.htmlAttrNames = unique(cmp.htmlAttrNames);
|
|
@@ -18198,31 +18196,32 @@ const parseStaticComponentMeta = (compilerCtx, typeChecker, cmpNode, moduleFile,
|
|
|
18198
18196
|
return cmpNode;
|
|
18199
18197
|
};
|
|
18200
18198
|
/**
|
|
18201
|
-
*
|
|
18202
|
-
*
|
|
18203
|
-
* @param
|
|
18204
|
-
* @returns whether `classNode` is a Stencil component class
|
|
18199
|
+
* Warn about members a Stencil component class should not define.
|
|
18200
|
+
* @param cmpNode the component class declaration
|
|
18201
|
+
* @param buildCtx the current build context, used to surface diagnostics
|
|
18205
18202
|
*/
|
|
18206
|
-
const
|
|
18207
|
-
const
|
|
18208
|
-
|
|
18209
|
-
|
|
18210
|
-
const
|
|
18211
|
-
|
|
18212
|
-
|
|
18213
|
-
|
|
18214
|
-
|
|
18215
|
-
|
|
18216
|
-
|
|
18217
|
-
|
|
18218
|
-
|
|
18219
|
-
|
|
18220
|
-
|
|
18221
|
-
|
|
18222
|
-
|
|
18223
|
-
|
|
18224
|
-
|
|
18225
|
-
|
|
18203
|
+
const validateComponentMembers = (cmpNode, buildCtx) => {
|
|
18204
|
+
const componentName = cmpNode.name?.text ?? "";
|
|
18205
|
+
for (const member of cmpNode.members) {
|
|
18206
|
+
if (!member.name || !ts.isIdentifier(member.name)) continue;
|
|
18207
|
+
const memberName = member.name.text;
|
|
18208
|
+
/**
|
|
18209
|
+
* the component has a getter called "shadowRoot"
|
|
18210
|
+
*/
|
|
18211
|
+
if (ts.isGetAccessorDeclaration(member) && BLACKLISTED_COMPONENT_METHODS.includes(memberName)) {
|
|
18212
|
+
const err = buildWarn(buildCtx.diagnostics);
|
|
18213
|
+
err.messageText = `The component "${componentName}" has a getter called "${memberName}". This getter is reserved for use by Stencil components and should not be defined by the user.`;
|
|
18214
|
+
augmentDiagnosticWithNode(err, ts.getOriginalNode(member));
|
|
18215
|
+
}
|
|
18216
|
+
/**
|
|
18217
|
+
* the component defines a "componentShouldUpdate" method with more than one parameter,
|
|
18218
|
+
* which was the pre-v5 per-prop signature "(newVal, oldVal, propName)"
|
|
18219
|
+
*/
|
|
18220
|
+
if (ts.isMethodDeclaration(member) && memberName === "componentShouldUpdate" && member.parameters.length > 1) {
|
|
18221
|
+
const err = buildWarn(buildCtx.diagnostics);
|
|
18222
|
+
err.messageText = `The component "${componentName}" defines "componentShouldUpdate" with ${member.parameters.length} parameters. As of Stencil v5, "componentShouldUpdate" is called once per render with a single "changes" argument (a map of prop/state names to "{ newVal, oldVal }") instead of once per prop with "(newVal, oldVal, propName)". This method will still compile, but any extra parameters will be "undefined" at runtime.`;
|
|
18223
|
+
augmentDiagnosticWithNode(err, ts.getOriginalNode(member));
|
|
18224
|
+
}
|
|
18226
18225
|
}
|
|
18227
18226
|
};
|
|
18228
18227
|
const parseVirtualProps = (docs) => {
|
package/dist/sys/node/worker.mjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { l as createWorkerMessageHandler } from "../../compiler-
|
|
1
|
+
import { l as createWorkerMessageHandler } from "../../compiler-ApS_Tn_4.mjs";
|
|
2
2
|
import { t as createNodeSys } from "../../node-Bz2SOK7_.mjs";
|
|
3
3
|
//#region src/sys/node/node-worker-thread.ts
|
|
4
4
|
/**
|
package/dist/testing/index.mjs
CHANGED
|
@@ -33,7 +33,7 @@ import "@rollup/pluginutils";
|
|
|
33
33
|
import { createHash } from "crypto";
|
|
34
34
|
import { afterAll, vi } from "vitest";
|
|
35
35
|
//#region src/version.ts
|
|
36
|
-
const version = "5.0.0-beta.
|
|
36
|
+
const version = "5.0.0-beta.21";
|
|
37
37
|
const MEMBER_FLAGS = {
|
|
38
38
|
String: 1,
|
|
39
39
|
Number: 2,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@stencil/core",
|
|
3
|
-
"version": "5.0.0-beta.
|
|
3
|
+
"version": "5.0.0-beta.21",
|
|
4
4
|
"description": "A Compiler for Web Components and Progressive Web Apps",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"components",
|
|
@@ -126,9 +126,9 @@
|
|
|
126
126
|
"terser": "^5.50.0",
|
|
127
127
|
"tinyglobby": "^0.2.17",
|
|
128
128
|
"typescript": ">5.0.0 <7.0.0",
|
|
129
|
-
"@stencil/cli": "5.0.0-beta.
|
|
130
|
-
"@stencil/mock-doc": "5.0.0-beta.
|
|
131
|
-
"@stencil/dev-server": "5.0.0-beta.
|
|
129
|
+
"@stencil/cli": "5.0.0-beta.21",
|
|
130
|
+
"@stencil/mock-doc": "5.0.0-beta.21",
|
|
131
|
+
"@stencil/dev-server": "5.0.0-beta.21"
|
|
132
132
|
},
|
|
133
133
|
"devDependencies": {
|
|
134
134
|
"@ionic/prettier-config": "^4.0.0",
|