Skip to content

Commit 455185e

Browse files
committed
Update deprecation messages in generated TypeScript definitions and KDL files for consistency and clarity
1 parent e471abc commit 455185e

File tree

8 files changed

+28
-32
lines changed

8 files changed

+28
-32
lines changed

baselines/dom.generated.d.ts

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -947,12 +947,12 @@ interface KeySystemTrackConfiguration {
947947
}
948948

949949
interface KeyboardEventInit extends EventModifierInit {
950-
/** @deprecated */
950+
/** @deprecated CharCode is inconsistent across environments, consider using .key instead */
951951
charCode?: number;
952952
code?: string;
953953
isComposing?: boolean;
954954
key?: string;
955-
/** @deprecated */
955+
/** @deprecated KeyCode is inconsistent across environments, consider using .key instead */
956956
keyCode?: number;
957957
location?: number;
958958
repeat?: boolean;
@@ -9195,7 +9195,7 @@ interface CSSStyleProperties extends CSSStyleDeclarationBase {
91959195
*/
91969196
wordSpacing: string;
91979197
/**
9198-
* @deprecated
9198+
* @deprecated The 'wordWrap' property is non-standard and has been replaced by 'overflow-wrap' in modern CSS.
91999199
*
92009200
* [MDN Reference](https://developer.mozilla.org/docs/Web/CSS/Reference/Properties/overflow-wrap)
92019201
*/
@@ -39462,7 +39462,7 @@ interface WindowEventHandlers {
3946239462
/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/Window/unhandledrejection_event) */
3946339463
onunhandledrejection: ((this: WindowEventHandlers, ev: PromiseRejectionEvent) => any) | null;
3946439464
/**
39465-
* @deprecated
39465+
* @deprecated The unload event is not reliable, consider visibilitychange or pagehide events
3946639466
*
3946739467
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Window/unload_event)
3946839468
*/
@@ -41831,7 +41831,7 @@ declare var onstorage: ((this: Window, ev: StorageEvent) => any) | null;
4183141831
/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/Window/unhandledrejection_event) */
4183241832
declare var onunhandledrejection: ((this: Window, ev: PromiseRejectionEvent) => any) | null;
4183341833
/**
41834-
* @deprecated
41834+
* @deprecated The unload event is not reliable, consider visibilitychange or pagehide events
4183541835
*
4183641836
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Window/unload_event)
4183741837
*/

baselines/ts5.5/dom.generated.d.ts

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -944,12 +944,12 @@ interface KeySystemTrackConfiguration {
944944
}
945945

946946
interface KeyboardEventInit extends EventModifierInit {
947-
/** @deprecated */
947+
/** @deprecated CharCode is inconsistent across environments, consider using .key instead */
948948
charCode?: number;
949949
code?: string;
950950
isComposing?: boolean;
951951
key?: string;
952-
/** @deprecated */
952+
/** @deprecated KeyCode is inconsistent across environments, consider using .key instead */
953953
keyCode?: number;
954954
location?: number;
955955
repeat?: boolean;
@@ -9185,7 +9185,7 @@ interface CSSStyleProperties extends CSSStyleDeclarationBase {
91859185
*/
91869186
wordSpacing: string;
91879187
/**
9188-
* @deprecated
9188+
* @deprecated The 'wordWrap' property is non-standard and has been replaced by 'overflow-wrap' in modern CSS.
91899189
*
91909190
* [MDN Reference](https://developer.mozilla.org/docs/Web/CSS/Reference/Properties/overflow-wrap)
91919191
*/
@@ -39436,7 +39436,7 @@ interface WindowEventHandlers {
3943639436
/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/Window/unhandledrejection_event) */
3943739437
onunhandledrejection: ((this: WindowEventHandlers, ev: PromiseRejectionEvent) => any) | null;
3943839438
/**
39439-
* @deprecated
39439+
* @deprecated The unload event is not reliable, consider visibilitychange or pagehide events
3944039440
*
3944139441
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Window/unload_event)
3944239442
*/
@@ -41805,7 +41805,7 @@ declare var onstorage: ((this: Window, ev: StorageEvent) => any) | null;
4180541805
/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/Window/unhandledrejection_event) */
4180641806
declare var onunhandledrejection: ((this: Window, ev: PromiseRejectionEvent) => any) | null;
4180741807
/**
41808-
* @deprecated
41808+
* @deprecated The unload event is not reliable, consider visibilitychange or pagehide events
4180941809
*
4181041810
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Window/unload_event)
4181141811
*/

baselines/ts5.6/dom.generated.d.ts

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -944,12 +944,12 @@ interface KeySystemTrackConfiguration {
944944
}
945945

946946
interface KeyboardEventInit extends EventModifierInit {
947-
/** @deprecated */
947+
/** @deprecated CharCode is inconsistent across environments, consider using .key instead */
948948
charCode?: number;
949949
code?: string;
950950
isComposing?: boolean;
951951
key?: string;
952-
/** @deprecated */
952+
/** @deprecated KeyCode is inconsistent across environments, consider using .key instead */
953953
keyCode?: number;
954954
location?: number;
955955
repeat?: boolean;
@@ -9192,7 +9192,7 @@ interface CSSStyleProperties extends CSSStyleDeclarationBase {
91929192
*/
91939193
wordSpacing: string;
91949194
/**
9195-
* @deprecated
9195+
* @deprecated The 'wordWrap' property is non-standard and has been replaced by 'overflow-wrap' in modern CSS.
91969196
*
91979197
* [MDN Reference](https://developer.mozilla.org/docs/Web/CSS/Reference/Properties/overflow-wrap)
91989198
*/
@@ -39459,7 +39459,7 @@ interface WindowEventHandlers {
3945939459
/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/Window/unhandledrejection_event) */
3946039460
onunhandledrejection: ((this: WindowEventHandlers, ev: PromiseRejectionEvent) => any) | null;
3946139461
/**
39462-
* @deprecated
39462+
* @deprecated The unload event is not reliable, consider visibilitychange or pagehide events
3946339463
*
3946439464
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Window/unload_event)
3946539465
*/
@@ -41828,7 +41828,7 @@ declare var onstorage: ((this: Window, ev: StorageEvent) => any) | null;
4182841828
/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/Window/unhandledrejection_event) */
4182941829
declare var onunhandledrejection: ((this: Window, ev: PromiseRejectionEvent) => any) | null;
4183041830
/**
41831-
* @deprecated
41831+
* @deprecated The unload event is not reliable, consider visibilitychange or pagehide events
4183241832
*
4183341833
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Window/unload_event)
4183441834
*/

baselines/ts5.9/dom.generated.d.ts

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -944,12 +944,12 @@ interface KeySystemTrackConfiguration {
944944
}
945945

946946
interface KeyboardEventInit extends EventModifierInit {
947-
/** @deprecated */
947+
/** @deprecated CharCode is inconsistent across environments, consider using .key instead */
948948
charCode?: number;
949949
code?: string;
950950
isComposing?: boolean;
951951
key?: string;
952-
/** @deprecated */
952+
/** @deprecated KeyCode is inconsistent across environments, consider using .key instead */
953953
keyCode?: number;
954954
location?: number;
955955
repeat?: boolean;
@@ -9192,7 +9192,7 @@ interface CSSStyleProperties extends CSSStyleDeclarationBase {
91929192
*/
91939193
wordSpacing: string;
91949194
/**
9195-
* @deprecated
9195+
* @deprecated The 'wordWrap' property is non-standard and has been replaced by 'overflow-wrap' in modern CSS.
91969196
*
91979197
* [MDN Reference](https://developer.mozilla.org/docs/Web/CSS/Reference/Properties/overflow-wrap)
91989198
*/
@@ -39459,7 +39459,7 @@ interface WindowEventHandlers {
3945939459
/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/Window/unhandledrejection_event) */
3946039460
onunhandledrejection: ((this: WindowEventHandlers, ev: PromiseRejectionEvent) => any) | null;
3946139461
/**
39462-
* @deprecated
39462+
* @deprecated The unload event is not reliable, consider visibilitychange or pagehide events
3946339463
*
3946439464
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Window/unload_event)
3946539465
*/
@@ -41828,7 +41828,7 @@ declare var onstorage: ((this: Window, ev: StorageEvent) => any) | null;
4182841828
/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/Window/unhandledrejection_event) */
4182941829
declare var onunhandledrejection: ((this: Window, ev: PromiseRejectionEvent) => any) | null;
4183041830
/**
41831-
* @deprecated
41831+
* @deprecated The unload event is not reliable, consider visibilitychange or pagehide events
4183241832
*
4183341833
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Window/unload_event)
4183441834
*/

inputfiles/patches/cssom.kdl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,9 @@ interface CSSStyleDeclaration \
77
forwardExtends=CSSStyleProperties
88

99
interface CSSStyleProperties replaceReference=CSSStyleDeclaration {
10-
property wordWrap deprecated=#true
10+
property wordWrap deprecated="The 'wordWrap' property is non-standard and has been replaced by 'overflow-wrap' in modern CSS."
1111

1212
// The corresponding standardized property is not supported by
1313
// anyone as of 2024-10.
14-
property webkitLineClamp deprecated=#false
14+
property webkitLineClamp supported=#false
1515
}

inputfiles/patches/html.kdl

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,5 @@ interface HTMLDocument extends=Document exposed=Window
1212
interface-mixin MessageEventTarget overrideThis=T typeParameters=T
1313

1414
interface-mixin WindowEventHandlers {
15-
// TODO: pass a string instead for deprecated
16-
// The unload event is not reliable, consider visibilitychange or pagehide events
17-
property onunload deprecated=#true
15+
property onunload deprecated="The unload event is not reliable, consider visibilitychange or pagehide events"
1816
}

inputfiles/patches/uievents.kdl

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,4 @@
11
dictionary KeyboardEventInit {
2-
// TODO: pass a string instead for deprecated
3-
// charCode is inconsistent across environments, consider using .key instead
4-
member charCode deprecated=#true
5-
// keyCode is inconsistent across environments, consider using .key instead
6-
member keyCode deprecated=#true
2+
member charCode deprecated="CharCode is inconsistent across environments, consider using .key instead"
3+
member keyCode deprecated="KeyCode is inconsistent across environments, consider using .key instead"
74
}

src/build/patches.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -256,7 +256,8 @@ function handleProperty(child: Node): Partial<Property> {
256256
? handleTyped(typeNode)
257257
: optionalMember("type", "string", child.properties?.type)),
258258
...optionalMember("readonly", "boolean", child.properties?.readonly),
259-
...optionalMember("deprecated", "boolean", child.properties?.deprecated),
259+
...optionalMember("deprecated", "string", child.properties?.deprecated),
260+
...optionalMember("deprecated", "boolean", child.properties?.supported)
260261
};
261262
}
262263

@@ -366,7 +367,7 @@ function handleMember(c: Node): Partial<Member> {
366367
name,
367368
...optionalMember("type", "string", c.properties?.type),
368369
...optionalMember("required", "boolean", c.properties?.required),
369-
...optionalMember("deprecated", "boolean", c.properties?.deprecated),
370+
...optionalMember("deprecated", "string", c.properties?.deprecated),
370371
...optionalMember("overrideType", "string", c.properties?.overrideType),
371372
};
372373
}

0 commit comments

Comments
 (0)