Skip to content

Conversation

@cabljac
Copy link
Collaborator

@cabljac cabljac commented Jun 25, 2025

supercedes #180 - rebased to resolve conflicts

@docs-page
Copy link

docs-page bot commented Jun 25, 2025

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.

@cabljac cabljac changed the title @invertase/fix variables update fix: ensure updated variables get picked up (rebase) Jun 25, 2025
@cabljac cabljac force-pushed the @invertase/fix-variables-update branch from e6f9167 to 4aad4be Compare June 25, 2025 12:13
@cabljac cabljac marked this pull request as ready for review June 25, 2025 12:13
@cabljac cabljac requested review from HassanBahati and Copilot June 25, 2025 14:55
Copy link
Contributor

Copilot AI left a 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 deepEqual utility and its tests
  • Update useDataConnectQuery to track refOrResult changes with useEffect & deepEqual
  • Add a test for fetching new data when query variables change, bump package version, and remove stale DataConnect imports 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 of deepEqual behavior.
  test("should compare arrays correctly", () => {

@@ -1,49 +1,49 @@
{
"name": "@tanstack-query-firebase/react",
"version": "2.0.0",
Copy link
Member

@HassanBahati HassanBahati Jun 25, 2025

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

@cabljac cabljac merged commit 32f06b8 into main Jun 26, 2025
2 checks passed
@github-project-automation github-project-automation bot moved this from Approved [PR] to Done in [Cloud] Open Source P0 Jun 26, 2025
@cabljac cabljac deleted the @invertase/fix-variables-update branch June 26, 2025 21:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

4 participants