Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: replaceDeepEqual for objects created by Object.create #7357

Merged
merged 2 commits into from
May 4, 2024

Conversation

sukovanej
Copy link
Contributor

Currently, objects with custom prototypes (created using Object.create(...)) are dealt with as plain objects. That causes them to be copied without the prototype in case of refetch / invalidation and results in buggy behaviour. This is problematic when using together with https://github.com/Effect-TS/effect (e.g Option, Either, ... data structures).

BTW, based on the test suite, it might cover other checks like prot.hasOwnProperty('isPrototypeOf') so the impl of isPlainObject could be refactored a little but I'm honestly not 100% sure.

Copy link

vercel bot commented Apr 30, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

1 Ignored Deployment
Name Status Preview Comments Updated (UTC)
query ⬜️ Ignored (Inspect) Visit Preview May 4, 2024 8:21am

Copy link

codesandbox-ci bot commented Apr 30, 2024

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 84e3848:

Sandbox Source
@tanstack/query-example-angular-basic Configuration
@tanstack/query-example-react-basic-typescript Configuration
@tanstack/query-example-solid-basic-typescript Configuration
@tanstack/query-example-svelte-basic Configuration
@tanstack/query-example-vue-basic Configuration

@sukovanej sukovanej force-pushed the fix/replaceEqualDeep-object-create branch from 3afbab5 to bc4f4e5 Compare May 1, 2024 09:35
@sukovanej
Copy link
Contributor Author

This PR should be ready. @TkDodo could you please take a look?

Copy link

nx-cloud bot commented May 4, 2024

☁️ Nx Cloud Report

CI is running/has finished running commands for commit 84e3848. As they complete they will appear below. Click to see the status, the terminal output, and the build insights.

📂 See all runs for this CI Pipeline Execution


✅ Successfully ran 1 target

Sent with 💌 from NxCloud.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants