Conversation
| h('option', { value: 'foo' }); | ||
| createElement('option', { value: 'foo' }); |
There was a problem hiding this comment.
Sorry for the diff, placed this rather wonkily a few weeks ago. Moved it out so it wasn't sat in the middle of the event tests.
|
Damn, Edit: |
12d075c to
a463c9a
Compare
| // Remove when bumping TS minimum to >5.2 | ||
|
|
||
| /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/ToggleEvent) */ | ||
| interface ToggleEvent extends Event { | ||
| /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/ToggleEvent/newState) */ | ||
| readonly newState: string; | ||
| /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/ToggleEvent/oldState) */ | ||
| readonly oldState: string; | ||
| } | ||
|
|
||
| declare var ToggleEvent: { | ||
| prototype: ToggleEvent; | ||
| new(type: string, eventInitDict?: ToggleEventInit): ToggleEvent; | ||
| }; | ||
|
|
||
| interface ToggleEventInit extends EventInit { | ||
| newState?: string; | ||
| oldState?: string; | ||
| } | ||
|
|
||
| // End TS >5.2 |
There was a problem hiding this comment.
We've never done this before (to my knowledge), but maybe it's a viable strategy? It's not too gnarly and hopefully with the blocks it can be removed in the future pretty easily.
There was a problem hiding this comment.
looks good to me. Admittedly I'm not even sure if we've settled on a particular TS version to support.
There was a problem hiding this comment.
We haven't, though we do have split types for supporting >5.1 & <5.1 at the moment.
Issue is that every time we've bumped up the minimum people in other communities have had problems -- unfortunate side effect of being popular for widgets & component libs. IIUC, Angular still restricts TS versions per (Angular) major, for example.
Closes #4614