Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add documentation for useSuspenseFragment #12356

Merged
merged 5 commits into from
Feb 11, 2025

Conversation

jerelmiller
Copy link
Member

Adds some documentation for the new useSuspenseFragment hook to the Fragments page.

@jerelmiller jerelmiller requested a review from a team as a code owner February 7, 2025 19:59
Copy link

changeset-bot bot commented Feb 7, 2025

⚠️ No Changeset found

Latest commit: 2af31d0

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

@svc-apollo-docs
Copy link

svc-apollo-docs commented Feb 7, 2025

⚠️ Docs preview not attached to branch

The preview was not built because the PR's base branch release-3.13 is not in the list of sources.

An Apollo team member can comment one of the following commands to dictate which branch to attach the preview to:

  • !docs set-base-branch version-2.6
  • !docs set-base-branch main

Build ID: e9d916cf98daa63579a79fb0

@jerelmiller
Copy link
Member Author

!docs set-base-branch release-3.13

Copy link

pkg-pr-new bot commented Feb 7, 2025

npm i https://pkg.pr.new/@apollo/client@12356

commit: 2af31d0

@@ -561,7 +561,7 @@ function Item(props: { item: { __typename: 'Item', id: number }}) {
const { complete, data } = useFragment({
fragment: ItemFragment,
fragmentName: "ItemFragment",
from: item
from: props.item
Copy link
Member Author

Choose a reason for hiding this comment

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

Noticed this typo when reading through so I went ahead and fixed this.

Copy link
Contributor

github-actions bot commented Feb 7, 2025

size-limit report 📦

Path Size
dist/apollo-client.min.cjs 41.25 KB (0%)
import { ApolloClient, InMemoryCache, HttpLink } from "dist/main.cjs" 50.7 KB (0%)
import { ApolloClient, InMemoryCache, HttpLink } from "dist/main.cjs" (production) 47.77 KB (0%)
import { ApolloClient, InMemoryCache, HttpLink } from "dist/index.js" 36.25 KB (0%)
import { ApolloClient, InMemoryCache, HttpLink } from "dist/index.js" (production) 33.64 KB (0%)
import { ApolloProvider } from "dist/react/index.js" 1.26 KB (0%)
import { ApolloProvider } from "dist/react/index.js" (production) 1.24 KB (0%)
import { useQuery } from "dist/react/index.js" 5.21 KB (0%)
import { useQuery } from "dist/react/index.js" (production) 4.3 KB (0%)
import { useLazyQuery } from "dist/react/index.js" 5.71 KB (0%)
import { useLazyQuery } from "dist/react/index.js" (production) 4.78 KB (0%)
import { useMutation } from "dist/react/index.js" 3.62 KB (0%)
import { useMutation } from "dist/react/index.js" (production) 2.84 KB (0%)
import { useSubscription } from "dist/react/index.js" 4.43 KB (0%)
import { useSubscription } from "dist/react/index.js" (production) 3.48 KB (0%)
import { useSuspenseQuery } from "dist/react/index.js" 5.88 KB (0%)
import { useSuspenseQuery } from "dist/react/index.js" (production) 4.54 KB (0%)
import { useBackgroundQuery } from "dist/react/index.js" 5.37 KB (0%)
import { useBackgroundQuery } from "dist/react/index.js" (production) 4.04 KB (0%)
import { useLoadableQuery } from "dist/react/index.js" 5.46 KB (0%)
import { useLoadableQuery } from "dist/react/index.js" (production) 4.11 KB (0%)
import { useReadQuery } from "dist/react/index.js" 3.42 KB (0%)
import { useReadQuery } from "dist/react/index.js" (production) 3.37 KB (0%)
import { useFragment } from "dist/react/index.js" 2.37 KB (0%)
import { useFragment } from "dist/react/index.js" (production) 2.32 KB (0%)

Copy link

netlify bot commented Feb 7, 2025

Deploy Preview for apollo-client-docs ready!

Name Link
🔨 Latest commit 2af31d0
🔍 Latest deploy log https://app.netlify.com/sites/apollo-client-docs/deploys/67ab7e7fe674d900084b9c68
😎 Deploy Preview https://deploy-preview-12356--apollo-client-docs.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.


Our list will now render as soon as our list returns but before the data for `ItemFragment` is loaded.

<Caution>
Copy link
Member Author

Choose a reason for hiding this comment

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

I know we are trying to use <Caution> sparingly, but this one seemed like a good use of it. If you don't abide by this rule then you will have a forever-suspending component which might frustrate you. I'm welcome to other ideas if this still doesn't pass the bar.

Copy link
Contributor

Choose a reason for hiding this comment

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

Agreed, definitely something worth cautioning!

Copy link
Member

@phryneas phryneas left a comment

Choose a reason for hiding this comment

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

This reads good to me :)

@github-actions github-actions bot added the auto-cleanup 🤖 label Feb 10, 2025
Copy link
Contributor

@Meschreiber Meschreiber left a comment

Choose a reason for hiding this comment

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

LGTM! Just a couple of teeny nits of style/clarity.


Our list will now render as soon as our list returns but before the data for `ItemFragment` is loaded.

<Caution>
Copy link
Contributor

Choose a reason for hiding this comment

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

Agreed, definitely something worth cautioning!

Co-authored-by: Maria Elisabeth Schreiber <[email protected]>
@jerelmiller jerelmiller merged commit 27e1532 into release-3.13 Feb 11, 2025
45 checks passed
@jerelmiller jerelmiller deleted the jerel/use-suspense-fragment-docs branch February 11, 2025 17:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants