fix: ensure updated variables get picked up (rebase)#187
Merged
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
Contributor
There was a problem hiding this comment.
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", | |||
Contributor
There was a problem hiding this comment.
One difference here, #180 seems to have the bumped version at 2.0.8 , I believe 2.0.1 in here is okay
HassanBahati
approved these changes
Jun 25, 2025
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.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.
supercedes #180 - rebased to resolve conflicts