Skip to content

Conversation

djhi
Copy link
Collaborator

@djhi djhi commented Jul 4, 2025

Problem

When wrapping many different records in <CanAccess>, its memory footpring is huge.

Solution

This is because we pass the whole record in the useQuery parameters. We can only pass the record identifier.

How It Was Tested

Before the fix:
image

After the fix:
image

Even with this small use case (records are quite simple), that's 10MB saved.

Additional Checks

  • The PR targets master for a bugfix or a documentation fix, or next for a feature

@djhi djhi added the RFR Ready For Review label Jul 4, 2025
@Madeorsk Madeorsk self-requested a review July 7, 2025 15:47
Copy link
Contributor

@Madeorsk Madeorsk left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great! Can you just add the React Query Debugger as @fzaninotto suggested?

@Madeorsk Madeorsk merged commit e883d2c into master Jul 10, 2025
15 checks passed
@Madeorsk Madeorsk deleted the use-can-access-record-key branch July 10, 2025 10:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
RFR Ready For Review
Development

Successfully merging this pull request may close these issues.

3 participants