Skip to content

Commit 61ddedb

Browse files
author
John Jenkins
committed
Merge remote-tracking branch 'origin/main' into serialize-deserialize
2 parents f27a191 + 341fec4 commit 61ddedb

File tree

14 files changed

+57
-20
lines changed

14 files changed

+57
-20
lines changed

CHANGELOG.md

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,14 @@
1+
## 🏰 [4.37.1](https://github.com/stenciljs/core/compare/v4.37.0...v4.37.1) (2025-09-19)
2+
3+
4+
### Bug Fixes
5+
6+
* **dist-custom-elements:** revert [#6381](https://github.com/stenciljs/core/issues/6381) ([77cfdb3](https://github.com/stenciljs/core/commit/77cfdb3b704205ced93b7a265ea0881fa2dd19d0))
7+
* **Mixin:** export `MixinFactory` type for ease of use ([#6390](https://github.com/stenciljs/core/issues/6390)) ([a26114e](https://github.com/stenciljs/core/commit/a26114ee8a3d808ddb4731547842301628654312))
8+
* **runtime:** stop eager json parsing for unknown and any type bindings ([#6384](https://github.com/stenciljs/core/issues/6384)) ([ccae0d7](https://github.com/stenciljs/core/commit/ccae0d743cd4eb2766eb7e48cb6add854c9fd640))
9+
10+
11+
112
# [4.37.0](https://github.com/stenciljs/core/compare/v4.36.3...v4.37.0) (2025-09-13)
213

314

package-lock.json

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@stencil/core",
3-
"version": "4.37.0",
3+
"version": "4.37.1",
44
"license": "MIT",
55
"main": "./internal/stencil-core/index.cjs",
66
"module": "./internal/stencil-core/index.js",

src/compiler/config/test/validate-config.spec.ts

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -116,6 +116,19 @@ describe('validation', () => {
116116
});
117117
});
118118

119+
describe('suppressReservedPublicNameWarnings', () => {
120+
it.each([true, false])('sets suppressReservedPublicNameWarnings to %p when provided', (bool) => {
121+
userConfig.suppressReservedPublicNameWarnings = bool;
122+
const { config } = validateConfig(userConfig, bootstrapConfig);
123+
expect(config.suppressReservedPublicNameWarnings).toBe(bool);
124+
});
125+
126+
it('defaults suppressReservedPublicNameWarnings to false', () => {
127+
const { config } = validateConfig(userConfig, bootstrapConfig);
128+
expect(config.suppressReservedPublicNameWarnings).toBe(false);
129+
});
130+
});
131+
119132
describe('enableCache', () => {
120133
it('set enableCache true', () => {
121134
userConfig.enableCache = true;

src/compiler/config/validate-config.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -205,6 +205,7 @@ export const validateConfig = (
205205
setBooleanConfig(validatedConfig, 'autoprefixCss', null, validatedConfig.buildEs5);
206206
setBooleanConfig(validatedConfig, 'validateTypes', null, !validatedConfig._isTesting);
207207
setBooleanConfig(validatedConfig, 'allowInlineScripts', null, true);
208+
setBooleanConfig(validatedConfig, 'suppressReservedPublicNameWarnings', null, false);
208209

209210
if (!isString(validatedConfig.taskQueue)) {
210211
validatedConfig.taskQueue = 'async';

src/compiler/transformers/decorators-to-static/convert-decorators.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -136,6 +136,7 @@ const visitClassDeclaration = (
136136
importAliasMap.get('Prop'),
137137
);
138138
propDecoratorsToStatic(
139+
config,
139140
diagnostics,
140141
decoratedMembers,
141142
typeChecker,

src/compiler/transformers/decorators-to-static/method-decorator.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,7 @@ const parseMethodDecorator = (
8989
}
9090

9191
// Validate if the method name does not conflict with existing public names
92-
validatePublicName(diagnostics, methodName, '@Method()', 'method', method.name);
92+
validatePublicName(config, diagnostics, methodName, '@Method()', 'method', method.name);
9393

9494
const methodMeta: d.ComponentCompilerStaticMethod = {
9595
complexType: {

src/compiler/transformers/decorators-to-static/prop-decorator.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@ import { getDecoratorParameters, isDecoratorNamed } from './decorator-utils';
3131
* @param serializers a collection of serializers (from prop > attribute) used on `@Prop` annotated class members
3232
*/
3333
export const propDecoratorsToStatic = (
34+
config: d.ValidatedConfig,
3435
diagnostics: d.Diagnostic[],
3536
decoratedProps: ts.ClassElement[],
3637
typeChecker: ts.TypeChecker,
@@ -44,6 +45,7 @@ export const propDecoratorsToStatic = (
4445
.filter((prop) => ts.isPropertyDeclaration(prop) || ts.isGetAccessor(prop))
4546
.map((prop) =>
4647
parsePropDecorator(
48+
config,
4749
diagnostics,
4850
typeChecker,
4951
program,
@@ -75,6 +77,7 @@ export const propDecoratorsToStatic = (
7577
* @returns a property assignment expression to be added to the Stencil component's class
7678
*/
7779
const parsePropDecorator = (
80+
config: d.ValidatedConfig,
7881
diagnostics: d.Diagnostic[],
7982
typeChecker: ts.TypeChecker,
8083
program: ts.Program,
@@ -106,7 +109,7 @@ const parsePropDecorator = (
106109
warn.messageText = `The @Prop() name "${propName}" looks like an event. Please use the "@Event()" decorator to expose events instead, not properties or methods.`;
107110
augmentDiagnosticWithNode(warn, prop.name);
108111
} else {
109-
validatePublicName(diagnostics, propName, '@Prop()', 'prop', prop.name);
112+
validatePublicName(config, diagnostics, propName, '@Prop()', 'prop', prop.name);
110113
}
111114

112115
const symbol = typeChecker.getSymbolAtLocation(prop.name);

src/compiler/transformers/reserved-public-members.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,12 +14,17 @@ import type * as d from '../../declarations';
1414
* @param node the TypeScript AST node at which the class member is defined
1515
*/
1616
export const validatePublicName = (
17+
config: d.ValidatedConfig,
1718
diagnostics: d.Diagnostic[],
1819
memberName: string,
1920
decorator: string,
2021
memberType: string,
2122
node: ts.Node,
2223
): void => {
24+
if (config.suppressReservedPublicNameWarnings) {
25+
return;
26+
}
27+
2328
if (RESERVED_PUBLIC_MEMBERS.has(memberName.toLowerCase())) {
2429
const warn = buildWarn(diagnostics);
2530
warn.messageText = [

src/declarations/stencil-public-compiler.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -152,6 +152,11 @@ export interface StencilConfig {
152152
* This behavior defaults to `true`, but may be opted-out of by setting this flag to `false`.
153153
*/
154154
transformAliasedImportPaths?: boolean;
155+
/**
156+
* When `true`, Stencil will suppress diagnostics which warn about public members using reserved names
157+
* (for example, decorating a method named `focus` with `@Method()`). Defaults to `false`.
158+
*/
159+
suppressReservedPublicNameWarnings?: boolean;
155160
/**
156161
* When `true`, we will validate a project's `package.json` based on the output target the user has designated
157162
* as `isPrimaryPackageOutputTarget: true` in their Stencil config.

0 commit comments

Comments
 (0)