-
Notifications
You must be signed in to change notification settings - Fork 71
fix: ensure updated variables get picked up (rebase) #187
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
Conversation
|
To view this pull requests documentation preview, visit the following URL: docs.page/invertase/tanstack-query-firebase~187 Documentation is deployed and generated using docs.page. |
e6f9167 to
4aad4be
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR rebases and resolves conflicts from a previous deep-equal and ref-change implementation, adding a generic deepEqual utility, updating useDataConnectQuery to detect variable changes via deep comparison, and cleaning up related docs and versioning.
- Introduce
deepEqualutility and its tests - Update
useDataConnectQueryto trackrefOrResultchanges withuseEffect&deepEqual - Add a test for fetching new data when query variables change, bump package version, and remove stale
DataConnectimports from README
Reviewed Changes
Copilot reviewed 7 out of 7 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| packages/react/src/data-connect/utils.ts | Add deepEqual function for nested value comparison |
| packages/react/src/data-connect/utils.test.ts | Add unit tests for deepEqual covering primitives, objects, and arrays |
| packages/react/src/data-connect/useDataConnectQuery.ts | Import deepEqual & useEffect, implement getRef and ref-change logic |
| packages/react/src/data-connect/useDataConnectQuery.test.tsx | Add test to verify data is refetched when variables update |
| packages/react/package.json | Bump version to 2.0.1 |
| dataconnect-sdk/js/default-connector/README.md | Remove deprecated DataConnect named import from usage examples |
Comments suppressed due to low confidence (1)
packages/react/src/data-connect/utils.test.ts:39
- [nitpick] Tests cover primitive arrays but not nested arrays or arrays of objects. Consider adding cases like
deepEqual([[1], [2]], [[1], [2]])and tests for arrays of objects to ensure full coverage ofdeepEqualbehavior.
test("should compare arrays correctly", () => {
| @@ -1,49 +1,49 @@ | |||
| { | |||
| "name": "@tanstack-query-firebase/react", | |||
| "version": "2.0.0", | |||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
One difference here, #180 seems to have the bumped version at 2.0.8 , I believe 2.0.1 in here is okay
Co-authored-by: Copilot <[email protected]>
supercedes #180 - rebased to resolve conflicts