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 a "memory management" documentation page #11415

Merged
merged 20 commits into from
Dec 20, 2023
Merged

Conversation

phryneas
Copy link
Member

@phryneas phryneas commented Dec 6, 2023

I still need to incorporate all the feedback on Docblock comments from #11408 into this one.

The page can be reviewed here: https://deploy-preview-11415--apollo-client-docs.netlify.app/caching/memory-management

Checklist:

  • If this PR contains changes to the library itself (not necessary for e.g. docs updates), please include a changeset (see CONTRIBUTING.md)
  • If this PR is a new feature, please reference an issue where a consensus about the design was reached (not necessary for small changes)
  • Make sure all of the significant new logic is covered by tests

Copy link

changeset-bot bot commented Dec 6, 2023

⚠️ No Changeset found

Latest commit: b4dfd1e

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 Dec 6, 2023

size-limit report 📦

Path Size
dist/apollo-client.min.cjs 38.22 KB (0%)
import { ApolloClient, InMemoryCache, HttpLink } from "dist/main.cjs" 46.01 KB (0%)
import { ApolloClient, InMemoryCache, HttpLink } from "dist/main.cjs" (production) 43.56 KB (0%)
import { ApolloClient, InMemoryCache, HttpLink } from "dist/index.js" 33.97 KB (0%)
import { ApolloClient, InMemoryCache, HttpLink } from "dist/index.js" (production) 31.9 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.39 KB (0%)
import { useSuspenseQuery } from "dist/react/index.js" 5.28 KB (0%)
import { useSuspenseQuery } from "dist/react/index.js" (production) 3.94 KB (0%)
import { useBackgroundQuery } from "dist/react/index.js" 4.75 KB (0%)
import { useBackgroundQuery } from "dist/react/index.js" (production) 3.39 KB (0%)
import { useLoadableQuery } from "dist/react/index.js" 4.98 KB (0%)
import { useLoadableQuery } from "dist/react/index.js" (production) 3.64 KB (0%)
import { useReadQuery } from "dist/react/index.js" 3.03 KB (0%)
import { useReadQuery } from "dist/react/index.js" (production) 2.97 KB (0%)
import { useFragment } from "dist/react/index.js" 2.1 KB (0%)
import { useFragment } from "dist/react/index.js" (production) 2.05 KB (0%)

@phryneas phryneas changed the base branch from pr/cache-sizes to main December 6, 2023 13:32
Copy link

netlify bot commented Dec 6, 2023

Deploy Preview for apollo-client-docs ready!

Name Link
🔨 Latest commit b4dfd1e
🔍 Latest deploy log https://app.netlify.com/sites/apollo-client-docs/deploys/65834e4e95715e0008fac814
😎 Deploy Preview https://deploy-preview-11415--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 December 15, 2023 09:52
@phryneas phryneas changed the base branch from release-3.9 to main December 15, 2023 16:52
@phryneas phryneas changed the base branch from main to release-3.9 December 15, 2023 16:53
);
const dist = path.resolve(__dirname, "../dist");
const entryPoints = map((entryPoint: { dirs: string[] }) => {
return `export * from "${dist}/${entryPoint.dirs.join("/")}/index.d.ts";`;
Copy link
Member Author

Choose a reason for hiding this comment

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

The CacheSizes interface is not part of the normal @apollo/client entrypoint, so until now that was not part of the DocModel. This change creates a DocModel for all entrypoints combined.

It also moves some logic out as code was getting a bit confusing when everything was inlined down in buildReport

@phryneas phryneas added this to the MemoryAnalysis milestone Dec 19, 2023
@phryneas phryneas marked this pull request as ready for review December 19, 2023 17:01
@phryneas phryneas requested a review from a team as a code owner December 19, 2023 17:01
@phryneas phryneas requested review from jerelmiller, alessbell and Meschreiber and removed request for a team December 19, 2023 17:02
@phryneas
Copy link
Member Author

@Meschreiber @alessbell @jerelmiller could I please get some feedback on this one? :)

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.

Beyond inline comments I would recommend removing the top H2 "Cache sizes" and bumping up all the subheader sizes (H3 -> H2, H4 -> H3).

"Cache sizes" applies to the entire document and should be mentioned in the page subtitle, and bumping up H4 -> H3 gives readers better visibility on the TOC.

docs/source/caching/memory-management.mdx Outdated Show resolved Hide resolved
docs/source/caching/memory-management.mdx Outdated Show resolved Hide resolved
docs/source/caching/memory-management.mdx Outdated Show resolved Hide resolved
docs/source/caching/memory-management.mdx Outdated Show resolved Hide resolved
docs/source/caching/memory-management.mdx Outdated Show resolved Hide resolved
src/core/ApolloClient.ts Outdated Show resolved Hide resolved
docs/source/caching/memory-management.mdx Show resolved Hide resolved
docs/source/caching/memory-management.mdx Outdated Show resolved Hide resolved
docs/source/caching/memory-management.mdx Show resolved Hide resolved
docs/source/caching/memory-management.mdx Show resolved Hide resolved
Co-authored-by: Maria Elisabeth Schreiber <[email protected]>
phryneas and others added 2 commits December 20, 2023 20:28
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.

Caught a few minor things that needed changed for correctness, otherwise looks great! If @Meschreiber is happy, so am I!

docs/source/caching/memory-management.mdx Show resolved Hide resolved
docs/source/caching/memory-management.mdx Outdated Show resolved Hide resolved
docs/source/caching/memory-management.mdx Outdated Show resolved Hide resolved
docs/source/caching/memory-management.mdx Outdated Show resolved Hide resolved
docs/source/caching/memory-management.mdx Outdated Show resolved Hide resolved
docs/source/caching/memory-management.mdx Outdated Show resolved Hide resolved
docs/source/caching/memory-management.mdx Outdated Show resolved Hide resolved
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.

Thanks for the additional copy suggestions, @jerelmiller ! I also agree with the recommendation around using the minVersion component in addition to the front matter so didn't commit that suggestion directly. I've added one more clarification, otherwise, LGTM!

docs/source/caching/memory-management.mdx Outdated Show resolved Hide resolved
@github-actions github-actions bot added the auto-cleanup 🤖 label Dec 20, 2023
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.

🎉 Awesome stuff!

@jerelmiller jerelmiller merged commit de5b878 into release-3.9 Dec 20, 2023
26 checks passed
@jerelmiller jerelmiller deleted the pr/cache-docs branch December 20, 2023 20:39
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Jan 20, 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.

3 participants