dai-shi / proxy-compare

Compare two objects using accessed properties with Proxy
https://www.npmjs.com/package/proxy-compare
MIT License
283 stars 18 forks source link

fix: remove unfrozen cache #53

Closed dai-shi closed 1 year ago

dai-shi commented 1 year ago

I found a subtle bug when trying https://github.com/pmndrs/valtio/pull/656.

It goes crazy if we use proxy-memoize and useSnapshot in valtio. It's due to the aggressive caching of unfreeze. If proxyCache is provided, it's cached anyways, otherwise, we just shouldn't cache unfreeze result. (there might be a better way, but not known now.)

codesandbox-ci[bot] commented 1 year ago

This pull request is automatically built and testable in CodeSandbox.

To see build info of the built libraries, click here or the icon next to each commit SHA.

Latest deployment of this branch, based on commit 30e44ed008234c25dc815e5d3024e17392592646:

Sandbox Source
Vanilla Configuration
Vanilla Typescript Configuration
React Configuration
React Typescript Configuration
dai-shi commented 1 year ago

This was reverting #44, so https://github.com/pmndrs/valtio/issues/519 is back??