-
Notifications
You must be signed in to change notification settings - Fork 350
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
add useMemo to KeypadContext provider #764
Conversation
GeraldRequired Reviewers
Don't want to be involved in this pull request? Comment |
Size Change: +2.89 kB (0%) Total Size: 855 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.
LGTM. Needs a changeset to make sure version gets bumped.
const memoizedValue = useMemo( | ||
() => ({ | ||
keypadActive, | ||
setKeypadActive, | ||
keypadElement, | ||
setKeypadElement, | ||
renderer, | ||
setRenderer, | ||
scrollableElement, | ||
setScrollableElement, | ||
}), | ||
[ | ||
keypadActive, | ||
setKeypadActive, | ||
keypadElement, | ||
setKeypadElement, | ||
renderer, | ||
setRenderer, | ||
scrollableElement, | ||
setScrollableElement, | ||
], | ||
); |
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.
praise: Great! Thanks for making this change.
setKeypadElement, | ||
renderer, | ||
setRenderer, | ||
scrollableElement, |
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.
scrollableElement, | |
// The scrollableElement options can likely be removed after | |
// the exercises-package is officially deprecated. They don't appear | |
// to be used anywhere except for the exercises-package and tests. | |
scrollableElement, |
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.
My understanding of the scrollableElement has changed since we first wrote this comment and I actually don't think it's true anymore.
Codecov Report
Additional details and impacted files@@ Coverage Diff @@
## main #764 +/- ##
==========================================
+ Coverage 59.63% 60.97% +1.34%
==========================================
Files 480 485 +5
Lines 105413 105813 +400
Branches 6031 8763 +2732
==========================================
+ Hits 62860 64522 +1662
+ Misses 42553 41291 -1262
... and 56 files with indirect coverage changes Continue to review full report in Codecov by Sentry.
|
npm Snapshot: Published🎉 Good news!! We've packaged up the latest commit from this PR (a974b9e) and published it to npm. You Example: yarn add @khanacademy/perseus@PR764 |
This PR was opened by the [Changesets release](https://github.com/changesets/action) GitHub action. When you're ready to do a release, you can merge this and the packages will be published to npm automatically. If you're not ready to do a release yet, that's fine, whenever you add more changesets to main, this PR will be updated. # Releases ## @khanacademy/[email protected] ### Minor Changes - [#780](#780) [`376eb0e4`](376eb0e) Thanks [@jeremywiebe](https://github.com/jeremywiebe)! - Adds an `onError` callback prop to the ErrorBoundary component. Uses this new callback in the WidgetContainer component to report all widget rendering failures through the analytics API. ### Patch Changes - [#759](#759) [`c431c4b8`](c431c4b) Thanks [@handeyeco](https://github.com/handeyeco)! - Remove references to unused font families - [#775](#775) [`cb529549`](cb52954) Thanks [@nedredmond](https://github.com/nedredmond)! - Added flag to `simpleValidate` call from Renderer to ensure we call analytics on MathInputEvaluated only when the answer is submitted - [#781](#781) [`9b9dfd4f`](9b9dfd4) Thanks [@SonicScrewdriver](https://github.com/SonicScrewdriver)! - Fix for broken dilation tool in the Transformer Widget - Updated dependencies \[[`c431c4b8`](c431c4b), [`fb84640d`](fb84640), [`376eb0e4`](376eb0e), [`33cc24c3`](33cc24c)]: - @khanacademy/[email protected] - @khanacademy/[email protected] - @khanacademy/[email protected] - @khanacademy/[email protected] - @khanacademy/[email protected] - @khanacademy/[email protected] - @khanacademy/[email protected] ## @khanacademy/[email protected] ### Minor Changes - [#780](#780) [`376eb0e4`](376eb0e) Thanks [@jeremywiebe](https://github.com/jeremywiebe)! - Added 'perseus:widget-rendering-error' analytics event. ## @khanacademy/[email protected] ### Patch Changes - Updated dependencies \[[`376eb0e4`](376eb0e)]: - @khanacademy/[email protected] ## @khanacademy/[email protected] ### Patch Changes - Updated dependencies \[[`376eb0e4`](376eb0e)]: - @khanacademy/[email protected] ## @khanacademy/[email protected] ### Patch Changes - [#759](#759) [`c431c4b8`](c431c4b) Thanks [@handeyeco](https://github.com/handeyeco)! - Remove references to unused font families - [#764](#764) [`fb84640d`](fb84640) Thanks [@handeyeco](https://github.com/handeyeco)! - Use useMemo in keypad context to avoid needless rerenders - [#767](#767) [`33cc24c3`](33cc24c) Thanks [@jeremywiebe](https://github.com/jeremywiebe)! - Small comment fixes in the math keypad - Updated dependencies \[[`376eb0e4`](376eb0e)]: - @khanacademy/[email protected] ## @khanacademy/[email protected] ### Patch Changes - Updated dependencies \[[`c431c4b8`](c431c4b), [`cb529549`](cb52954), [`376eb0e4`](376eb0e), [`9b9dfd4f`](9b9dfd4), [`376eb0e4`](376eb0e)]: - @khanacademy/[email protected] - @khanacademy/[email protected] - @khanacademy/[email protected] - @khanacademy/[email protected] ## @khanacademy/[email protected] ### Patch Changes - Updated dependencies \[[`376eb0e4`](376eb0e)]: - @khanacademy/[email protected] ## @khanacademy/[email protected] ### Patch Changes - Updated dependencies \[[`376eb0e4`](376eb0e)]: - @khanacademy/[email protected] - @khanacademy/[email protected] ## @khanacademy/[email protected] ### Patch Changes - Updated dependencies \[[`376eb0e4`](376eb0e)]: - @khanacademy/[email protected] - @khanacademy/[email protected] - @khanacademy/[email protected] ## @khanacademy/[email protected] ### Patch Changes - Updated dependencies \[[`376eb0e4`](376eb0e)]: - @khanacademy/[email protected] Author: khan-actions-bot Reviewers: jeremywiebe Required Reviewers: Approved By: jeremywiebe Checks: ✅ codecov/project, ✅ codecov/patch, ✅ Upload Coverage, ⏭ Publish npm snapshot, ✅ Publish Storybook to Chromatic (ubuntu-latest, 16.x), ✅ Extract i18n strings (ubuntu-latest, 16.x), ✅ Check builds for changes in size (ubuntu-latest, 16.x), ✅ Lint, Typecheck, Format, and Test (ubuntu-latest, 16.x), ✅ Check for .changeset entries for all changed files (ubuntu-latest, 16.x), ✅ Cypress (ubuntu-latest, 16.x), ✅ Jest Coverage (ubuntu-latest, 16.x), ✅ gerald Pull Request URL: #779
Summary:
Issue: XXX-XXXX
Test plan: