Skip to content

Accept contributions around suspense and performance on useFind and useSubscribe hooks#435

Merged
nachocodoner merged 6 commits intomasterfrom
fix-perf-suspense-others
Apr 10, 2025
Merged

Accept contributions around suspense and performance on useFind and useSubscribe hooks#435
nachocodoner merged 6 commits intomasterfrom
fix-perf-suspense-others

Conversation

@nachocodoner
Copy link
Member

Continues: #430 and #429

This PR is to verify, solve conflicts and consolidate contributions done to fix and improve performance on react hooks.

welkinwong and others added 5 commits April 4, 2025 07:54
In strict mode (development only), useEffect may run 1-2 times. Throwing a promise outside can cause premature cleanup of subscriptions and cachedSubscription before unmount. To avoid this, check the timeout to ensure cleanup only occurs after unmount.
… server side and improved performance

1. On the server, useEffect doesn't run, so cached find data isn't cleared. Even after database updates, stale data is returned on subsequent requests.
2. useFindSuspense can't run on the client (non-reactive data makes it pointless), so the useEffect part was removed.
3. lodash.remove is no longer in use and can be removed.
4. According to 7d45b72, the package-lock.json file can be deleted.

This PR depends on #429
@nachocodoner nachocodoner changed the title Fix perf suspense others Accept contributions around suspense and performance on useFind and useSubscribe hooks Apr 10, 2025
@nachocodoner nachocodoner marked this pull request as ready for review April 10, 2025 14:35
@nachocodoner
Copy link
Member Author

We will release these along with other latest contributions in the next react packages release beta version.

@nachocodoner nachocodoner merged commit f508e39 into master Apr 10, 2025
2 checks passed
@nachocodoner nachocodoner deleted the fix-perf-suspense-others branch April 10, 2025 14:37
@nachocodoner nachocodoner restored the fix-perf-suspense-others branch April 10, 2025 14:55
@nachocodoner nachocodoner deleted the fix-perf-suspense-others branch April 10, 2025 15:02
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.

3 participants