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
[MM-57710] Convert katex class component to function component #26967
Conversation
@marlenekoh: Adding the "do-not-merge/release-note-label-needed" label because no release-note block was detected, please follow our release note process to remove it. I understand the commands that are listed here |
Hello @marlenekoh, Thanks for your pull request! A Core Committer will review your pull request soon. For code contributions, you can learn more about the review process here. |
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.
Great work! Just one minor thing.
Enterprise tests are not yet completed. You need to wait until |
@larkox thanks for the review! Made the changes. |
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.
Great work. Thanks!
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.
Thanks for the PR, @marlenekoh!
The code looks good to me, but it looks like the unit tests for this component are broken now. Could you take a look at fixing those? You can run just the test for that one component by running npm test -w channels -- components/latex_block
in the webapp
folder.
It looks like one of the snapshots is broken because of the component's display name changed, so that one just needs to be updated with -u
, but the others seem to be failing because it's not loading Katex any more. I'm not sure if that's because useEffect
isn't setting the state correctly or if the way that we're waiting for the async import to happen doesn't work with the functional component though
Alright, I will take a look! |
@hmhealey the tests for latex component should pass now, please take a look 🙏
qn: do we want to render the error message or handle the |
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.
Thanks for all the details on what you changed. That makes sense that we'd have to switch to Testing Library for this since Enzyme doesn't even officially support React 17. We really need to get rid of Enzyme one of these days.
As for throwOnError
, I didn't realize that that's been false for years at this point since it still seems to render errors like it did originally. I see you reverted that though which is also totally fine. It's definitely something we'll want to look into at some point, but it's not at all a priority.
Overall, this looks good to me!
/e2e-tests |
E2E test triggered successfully for PR #26967. The corresponding commit's status check will be available shortly. |
E2E test run is starting for commit
|
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.
Test server destroyed |
Summary
Migrates
./components/latex_block/latex_block.tsx
from Class Component to Function ComponentTicket Link
Fixes #26678
Screenshots
Release Note