Skip to content
This repository has been archived by the owner on Jan 13, 2025. It is now read-only.

fix: update TypeScript version to 3.5.x and fix typing errors #4853

Merged
merged 7 commits into from
Jul 2, 2019

Conversation

moog16
Copy link
Contributor

@moog16 moog16 commented Jun 21, 2019

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. Type Element add/removeEventListener calls expected the handler to be of type EventListenerOrEventListenerObject, while the SpecificEventListener<K> is specifically for node of type HTMLElement, and included event handlers like MouseEvent, KeyboardEvent, etc. These pose problematic as they are a superset of Event.

  • Fix: I changed the topAppBar, formField, and ripple root_ elements to be HTMLElement from Element. This is more correct as HTMLElement is a superset of Element. Our components should always be using either a SVG element or HTML element of which type HTMLElement covers. I decided to cast the add/removeEventListener node to an HTMLElement.

@codecov-io
Copy link

codecov-io commented Jun 21, 2019

Codecov Report

Merging #4853 into master will not change coverage.
The diff coverage is 100%.

Impacted file tree graph

@@           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
Impacted Files Coverage Δ
packages/mdc-form-field/component.ts 100% <100%> (ø) ⬆️
packages/mdc-ripple/component.ts 96.22% <100%> (ø) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update b524a12...ef69386. Read the comment docs.

@mdc-web-bot
Copy link
Collaborator

All 693 screenshot tests passed for commit fc7942f vs. master! 💯🎉

@mdc-web-bot
Copy link
Collaborator

All 693 screenshot tests passed for commit 1f03be1 vs. master! 💯🎉

@mdc-web-bot
Copy link
Collaborator

All 693 screenshot tests passed for commit 7cb4b5f vs. master! 💯🎉

@dorivaught dorivaught added this to the Sprint 6: June 25-July 8 milestone Jun 25, 2019
Copy link
Collaborator

@abhiomkar abhiomkar left a 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?

@moog16
Copy link
Contributor Author

moog16 commented Jun 28, 2019

Ah sorry it was lost in this commit 7cb4b5f. I'm un-reverting

@moog16
Copy link
Contributor Author

moog16 commented Jun 28, 2019

updated!

@mdc-web-bot
Copy link
Collaborator

All 699 screenshot tests passed for commit d214746 vs. master! 💯🎉

@mdc-web-bot
Copy link
Collaborator

All 699 screenshot tests passed for commit ef69386 vs. master! 💯🎉

@moog16 moog16 merged commit 0657504 into master Jul 2, 2019
@delete-merged-branch delete-merged-branch bot deleted the chore/update-typescript350 branch July 2, 2019 00:14
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Upgrade TypeScript version to 3.5.x
6 participants