Skip to content

next major#671

Draft
psteinroe wants to merge 18 commits into
mainfrom
next-major
Draft

next major#671
psteinroe wants to merge 18 commits into
mainfrom
next-major

Conversation

@psteinroe

Copy link
Copy Markdown
Owner
  • refactor(postgrest-core): start ripping out complexity
  • refactor: next major

@changeset-bot

changeset-bot Bot commented Jan 5, 2026

Copy link
Copy Markdown

⚠️ No Changeset found

Latest commit: 2ba794c

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

@codecov

codecov Bot commented Jan 5, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 85.85746% with 127 lines in your changes missing coverage. Please review.
✅ Project coverage is 91.17%. Comparing base (327e946) to head (2ba794c).
⚠️ Report is 19 commits behind head on main.

Files with missing lines Patch % Lines
...ckages/postgrest-react-query/src/lib/pagination.ts 73.00% 20 Missing and 7 partials ⚠️
...eact-query/src/subscribe/use-subscription-query.ts 24.13% 16 Missing and 6 partials ⚠️
...tgrest-swr/src/subscribe/use-subscription-query.ts 24.13% 16 Missing and 6 partials ⚠️
...ages/postgrest-core/src/paginated-query-fetcher.ts 13.63% 16 Missing and 3 partials ⚠️
...uery/src/query/use-cursor-infinite-scroll-query.ts 79.41% 4 Missing and 3 partials ⚠️
...postgrest-react-query/src/cache/use-update-item.ts 80.00% 4 Missing ⚠️
.../src/query/use-infinite-offset-pagination-query.ts 90.24% 4 Missing ⚠️
packages/postgrest-core/src/update-item.ts 94.00% 3 Missing ⚠️
...st-react-query/src/lib/extract-cache-data-array.ts 93.18% 3 Missing ⚠️
...rest-react-query/src/subscribe/use-subscription.ts 81.25% 2 Missing and 1 partial ⚠️
... and 9 more
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #671      +/-   ##
==========================================
- Coverage   92.63%   91.17%   -1.47%     
==========================================
  Files         151      158       +7     
  Lines        2390     2674     +284     
  Branches      751      867     +116     
==========================================
+ Hits         2214     2438     +224     
- Misses        145      192      +47     
- Partials       31       44      +13     
Flag Coverage Δ
postgrest-core 91.17% <85.85%> (-1.47%) ⬇️
postgrest-react-query 91.17% <85.85%> (-1.47%) ⬇️
postgrest-server 91.17% <85.85%> (-1.47%) ⬇️
postgrest-swr ?
storage-core 91.17% <85.85%> (-1.47%) ⬇️
storage-react-query 91.17% <85.85%> (-1.47%) ⬇️
storage-swr 91.17% <85.85%> (-1.47%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@psteinroe psteinroe force-pushed the next-major branch 2 times, most recently from 623dc71 to 487d1c2 Compare January 5, 2026 14:47
psteinroe and others added 18 commits January 21, 2026 15:29
- Add proper dependencies to useEffect in use-subscription.ts files
- Add proper dependencies to useEffect in use-subscription-query.ts files
- Fix useCallback patterns in storage mutation hooks
- Fix formatting in test files

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Add unit tests for useSubscription hooks in both postgrest-swr and
postgrest-react-query packages to improve test coverage.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- Extract useRealtimeSubscription as base hook for both packages
- Reduce type parameters from 7 to 2 in useSubscriptionQuery
- Remove complex GetResult inference that caused TypeScript heap issues
- Use useCallback with ref pattern to avoid unnecessary re-subscriptions
- Compose useSubscription and useSubscriptionQuery on top of base hook

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- Remove queriesForTable requirement from delete fetcher since delete
  revalidation only needs primary keys (not filter columns like upsert)
- Skip auto-query in buildDeleteFetcher by passing empty queriesForTable
- Always return primary keys from delete operations
- Fix TypeScript errors in use-realtime-subscription by using switch
  statement to match specific .on() overloads for each event type
- Update delete mutation hooks to remove queriesForTable usage
- Update delete-fetcher tests for new API

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Add comprehensive unit tests for the useRealtimeSubscription hook in
both SWR and React Query packages. Tests cover:
- Initial state
- Channel subscription on mount
- Status updates
- All event types (ALL, INSERT, UPDATE, DELETE)
- Filter expressions
- Default schema handling
- Payload callback invocation

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant