React state time travel - #53
Draft
aidenybai wants to merge 2 commits into
Draft
Conversation
- Add TimeTravel class that tracks state/props history on every commit - Implement history navigation (goBack, goForward, goToIndex, goToCommitId) - Support state restoration via overrideHookState and overrideProps - Add component filtering by name or custom function - Implement diff functionality to compare snapshots - Add state/props timeline methods for individual fibers - Support export/import of history as JSON - Add comprehensive test coverage for all features The time-travel module uses bippy's instrumentation to: 1. Capture snapshots of fiber state on every commit 2. Store props and hook states with proper cloning 3. Restore previous states using React DevTools-style overrides Co-authored-by: aiden <aiden@million.dev>
|
Cursor Agent can help with this pull request. Just |
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
|
commit: |
Improvements: - Proper hook type identification (State, Reducer, Ref, Effect, Memo, etc.) - Track which hooks are actually editable (only State and Reducer) - Use WeakRef for fiber references to handle double-buffering - Add class component state tracking support - Add external state manager integration hooks (captureExternalState, restoreExternalState) - Add onBeforeRestore callback for restore cancellation - Add fibersByName index for faster component lookups - Better error handling during restoration - Skip non-serializable props (functions, key, ref, children) - Use getLatestFiber to handle fiber alternates correctly - Add utility methods: getTrackedFiberIds, getTrackedComponentNames, getEditableStateCount - Include hookType in diff results and state timeline - Export/import now includes version and external state Test improvements: - Add hook type identification tests - Add external state capture/restore tests - Add onBeforeRestore callback tests - Add utility method tests - Fix test cleanup between runs Co-authored-by: aiden <aiden@million.dev>
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.
Adds a React state time-travel debugging module to bippy, enabling tracking and restoration of component state and props history.