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

refactor(animation): Replace enums with string literal type aliases #4287

Merged
merged 10 commits into from
Jan 31, 2019

Conversation

acdvorak
Copy link
Contributor

Refs #4225

IMO this makes the code a little easier to read/write.

https://www.typescriptlang.org/docs/handbook/advanced-types.html#string-literal-types

@moog16
Copy link
Contributor

moog16 commented Jan 24, 2019

Sleeping on this one - string literals might be cleaner, but the enums also provide an easy avenue to refactoring. In this case I don't think it matters as much, since the naming of animationend or transform are going to change :)

@kfranqueiro
Copy link
Contributor

I for one vastly prefer this approach... but it looks like it's failing tests in its current state.

@moog16
Copy link
Contributor

moog16 commented Jan 28, 2019

My only reason for using enums were for autocomplete, and avoiding spelling mistakes. I think in this case though, these can already be autocomplete'd. If you have a stronger opinion here then lets go with yours 👍

@codecov-io
Copy link

codecov-io commented Jan 31, 2019

Codecov Report

Merging #4287 into feat/typescript will decrease coverage by <.01%.
The diff coverage is 100%.

Impacted file tree graph

@@                 Coverage Diff                 @@
##           feat/typescript    #4287      +/-   ##
===================================================
- Coverage            98.37%   98.36%   -0.01%     
===================================================
  Files                   93       93              
  Lines                 5771     5736      -35     
  Branches               778      778              
===================================================
- Hits                  5677     5642      -35     
  Misses                  94       94
Impacted Files Coverage Δ
packages/mdc-animation/index.ts 100% <ø> (ø) ⬆️
packages/mdc-tabs/tab-bar/foundation.js 100% <100%> (ø) ⬆️
packages/mdc-slider/foundation.js 100% <100%> (ø) ⬆️
packages/mdc-checkbox/index.js 98.79% <100%> (-0.02%) ⬇️
packages/mdc-tabs/tab-bar-scroller/index.js 100% <100%> (ø) ⬆️
packages/mdc-linear-progress/foundation.ts 100% <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 13d169d...439e25f. Read the comment docs.

@mdc-web-bot
Copy link
Collaborator

All 621 screenshot tests passed for commit 0fd0915 vs. feat/typescript! 💯🎉

@mdc-web-bot
Copy link
Collaborator

All 621 screenshot tests passed for commit 17bee8e vs. feat/typescript! 💯🎉

Copy link
Contributor

@moog16 moog16 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

one comment, but after that it looks good.

@mdc-web-bot
Copy link
Collaborator

All 621 screenshot tests passed for commit 9a3a101 vs. feat/typescript! 💯🎉

@mdc-web-bot
Copy link
Collaborator

All 621 screenshot tests passed for commit 439e25f vs. feat/typescript! 💯🎉

@acdvorak acdvorak merged commit 869e44c into feat/typescript Jan 31, 2019
@acdvorak acdvorak deleted the feat/typescript--animation-alias branch January 31, 2019 22:34
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.

6 participants