Skip to content

Commit 34258cb

Browse files
committedMar 3, 2025
fix(compiler): revert deprecation changes to components.d.ts
1 parent 03a5ff9 commit 34258cb

File tree

10 files changed

+21
-163
lines changed

10 files changed

+21
-163
lines changed
 

‎package.json

+15-15
Original file line numberDiff line numberDiff line change
@@ -24,9 +24,9 @@
2424
],
2525
"exports": {
2626
".": {
27+
"types": "./internal/stencil-core/index.d.ts",
2728
"import": "./internal/stencil-core/index.js",
28-
"require": "./internal/stencil-core/index.cjs",
29-
"types": "./internal/stencil-core/index.d.ts"
29+
"require": "./internal/stencil-core/index.cjs"
3030
},
3131
"./cli": {
3232
"import": "./cli/index.js",
@@ -48,40 +48,40 @@
4848
"import": "./internal/testing/*"
4949
},
5050
"./internal/app-data": {
51+
"types": "./internal/app-data/index.d.ts",
5152
"import": "./internal/app-data/index.js",
52-
"require": "./internal/app-data/index.cjs",
53-
"types": "./internal/app-data/index.d.ts"
53+
"require": "./internal/app-data/index.cjs"
5454
},
5555
"./mock-doc": {
56+
"types": "./mock-doc/index.d.ts",
5657
"import": "./mock-doc/index.js",
57-
"require": "./mock-doc/index.cjs",
58-
"types": "./mock-doc/index.d.ts"
58+
"require": "./mock-doc/index.cjs"
5959
},
6060
"./compiler": {
61+
"types": "./compiler/stencil.d.ts",
6162
"import": "./compiler/stencil.js",
62-
"require": "./compiler/stencil.js",
63-
"types": "./compiler/stencil.d.ts"
63+
"require": "./compiler/stencil.js"
6464
},
6565
"./compiler/*": {
66-
"import": "./compiler/*",
67-
"types": "./compiler/*"
66+
"types": "./compiler/*",
67+
"import": "./compiler/*"
6868
},
6969
"./screenshot": {
70-
"require": "./screenshot/index.js",
71-
"types": "./screenshot/index.d.ts"
70+
"types": "./screenshot/index.d.ts",
71+
"require": "./screenshot/index.js"
7272
},
7373
"./sys/node": {
74+
"types": "./sys/node/index.d.ts",
7475
"import": "./sys/node/index.js",
75-
"require": "./sys/node/index.js",
76-
"types": "./sys/node/index.d.ts"
76+
"require": "./sys/node/index.js"
7777
},
7878
"./sys/node/*": {
7979
"import": "./sys/node/*",
8080
"require": "./sys/node/*"
8181
},
8282
"./testing": {
83-
"import": "./testing/index.js",
8483
"types": "./testing/index.d.ts",
84+
"import": "./testing/index.js",
8585
"require": "./testing/index.js"
8686
},
8787
"./testing/jest-preset": {

‎src/compiler/types/generate-component-types.ts

-16
Original file line numberDiff line numberDiff line change
@@ -76,22 +76,6 @@ const attributesToMultiLineString = (attributes: d.TypeInfo, jsxAttributes: bool
7676
}
7777
const optional = jsxAttributes ? !type.required : type.optional;
7878
fullList.push(` "${type.name}"${optional ? '?' : ''}: ${type.type};`);
79-
80-
/**
81-
* deprecated usage of dash-casing in JSX, use camelCase instead
82-
*/
83-
if (type.attributeName && type.attributeName !== type.name) {
84-
const padding = ' '.repeat(8);
85-
fullList.push(
86-
[
87-
`${padding}/**`,
88-
`${padding} * @deprecated use camelCase instead. Support for dash-casing will be removed in Stencil v5.`,
89-
`${padding} */`,
90-
].join('\n'),
91-
);
92-
fullList.push(`${padding}"${type.attributeName}"?: ${type.type};`);
93-
}
94-
9579
return fullList;
9680
}, [] as string[])
9781
.join(`\n`);

‎src/compiler/types/generate-prop-types.ts

-1
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,6 @@ export const generatePropTypes = (cmpMeta: d.ComponentCompilerMeta, typeImportDa
2020
}
2121
return {
2222
name: cmpProp.name,
23-
attributeName: cmpProp.attribute,
2423
type: getType(cmpProp, typeImportData, cmpMeta.sourceFilePath),
2524
optional: cmpProp.optional,
2625
required: cmpProp.required,

‎src/compiler/types/tests/generate-prop-types.spec.ts

-5
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,6 @@ describe('generate-prop-types', () => {
4444

4545
const expectedTypeInfo: d.TypeInfo = [
4646
{
47-
attributeName: 'my-cmp',
4847
jsdoc: '',
4948
internal: false,
5049
name: 'propName',
@@ -70,7 +69,6 @@ describe('generate-prop-types', () => {
7069

7170
const expectedTypeInfo: d.TypeInfo = [
7271
{
73-
attributeName: 'my-cmp',
7472
jsdoc: '',
7573
internal: false,
7674
name: 'propName',
@@ -116,7 +114,6 @@ describe('generate-prop-types', () => {
116114

117115
const expectedTypeInfo: d.TypeInfo = [
118116
{
119-
attributeName: 'my-cmp',
120117
jsdoc: '',
121118
internal: false,
122119
name: 'propName',
@@ -152,7 +149,6 @@ describe('generate-prop-types', () => {
152149

153150
const expectedTypeInfo: d.TypeInfo = [
154151
{
155-
attributeName: 'my-cmp',
156152
jsdoc: '@readonly',
157153
internal: false,
158154
name: 'propName',
@@ -180,7 +176,6 @@ describe('generate-prop-types', () => {
180176

181177
const expectedTypeInfo: d.TypeInfo = [
182178
{
183-
attributeName: 'my-cmp',
184179
jsdoc: '',
185180
internal: false,
186181
name: 'propName',

‎src/declarations/stencil-private.ts

-1
Original file line numberDiff line numberDiff line change
@@ -2554,7 +2554,6 @@ export interface TypesModule {
25542554
export type TypeInfo = {
25552555
name: string;
25562556
type: string;
2557-
attributeName?: string;
25582557
optional: boolean;
25592558
required: boolean;
25602559
internal: boolean;

‎test/end-to-end/package-lock.json

+4-3
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

‎test/end-to-end/src/components.d.ts

-88
Original file line numberDiff line numberDiff line change
@@ -40,10 +40,6 @@ export namespace Components {
4040
}
4141
interface CmpDsd {
4242
"initialCounter": number;
43-
/**
44-
* @deprecated use camelCase instead. Support for dash-casing will be removed in Stencil v5.
45-
*/
46-
"initial-counter"?: number;
4743
}
4844
interface CmpServerVsClient {
4945
}
@@ -105,10 +101,6 @@ export namespace Components {
105101
*/
106102
"someMethodWithArgs": (unit: string, value: number) => Promise<string>;
107103
"someProp": number;
108-
/**
109-
* @deprecated use camelCase instead. Support for dash-casing will be removed in Stencil v5.
110-
*/
111-
"some-prop"?: number;
112104
}
113105
interface MyCmp {
114106
/**
@@ -117,18 +109,10 @@ export namespace Components {
117109
* @readonly
118110
*/
119111
"barProp": string;
120-
/**
121-
* @deprecated use camelCase instead. Support for dash-casing will be removed in Stencil v5.
122-
*/
123-
"bar-prop"?: string;
124112
/**
125113
* foo prop
126114
*/
127115
"fooProp": string;
128-
/**
129-
* @deprecated use camelCase instead. Support for dash-casing will be removed in Stencil v5.
130-
*/
131-
"foo-prop"?: string;
132116
/**
133117
* Mode
134118
*/
@@ -141,18 +125,10 @@ export namespace Components {
141125
* @readonly
142126
*/
143127
"barProp": string;
144-
/**
145-
* @deprecated use camelCase instead. Support for dash-casing will be removed in Stencil v5.
146-
*/
147-
"bar-prop"?: string;
148128
/**
149129
* foo prop
150130
*/
151131
"fooProp": string;
152-
/**
153-
* @deprecated use camelCase instead. Support for dash-casing will be removed in Stencil v5.
154-
*/
155-
"foo-prop"?: string;
156132
/**
157133
* Mode
158134
*/
@@ -183,36 +159,16 @@ export namespace Components {
183159
* @readonly
184160
*/
185161
"fullName": string;
186-
/**
187-
* @deprecated use camelCase instead. Support for dash-casing will be removed in Stencil v5.
188-
*/
189-
"full-name"?: string;
190162
"lastName": string;
191-
/**
192-
* @deprecated use camelCase instead. Support for dash-casing will be removed in Stencil v5.
193-
*/
194-
"last-name"?: string;
195163
/**
196164
* Mode
197165
*/
198166
"mode"?: any;
199167
}
200168
interface RuntimeDecorators {
201169
"basicProp": string;
202-
/**
203-
* @deprecated use camelCase instead. Support for dash-casing will be removed in Stencil v5.
204-
*/
205-
"basic-prop"?: string;
206170
"decoratedGetterSetterProp": number;
207-
/**
208-
* @deprecated use camelCase instead. Support for dash-casing will be removed in Stencil v5.
209-
*/
210-
"decorated-getter-setter-prop"?: number;
211171
"decoratedProp": number;
212-
/**
213-
* @deprecated use camelCase instead. Support for dash-casing will be removed in Stencil v5.
214-
*/
215-
"decorated-prop"?: number;
216172
}
217173
interface ScopedCarDetail {
218174
"car": CarData;
@@ -670,10 +626,6 @@ declare namespace LocalJSX {
670626
}
671627
interface CmpDsd {
672628
"initialCounter"?: number;
673-
/**
674-
* @deprecated use camelCase instead. Support for dash-casing will be removed in Stencil v5.
675-
*/
676-
"initial-counter"?: number;
677629
}
678630
interface CmpServerVsClient {
679631
}
@@ -709,10 +661,6 @@ declare namespace LocalJSX {
709661
}
710662
interface MethodCmp {
711663
"someProp"?: number;
712-
/**
713-
* @deprecated use camelCase instead. Support for dash-casing will be removed in Stencil v5.
714-
*/
715-
"some-prop"?: number;
716664
}
717665
interface MyCmp {
718666
/**
@@ -721,18 +669,10 @@ declare namespace LocalJSX {
721669
* @readonly
722670
*/
723671
"barProp"?: string;
724-
/**
725-
* @deprecated use camelCase instead. Support for dash-casing will be removed in Stencil v5.
726-
*/
727-
"bar-prop"?: string;
728672
/**
729673
* foo prop
730674
*/
731675
"fooProp"?: string;
732-
/**
733-
* @deprecated use camelCase instead. Support for dash-casing will be removed in Stencil v5.
734-
*/
735-
"foo-prop"?: string;
736676
/**
737677
* Mode
738678
*/
@@ -745,18 +685,10 @@ declare namespace LocalJSX {
745685
* @readonly
746686
*/
747687
"barProp"?: string;
748-
/**
749-
* @deprecated use camelCase instead. Support for dash-casing will be removed in Stencil v5.
750-
*/
751-
"bar-prop"?: string;
752688
/**
753689
* foo prop
754690
*/
755691
"fooProp"?: string;
756-
/**
757-
* @deprecated use camelCase instead. Support for dash-casing will be removed in Stencil v5.
758-
*/
759-
"foo-prop"?: string;
760692
/**
761693
* Mode
762694
*/
@@ -787,36 +719,16 @@ declare namespace LocalJSX {
787719
* @readonly
788720
*/
789721
"fullName"?: string;
790-
/**
791-
* @deprecated use camelCase instead. Support for dash-casing will be removed in Stencil v5.
792-
*/
793-
"full-name"?: string;
794722
"lastName"?: string;
795-
/**
796-
* @deprecated use camelCase instead. Support for dash-casing will be removed in Stencil v5.
797-
*/
798-
"last-name"?: string;
799723
/**
800724
* Mode
801725
*/
802726
"mode"?: any;
803727
}
804728
interface RuntimeDecorators {
805729
"basicProp"?: string;
806-
/**
807-
* @deprecated use camelCase instead. Support for dash-casing will be removed in Stencil v5.
808-
*/
809-
"basic-prop"?: string;
810730
"decoratedGetterSetterProp"?: number;
811-
/**
812-
* @deprecated use camelCase instead. Support for dash-casing will be removed in Stencil v5.
813-
*/
814-
"decorated-getter-setter-prop"?: number;
815731
"decoratedProp"?: number;
816-
/**
817-
* @deprecated use camelCase instead. Support for dash-casing will be removed in Stencil v5.
818-
*/
819-
"decorated-prop"?: number;
820732
}
821733
interface ScopedCarDetail {
822734
"car"?: CarData;

‎test/wdio/package-lock.json

+2-2
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)