-
Notifications
You must be signed in to change notification settings - Fork 2.1k
fix: update TypeScript version to 3.5.x and fix typing errors #4853
Conversation
Codecov Report
@@ Coverage Diff @@
## master #4853 +/- ##
=======================================
Coverage 98.86% 98.86%
=======================================
Files 119 119
Lines 5650 5650
Branches 749 749
=======================================
Hits 5586 5586
Misses 63 63
Partials 1 1
Continue to review full report at Codecov.
|
All 693 screenshot tests passed for commit fc7942f vs. |
…onents/material-components-web into chore/update-typescript350
This reverts commit fc7942f.
All 693 screenshot tests passed for commit 1f03be1 vs. |
All 693 screenshot tests passed for commit 7cb4b5f vs. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I do not see any change in package.json
and package-lock.json
files for this upgrade?
Ah sorry it was lost in this commit 7cb4b5f. I'm un-reverting |
updated! |
All 699 screenshot tests passed for commit d214746 vs. |
All 699 screenshot tests passed for commit ef69386 vs. |
fixes #4852
Upgrading TS from 3.2.2 to 3.5.2
Root cause from upgrade is still a bit unknown to me. No changes in 3.3, 3.4, or 3.5 should have caused this type error to occur.
These type errors should have appeared before. The error occurred on add/removeEventListener calls where the root node was type
Element
. TypeElement
add/removeEventListener calls expected the handler to be of typeEventListenerOrEventListenerObject
, while theSpecificEventListener<K>
is specifically for node of typeHTMLElement
, and included event handlers likeMouseEvent
,KeyboardEvent
, etc. These pose problematic as they are a superset of Event.Fix:
I changed theI decided to cast the add/removeEventListener node to antopAppBar
,formField
, andripple
root_ elements to beHTMLElement
fromElement
. This is more correct asHTMLElement
is a superset ofElement
. Our components should always be using either a SVG element or HTML element of which typeHTMLElement
covers.HTMLElement
.