Use case
Framework
Owner
Valtio/V2/Migration Recipe
This recipe provides a collection of codemods to help you migrate your codebase to Valtio v2. These codemods are designed to streamline the transition process by automating common code transformations due to behavioral changes in Valtio v2.
Valtio/V2/Use Snapshot Migration
This codemod automates the migration of Valtio code to accommodate changes in the behavior of
useSnapshot()
. In recent updates,useSnapshot()
has been modified for better compatibility withuseMemo
and the upcoming React compiler. This codemod updates your code to ensure optimal performance and compatibility with these changes.Valtio/V2/Deep Clone Proxy Objects
In Valtio v2, the behavior of the
proxy(obj)
function has changed. In v1,proxy(obj)
was a pure function that deeply copied the objectobj
. In v2,proxy(obj)
is an impure function that deeply modifiesobj
. This codemod updates your code to accommodate these changes by incorporatingdeepClone
to ensure that objects are deeply copied as they were in v1.