-
Notifications
You must be signed in to change notification settings - Fork 128
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Migrate remaining components to TypeScript #2065
Conversation
🦋 Changeset detectedLatest commit: 26db23e The changes in this PR will be included in the next version bump. This PR includes changesets to release 1 package
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
f7111b5
to
4c7012a
Compare
Codecov Report
@@ Coverage Diff @@
## next #2065 +/- ##
==========================================
- Coverage 97.10% 96.81% -0.30%
==========================================
Files 250 248 -2
Lines 22392 22383 -9
Branches 2105 2117 +12
==========================================
- Hits 21743 21669 -74
- Misses 641 703 +62
- Partials 8 11 +3
|
4c7012a
to
26db23e
Compare
.circuit-0 { | ||
display: block; | ||
position: relative; | ||
overflow: hidden; | ||
height: auto; | ||
width: 100%; | ||
} |
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 removed these default styles when no aspect-ratio is provided. The result should be the same.
{this.getDateRangePreview()} | ||
</Tag> | ||
{isOpen && ( | ||
<CalendarWrap> | ||
<RangePickerController | ||
initialVisibleMonth={null} |
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.
Added this to make TypeScript happy. The component works the same with and without 🤷♂️
onClick={this.handleTagClick} | ||
> | ||
{this.getDateRangePreview()} | ||
</Tag> | ||
{isOpen && ( | ||
<CalendarWrapper> | ||
{/* @ts-expect-error This worked before the component was converted to TypeScript */} |
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 didn't bother fixing the types here since the component will soon be replaced.
@@ -64,17 +112,17 @@ const animationStyles = ({ | |||
animation-name: ${animationName}; | |||
animation-duration: ${animationDuration}ms; | |||
animation-fill-mode: forwards; | |||
animation-timing-function: ${theme.transitions.easeInOutCubic}; |
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.
This transition doesn't exist on the theme (anymore?).
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.
That's nice! Good work⭐
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.
Wow! This is great, thanks for doing it. It's true that we were in a bit of a tricky situation, with legacy components that we didn't bother migrating to TS initially, but also blocked by these very components when cleaning up/improving our stack.
I haven't looked at the full diff very closely since many of these components are either legacy or have low usage. There will definitely be type errors in consumer apps, but we can probably @ts-ignore
many of them during the migration—since these components should eventually be replaced (or rebuilt) anyway.
In a word: fantastisch
Completes #516.
Purpose
While working on #2061, I encountered an issue with the remaining JavaScript files. Files that contain JSX need to use the
.jsx
extension. ESM requires imports to include the filename and extension. However, once TypeScript transpiles the files using the"jsx": "react-jsx"
config option, it uses the.js
file extension on disk but doesn't update the imports to match.This isn't an issue for TypeScript files, where the final extension should be used for imports (i.e.,
.js
).Approach and changes
prop-types
dependencyDefinition of done