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

move hook documentation (and others) into code, improve documentation components #11381

Merged
merged 69 commits into from
Jan 24, 2024

Conversation

phryneas
Copy link
Member

@phryneas phryneas commented Nov 22, 2023

PR scope & features:

FunctionDetails ParameterTable PropertySignatureTable EnumDetails PropertyDetails
@deprecated
@since
@returns

@alpha, @beta, @experimental are technically possible, but are not implemented in any UI components

Link changes

Hashes for links now change, so instead of

  • hooks#uselazyquery
    • hooks#params-1 (useQuery parameters are hooks#params, useMutation parameters are hooks#params-2)
      • hooks#client (actually points up to useQuery, not useLazyQuery

They now look like

  • hooks#uselazyquery
    • hooks#uselazyquery-parameters
      • hooks#uselazyquery-parameters-options-client

migrated hooks

  • migrate hooks.mdx
    • useApolloClient
    • useQuery
    • useLazyQuery
    • useMutation
    • useSubscription
    • useReactiveVar
    • useFragment (out of scope)
    • useSuspenseQuery (out of scope)
    • useBackgroundQuery (out of scope)
    • useReadQuery (out of scope)
  • double-check all links

Inlined files into comments:

  • docs/shared/document-transform-options.mdx
  • docs/shared/mutation-options.mdx
  • docs/shared/mutation-result.mdx
  • docs/shared/query-options.mdx
  • docs/shared/query-result.mdx
  • docs/shared/subscription-options.mdx
  • docs/shared/subscription-result.mdx
  • docs/shared/useSuspenseQuery-options.mdx

Features added in Docs ( see sibling PR apollographql/docs#713 ):

  • enum support
  • @since tag
  • @returns tag
  • fix interface inheritance
  • prerender comment markdown during build
  • exposes some components to MDX
  • support for @docGroup tag
  • preparations for @alpha, @beta and @experimental tags (not used over in AC yet)
  • scrollMarginTop for p tags (since not all anchors/ids are h6 anymore now)
  • uncollapse <details> tags if a hash navigates to one of their children

DiffSite

For reviewing this PR, a side-by-side view might be useful - try this:

DiffSite

Impacted pages:

Copy link

changeset-bot bot commented Nov 22, 2023

⚠️ No Changeset found

Latest commit: 81eab92

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

Copy link
Contributor

github-actions bot commented Nov 22, 2023

size-limit report 📦

Path Size
dist/apollo-client.min.cjs 38.24 KB (0%)
import { ApolloClient, InMemoryCache, HttpLink } from "dist/main.cjs" 46.04 KB (0%)
import { ApolloClient, InMemoryCache, HttpLink } from "dist/main.cjs" (production) 43.59 KB (0%)
import { ApolloClient, InMemoryCache, HttpLink } from "dist/index.js" 33.96 KB (0%)
import { ApolloClient, InMemoryCache, HttpLink } from "dist/index.js" (production) 31.89 KB (0%)
import { ApolloProvider } from "dist/react/index.js" 1.24 KB (0%)
import { ApolloProvider } from "dist/react/index.js" (production) 1.22 KB (0%)
import { useQuery } from "dist/react/index.js" 5.2 KB (0%)
import { useQuery } from "dist/react/index.js" (production) 4.27 KB (0%)
import { useLazyQuery } from "dist/react/index.js" 5.51 KB (0%)
import { useLazyQuery } from "dist/react/index.js" (production) 4.58 KB (0%)
import { useMutation } from "dist/react/index.js" 3.51 KB (0%)
import { useMutation } from "dist/react/index.js" (production) 2.73 KB (0%)
import { useSubscription } from "dist/react/index.js" 3.19 KB (0%)
import { useSubscription } from "dist/react/index.js" (production) 2.38 KB (0%)
import { useSuspenseQuery } from "dist/react/index.js" 5.29 KB (0%)
import { useSuspenseQuery } from "dist/react/index.js" (production) 3.94 KB (0%)
import { useBackgroundQuery } from "dist/react/index.js" 4.76 KB (0%)
import { useBackgroundQuery } from "dist/react/index.js" (production) 3.4 KB (0%)
import { useLoadableQuery } from "dist/react/index.js" 4.97 KB (0%)
import { useLoadableQuery } from "dist/react/index.js" (production) 3.63 KB (0%)
import { useReadQuery } from "dist/react/index.js" 3.04 KB (0%)
import { useReadQuery } from "dist/react/index.js" (production) 2.98 KB (0%)
import { useFragment } from "dist/react/index.js" 2.19 KB (0%)
import { useFragment } from "dist/react/index.js" (production) 2.13 KB (0%)

Copy link

netlify bot commented Nov 27, 2023

Deploy Preview for apollo-client-docs ready!

Name Link
🔨 Latest commit c2c11f0
🔍 Latest deploy log https://app.netlify.com/sites/apollo-client-docs/deploys/65afaeae712b7d000874aea6
😎 Deploy Preview https://deploy-preview-11381--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.

@phryneas phryneas changed the base branch from main to release-3.9 January 11, 2024 09:59
@phryneas phryneas changed the title move some docs to comments move hook documentation (and others) into code Jan 12, 2024
@phryneas phryneas changed the title move hook documentation (and others) into code move hook documentation (and others) into code, improve documentation components Jan 12, 2024
@phryneas phryneas requested a review from a team as a code owner January 18, 2024 18:37
@jerelmiller jerelmiller mentioned this pull request Jan 18, 2024
only show parameters section if there are parameters
only show results if result is not `void` or user-specified
Copy link
Member

@jerelmiller jerelmiller left a comment

Choose a reason for hiding this comment

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

Lots of really great stuff in here! Sorry for all the noise. Hope my comments are useful!

docs/shared/ApiDoc/DocBlock.js Outdated Show resolved Hide resolved
docs/shared/ApiDoc/EnumDetails.js Outdated Show resolved Hide resolved
docs/shared/ApiDoc/EnumDetails.js Outdated Show resolved Hide resolved
docs/shared/ApiDoc/EnumDetails.js Outdated Show resolved Hide resolved
docs/shared/ApiDoc/EnumDetails.js Outdated Show resolved Hide resolved
src/core/types.ts Outdated Show resolved Hide resolved
src/core/ObservableQuery.ts Show resolved Hide resolved
@@ -13,7 +13,7 @@
npm run docmodel
cd ../
rm -rf monodocs
git clone https://github.com/apollographql/docs --branch main --single-branch monodocs
git clone https://github.com/apollographql/docs --branch pr/apidoc-enums-since --single-branch monodocs
Copy link
Member

Choose a reason for hiding this comment

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

Reminder to update this at some point 🙂

Copy link
Member Author

Choose a reason for hiding this comment

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

Yup. We will need to merge this branch, then merge the docs PR and then update main :)

docs/source/api/core/ObservableQuery.mdx Show resolved Hide resolved
docs/shared/ApiDoc/Heading.js Outdated Show resolved Hide resolved
docs/source/api/core/ObservableQuery.mdx Outdated Show resolved Hide resolved
docs/shared/ApiDoc/DocBlock.js Outdated Show resolved Hide resolved
docs/shared/ApiDoc/DocBlock.js Outdated Show resolved Hide resolved
docs/shared/ApiDoc/EnumDetails.js Outdated Show resolved Hide resolved
docs/shared/ApiDoc/EnumDetails.js Outdated Show resolved Hide resolved
@@ -13,7 +13,7 @@
npm run docmodel
cd ../
rm -rf monodocs
git clone https://github.com/apollographql/docs --branch main --single-branch monodocs
git clone https://github.com/apollographql/docs --branch pr/apidoc-enums-since --single-branch monodocs
Copy link
Member Author

Choose a reason for hiding this comment

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

Yup. We will need to merge this branch, then merge the docs PR and then update main :)

src/react/types/types.ts Outdated Show resolved Hide resolved
src/react/hooks/useMutation.ts Outdated Show resolved Hide resolved
src/react/types/types.documentation.ts Outdated Show resolved Hide resolved
src/core/types.ts Outdated Show resolved Hide resolved
Copy link
Member

@jerelmiller jerelmiller left a comment

Choose a reason for hiding this comment

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

Chatted in person and am happy with the current results. 🚢 it!

@github-actions github-actions bot added the auto-cleanup 🤖 label Jan 24, 2024
@phryneas phryneas merged commit 2a67ffc into release-3.9 Jan 24, 2024
33 checks passed
@phryneas phryneas deleted the pr/migrate-docs-to-docblocks-1 branch January 24, 2024 17:25
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Feb 24, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants