Skip to content
New issue

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

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

Already on GitHub? # to your account

Version Packages (alpha) #12221

Open
wants to merge 1 commit into
base: release-4.0
Choose a base branch
from

Conversation

github-actions[bot]
Copy link
Contributor

@github-actions github-actions bot commented Dec 13, 2024

This PR was opened by the Changesets release GitHub action. When you're ready to do a release, you can merge this and publish to npm yourself or setup this action to publish automatically. If you're not ready to do a release yet, that's fine, whenever you add more changesets to release-4.0, this PR will be updated.

⚠️⚠️⚠️⚠️⚠️⚠️

release-4.0 is currently in pre mode so this branch has prereleases rather than normal releases. If you want to exit prereleases, run changeset pre exit on release-4.0.

⚠️⚠️⚠️⚠️⚠️⚠️

Releases

@apollo/client@4.0.0-alpha.0

Major Changes

  • #12222 d1a9054 Thanks @jerelmiller! - Drop support for React 16.

  • #12224 51e6c0f Thanks @jerelmiller! - Remove deprecated partialRefetch option.

  • #12211 c2736db Thanks @jerelmiller! - Remove the deprecated graphql, withQuery, withMutation, withSubscription, and withApollo hoc components. Use the provided React hooks instead.

  • #12262 10ef733 Thanks @jerelmiller! - Remove itAsync test utility.

  • #12304 86469a2 Thanks @jerelmiller! - The Cache.DiffResult<T> type is now a union type with better type safety for both complete and partial results. Checking diff.complete will now narrow the type of result depending on whether the value is true or false.

    When true, diff.result will be a non-null value equal to the T generic type. When false, diff.result now reports result as DeepPartial<T> | null indicating that fields in the result may be missing (DeepPartial<T>) or empty entirely (null).

  • #12254 0028ac0 Thanks @jerelmiller! - Changes the default Accept header to application/graphql-response+json.

  • #12333 3e4beaa Thanks @jerelmiller! - Fix type of data property on ApolloQueryResult. Previously this field was non-optional, non-null TData, however at runtime this value could be set to undefined. This field is now reported as TData | undefined.

    This will affect you in a handful of places:

    • The data property emitted from the result passed to the next callback from client.watchQuery
    • Fetch-based APIs that return an ApolloQueryResult type such as observableQuery.refetch, observableQuery.fetchMore, etc.
  • #12223 69c1cb6 Thanks @jerelmiller! - Remove subscribeAndCount testing utility from @apollo/client/testing.

  • #12300 4d581e4 Thanks @jerelmiller! - Moves all React-related exports to the @apollo/client/react entrypoint and out of the main @apollo/client entrypoint. This prevents the need to install React in order to use the core client.

    The following is a list of exports available in @apollo/client that should now import from @apollo/client/react.

    • ApolloConsumer
    • ApolloProvider
    • createQueryPreloader
    • getApolloContext
    • skipToken
    • useApolloClient
    • useBackgroundQuery
    • useFragment
    • useLazyQuery
    • useLoadableQuery
    • useMutation
    • useQuery
    • useQueryRefHandlers
    • useReactiveVar
    • useReadQuery
    • useSubscription
    • useSuspenseQuery

    The following is a list of exports available in @apollo/client/testing that should now import from @apollo/client/testing/react:

    • MockedProvider
  • #12304 86469a2 Thanks @jerelmiller! - ### Changes for users of InMemoryCache

    cache.diff now returns null instead of an empty object ({}) when returnPartialData is true and the result is empty.

    If you use cache.diff directly with returnPartialData: true, you will need to check for null before accessing any other fields on the result property. A non-null value indicates that at least one field was present in the cache for the given query document.

    Changes for third-party cache implementations

    The client now expects cache.diff to return null instead of an empty object when there is no data that can be fulfilled from the cache and returnPartialData is true. If your cache implementation returns an empty object, please update this to return null.

  • #12304 86469a2 Thanks @jerelmiller! - ### Changes for users of InMemoryCache

    cache.diff no longer throws when returnPartialData is set to false without a complete result. Instead, cache.diff will return null when it is unable to read a full cache result.

    If you use cache.diff directly with returnPartialData: false, remove the try/catch block and replace with a check for null.

    Changes for third-party cache implementations

    The client now expects cache.diff to return null instead of throwing when the cache returns an incomplete result and returnPartialData is false. The internal try/catch blocks have been removed around cache.diff. If your cache implementation throws for incomplete results, please update this to return null.

  • #12211 c2736db Thanks @jerelmiller! - Remove the deprecated Query, Mutation, and Subscription components. Use the provided React hooks instead.

Minor Changes

  • #12333 3e4beaa Thanks @jerelmiller! - Deprecate the partial flag on ApolloQueryResult and make it a non-optional property. Previously partial was only set conditionally if the result emitted was partial. This value is now available with all results that return an ApolloQueryResult.

Patch Changes

@svc-apollo-docs
Copy link

svc-apollo-docs commented Dec 13, 2024

⚠️ Docs preview not attached to branch

The preview was not built because the PR's base branch release-4.0 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: 0dfecffe816ff0a1cf037ba0

Copy link

netlify bot commented Dec 13, 2024

Deploy Preview for apollo-client-docs ready!

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

@apollogithubactionsbot apollogithubactionsbot bot force-pushed the changeset-release/release-4.0 branch from a43e71a to 0fa9848 Compare December 16, 2024 09:23
Copy link

pkg-pr-new bot commented Dec 16, 2024

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

commit: e5073ee

Copy link
Contributor Author

github-actions bot commented Dec 16, 2024

size-limit report 📦

Path Size
dist/apollo-client.min.cjs 33.48 KB (+0.02% 🔺)
import { ApolloClient, InMemoryCache, HttpLink } from "dist/main.cjs" 41.43 KB (+0.03% 🔺)
import { ApolloClient, InMemoryCache, HttpLink } from "dist/main.cjs" (production) 38.73 KB (+0.04% 🔺)
import { ApolloClient, InMemoryCache, HttpLink } from "dist/index.js" 36.15 KB (+0.02% 🔺)
import { ApolloClient, InMemoryCache, HttpLink } from "dist/index.js" (production) 33.56 KB (+0.02% 🔺)
import { ApolloProvider } from "dist/react/index.js" 1.26 KB (+0.39% 🔺)
import { ApolloProvider } from "dist/react/index.js" (production) 1.25 KB (+0.4% 🔺)
import { useQuery } from "dist/react/index.js" 5.14 KB (+0.12% 🔺)
import { useQuery } from "dist/react/index.js" (production) 4.23 KB (+0.12% 🔺)
import { useLazyQuery } from "dist/react/index.js" 5.63 KB (+0.09% 🔺)
import { useLazyQuery } from "dist/react/index.js" (production) 4.7 KB (+0.09% 🔺)
import { useMutation } from "dist/react/index.js" 3.63 KB (+0.14% 🔺)
import { useMutation } from "dist/react/index.js" (production) 2.85 KB (+0.11% 🔺)
import { useSubscription } from "dist/react/index.js" 4.44 KB (+0.14% 🔺)
import { useSubscription } from "dist/react/index.js" (production) 3.49 KB (+0.09% 🔺)
import { useSuspenseQuery } from "dist/react/index.js" 5.53 KB (+0.09% 🔺)
import { useSuspenseQuery } from "dist/react/index.js" (production) 4.18 KB (+0.12% 🔺)
import { useBackgroundQuery } from "dist/react/index.js" 5.01 KB (+0.08% 🔺)
import { useBackgroundQuery } from "dist/react/index.js" (production) 3.65 KB (+0.11% 🔺)
import { useLoadableQuery } from "dist/react/index.js" 5.08 KB (+0.12% 🔺)
import { useLoadableQuery } from "dist/react/index.js" (production) 3.73 KB (+0.06% 🔺)
import { useReadQuery } from "dist/react/index.js" 3.4 KB (+0.18% 🔺)
import { useReadQuery } from "dist/react/index.js" (production) 3.34 KB (+0.09% 🔺)
import { useFragment } from "dist/react/index.js" 2.01 KB (+0.15% 🔺)
import { useFragment } from "dist/react/index.js" (production) 1.96 KB (+0.15% 🔺)

@apollogithubactionsbot apollogithubactionsbot bot force-pushed the changeset-release/release-4.0 branch 2 times, most recently from 163864b to 913da8a Compare December 16, 2024 09:38
@apollogithubactionsbot apollogithubactionsbot bot force-pushed the changeset-release/release-4.0 branch 3 times, most recently from 1f0c587 to 07fa847 Compare January 13, 2025 20:18
@apollogithubactionsbot apollogithubactionsbot bot force-pushed the changeset-release/release-4.0 branch 6 times, most recently from e6906d2 to 5302881 Compare January 24, 2025 22:43
@apollogithubactionsbot apollogithubactionsbot bot force-pushed the changeset-release/release-4.0 branch 8 times, most recently from 3e1b8a9 to f0bd4c5 Compare January 31, 2025 17:30
@apollogithubactionsbot apollogithubactionsbot bot force-pushed the changeset-release/release-4.0 branch from f0bd4c5 to e5073ee Compare February 5, 2025 18:53
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant