fix: migrate jotai functions to useSetAtom and useAtomValue#293
Open
ElliotFriend wants to merge 2 commits intostoplightio:masterfrom
Open
fix: migrate jotai functions to useSetAtom and useAtomValue#293ElliotFriend wants to merge 2 commits intostoplightio:masterfrom
ElliotFriend wants to merge 2 commits intostoplightio:masterfrom
Conversation
The jotai functions currently display deprecation notices surrounding the use of several functions, especially those from `jotai/utils`. This change migrates to the newer functions recommended by the deprecation notices. fix stoplightio#259
Contributor
|
Awesome work, I did a similar change in my other PR #260 but a separate PR for this jotai change is much better. Never found the time to work on it. |
…iewer into fix/jotai-deprecation-warnings
Author
|
Hey there, @SB-venkatyadavilli!! (Sorry to tag you blindly, but you're a recent committer) I noticed my PR was a couple commits behind. I've gone ahead and merged the new changes into the branch, and the tests are still passing. Is there anything else that's needed before this PR can get reviewed? Thanks! |
1 task
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Hi, there!! Hope this isn't an unwelcome contribution.
The jotai functions currently display deprecation notices surrounding the use of several functions, especially those from
jotai/utils.fix #259
Motivation and Context
We use the
@MetaMask/open-rpc-docs-reactpackage for our Docusaurus site. Every time we build, there are many deprecation notices, just like is mentioned in issue #259. I've experimented with locally applying a patch to the package once downloaded, and the deprecation warnings disappear. This PR is a more "proper" form of that fix.Description
This change migrates to the newer functions recommended by the deprecation notices. To accomplish this,
jotai/utils.useAtomValueis now imported directly fromjotaiinsteaduseUpdateAtom(fromjotai/utils) is replaced byuseSetAtomfromjotai.How Has This Been Tested?
I've made the same changes to the
node_modulesversion of this package in my local Docusaurus site, and the build proceeds with no deprecation notices.I've also run the
yarn test.prodscript, and all tests pass. The functions I've used to replace the deprecated ones seem like drop-in replacements, and there shouldn't be any trouble. In this (old) commit in thejotaipackage, they're using these same functions "internally" for these deprecated functions I'm replacing.I'm not sure if it's necessary to add error reporting or more test cases for a change this "simple," but I'm more than happy to add them if it's required.
Types of changes
Checklist