feat: remove valtio dependency, inline proxy reactivity engine#52
Merged
Conversation
Replace valtio with a custom implementation based on valtio's source code (MIT License). The proxy-compare dependency is also eliminated by integrating native-object exclusion directly into canProxy() — only plain objects and arrays are proxied, which naturally handles File, Blob, Date, Map, etc. This removes the only non-es-toolkit runtime dependency, reducing bundle size and giving full control over the reactivity engine. All 232 tests pass, typecheck clean, build succeeds. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
… objects Replace proxyStateMap/refSet/snapCache/proxyCache with Symbol properties stored directly on each object ($state via get trap, $ref/$snap/$proxy via non-enumerable defineProperty). Two small fallback WeakMaps remain only for non-extensible objects (frozen snapshots) which are inherently request-scoped. This prevents shared mutable state at the module level for SSR safety. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
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.
Summary
valtioruntime dependency frompackages/comwitproxy.ts, based on valtio's source (MIT License)proxy-comparedependency by integrating native-object exclusion directly intocanProxy()— only plain objects and arrays are proxied, which naturally handles File, Blob, Date, Map, etc. without the previousautoRefDeep/wrapWithAutoRefwrapper layeres-toolkitis now the sole runtime dependencyWhat changed
packages/comwit/src/core/proxy.ts: Replaced valtio imports with ~220 lines of inline implementation coveringproxy(),snapshot(),subscribe(), andref()packages/comwit/package.json: RemovedvaltiofromdependenciesTest plan
🤖 Generated with Claude Code