Add React deferred fragment suspense#3888
Draft
JoviDeCroock wants to merge 6 commits into
Draft
Conversation
🦋 Changeset detectedLatest commit: eea0f1c The changes in this PR will be included in the next version bump. This PR includes changesets to release 3 packages
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
Deploying urql with
|
| Latest commit: |
eea0f1c
|
| Status: | ✅ Deploy successful! |
| Preview URL: | https://5248001f.urql.pages.dev |
| Branch Preview URL: | https://codex-react-defer-suspense-p.urql.pages.dev |
a8bb560 to
6f85ec3
Compare
6f85ec3 to
1e98de5
Compare
Move the framework-agnostic fragment-masking and deferred-fragment logic behind React's BETA useFragment hook into @urql/core so other bindings can reuse it, and add a BETA useFragment hook to @urql/preact built on it. - @urql/core: new BETA exports maskFragment, updateDeferredResult, makeDeferredState, resolveDeferredState, isDeferredPromise, getDeferredCacheForClient + the generic makeCache factory and selection AST helpers. The operations$ subscription only attaches when a binding requests a cache, so core stays side-effect-free at import. - urql (React): consume the moved helpers from @urql/core; delete the local selection.ts/defer.ts; reduce cache.ts to thin makeCache wrappers. No behaviour change. - @urql/preact: new BETA useFragment hook mirroring React, with updateDeferredResult wired into the suspense query stream. Adds core unit tests for selection/defer/maskFragment and Preact useFragment tests. Existing react-urql useFragment tests pass unchanged. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.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.
Summary
useFragmenthook for masking fragment data@deferselections inuseQueryRefs #3628.