-
Notifications
You must be signed in to change notification settings - Fork 353
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
remove staticRender #421
remove staticRender #421
Conversation
🦋 Changeset detectedLatest commit: ad36c5a The changes in this PR will be included in the next version bump. This PR includes changesets to release 2 packages
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 |
GeraldRequired Reviewers
Don't want to be involved in this pull request? Comment |
Codecov Report
Additional details and impacted files@@ Coverage Diff @@
## main #421 +/- ##
=======================================
Coverage ? 28.52%
=======================================
Files ? 304
Lines ? 25887
Branches ? 6240
=======================================
Hits ? 7384
Misses ? 18503
Partials ? 0
Continue to review full report in Codecov by Sentry.
|
Size Change: +280 B (0%) Total Size: 635 kB
ℹ️ View Unchanged
|
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 love this change. I think the unit
widget might have been semi-broken and now completely broken with this refactoring. Requesting changes to add a unit test with RTL or a Story to validate it actually renders.
_getInputType: () => "tex" | "text" = () => { | ||
if (this.props.apiOptions.staticRender) { | ||
return "tex"; | ||
} | ||
return "text"; | ||
}; | ||
|
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.
Oh, I'm really happy to see this go!!!
apiOptions.staticRender || | ||
apiOptions.readOnly |
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.
These two options always felt suspiciously similar anyways!
onBlur={this.handleBlur} | ||
/> | ||
) : ( | ||
const input = ( |
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 think this is now a cycle. The input
on line 182 seems to refer to itself (line 181). Can you maybe do a super-simple unit test or story to see if this component actually renders?
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.
Would you call it a Unit test? Because it's the Unit widget? 😅
It was working in Storybook as-is, but I see what you mean. Removed that cycle, added a unit test, and cleaned up the component while I was there.
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.
Would you call it a Unit test?
Well played! 😂
## Summary: Follow-up to Jeremy's feedback in #421 - Add unit test to make sure Unit widget renders - Reorganize Unit to conform to the React ordering linting thing Author: handeyeco Reviewers: kevinbarabash, jeremywiebe Required Reviewers: Approved By: kevinbarabash, jeremywiebe Checks: ✅ codecov/project, ❌ Publish npm snapshot (ubuntu-latest, 16.x), ✅ Lint, Flow, and Test (ubuntu-latest, 16.x), ✅ Extract i18n strings (ubuntu-latest, 16.x), ✅ Cypress Coverage (ubuntu-latest, 16.x), ✅ Check for .changeset file (ubuntu-latest, 16.x), ✅ Check builds for changes in size (ubuntu-latest, 16.x), ✅ gerald, ✅ Jest Coverage (ubuntu-latest, 16.x) Pull Request URL: #423
npm Snapshot: Published🎉 Good news!! We've packaged up the latest commit from this PR (21ab3f3) and published it to npm. You Example: yarn add @khanacademy/perseus@PR421 |
Summary:
I ran across
staticRender
inApiOptions
while working on Expression. I couldn't figure out what it was for and, after digging in a bit, realized it was meant to be depreciated years ago.I couldn't find anything that was setting
staticRender
totrue
(or anything that could set it).See this rambling: https://khanacademy.slack.com/archives/C01AZ9H8TTQ/p1679519079246219
A highlight from 2016:
Test plan: