Skip to content

Releases: apollographql/apollo-client-nextjs

v.0.9.2: Fix support for streaming in Edge functions

03 Apr 08:29
Compare
Choose a tag to compare

This release adds the "edge-light" exports condition to support export const runtime = "edge".

v.0.9.1: bugfix release

27 Mar 15:55
Compare
Choose a tag to compare

This release fixes a bug where in case a simulated query had to rerun in the browser (e.g. when the stream closed too soon), documentTransforms were not applied to that browser-side query.

v.0.9.0: separate builds, no more need for special hook imports, new transport mechanism

22 Mar 10:26
c8eac3d
Compare
Choose a tag to compare

This version introduces four big changes:

  • The package is now split up into @apollo/client-react-streaming for non-Next-logic and @apollo/experimental-nextjs-app-support. This means that the streaming approach can also be used by other frameworks like Redwood or hand-written setups with renderTo*Stream.
    As a user of @apollo/experimental-nextjs-app-support you should not notice this.
  • The packages have a new bundle setup and ship different builds for RSC, SSR and the browser. This should result in reduced bundle sizes.
  • The data transport mechanism has been reworked and you should now see less data transported over the wire.
  • You now don't need to import hooks from @apollo/experimental-nextjs-app-support anymore - the hooks from @apollo/client will work as you'd expect them to.

This release requires you to update your Apollo Client version to at least 3.9.6!

What's Changed

  • Removing confusing installation language in README.md by @spenweb in #187
  • chore(deps): update yarn to v4.1.0 by @svc-secops in #190
  • separate transport-specific streaming logic out by @phryneas in #189
  • split up into two packages by @phryneas in #193
  • registerApolloClient: allow for async makeClient function by @phryneas in #204
  • 0.9.0 (1) - adjust package shapes by @phryneas in #208
  • 0.9.0 (2) - wrap hook functionality from ApolloClient instance by @phryneas in #216
  • 0.9.0 (3) - add integration test with experimentally patched React version by @phryneas in #219
  • 0.9.0 (4) - Add integration test for vitejs + streaming by @phryneas in #198
  • Use Relative-CI to detect size changes in the Next.js integration test build. by @phryneas in #225
  • update Apollo Client version to 3.9.6 by @phryneas in #236
  • 0.9.0 (7) - Changes to Data Transport by @phryneas in #223
  • add size-limit workflow by @phryneas in #241
  • 0.9.0 (8) documentation updates and "branded" error messages by @phryneas in #240
  • [chore] Update Docs by @github-actions in #243
  • Bump version to 0.9.0 by @github-actions in #247

New Contributors

  • @spenweb made their first contribution in #187
  • @github-actions made their first contribution in #243

Full Changelog: v.0.8.0...v.0.9.0

0.8.0: drop workarounds for compat with Apollo Client 3.8, bump dependency to 3.9

01 Feb 14:04
88dc5b9
Compare
Choose a tag to compare

This version drops the workarounds for this package to work with both AC 3.8 and 3.9 and bumps the minimum peerDependency version to 3.9.

0.7.1: update `peerDependencies` for Apollo Client 3.9

01 Feb 11:07
Compare
Choose a tag to compare

This release adds ^3.9.0 to the list of @apollo/client versions in peerDependencies.

0.7.0: important security fix

30 Jan 17:00
b92bc42
Compare
Choose a tag to compare

This version fixes CVE-2024-23841.
You can see more details in the security advisory.

There are no known workarounds for this issue, please update immediately.

0.6.0: reduced bundle size and "nonce" support

05 Jan 10:59
452ebc4
Compare
Choose a tag to compare

This release reduces the bundle size by changing an import from graphql. (#161)

It also adds support for a "nonce" in the script tags created by this package, by introducing a new extraScriptProps option. (#160)

Usage example:

    <ApolloNextAppProvider
      makeClient={makeClient}
      extraScriptProps={{
        nonce: actualNonce,
      }}
    >{...}</ApolloNextAppProvider>

As you should not pass a sensitive value like a nonce or a token as props from a Server Component into a Client Component, you can use the ssr-only-secrets we published for that purpose.

Generate a jwk-formatted AES-CBC key (see details in the linked package) and set it as an environment variable, e.g. "SECRET_KEY_VAR"

In a Server Component:

import { cloakSSROnlySecret } from "ssr-only-secrets";

const MyServerComponent = () => {
    const nonce = headers().get('x-nonce')
    return <ApolloWrapper nonce={cloakSSROnlySecret(nonce, "SECRET_KEY_VAR")} />
}

In your ApolloWrapper:

export function ApolloWrapper({
  children,
  nonce,
}: React.PropsWithChildren<{ nonce?: string }>) {

  // other code, e.g. `makeClient`

  const actualNonce = useSSROnlySecret(nonce, "SECRET_KEY_VAR");
  return (
    <ApolloNextAppProvider
      makeClient={makeClient}
      extraScriptProps={{
        nonce: actualNonce,
      }}
    >
      {children}
    </ApolloNextAppProvider>
  );
}

0.5.2: Prepare for changes in upcoming Apollo Client 3.9 pre-release versions

01 Dec 09:32
edc6fcb
Compare
Choose a tag to compare

Upcoming pre-release versions of Apollo Client 3.9 contain a change to an internal data structure that is used by this package. (See apollographql/apollo-client#11345 )

This release prepares for that change and ensures backwards compatibility with Apollo Client 3.8 as well as the upcoming 3.9 versions.

What's Changed

  • prepare for change in QueryManager.inFlightLinkObservable (Apollo Client 3.9 beta) by @phryneas in #144

Full Changelog: v.0.5.1...v0.5.2

0.5.1: Allow usage with Apollo Client 3.9 alphas

02 Nov 10:16
Compare
Choose a tag to compare

This release changes the peerDependencies so the package can be used with our Apollo Client 3.9 alphas, betas and release candidates.

0.5.0: NextJs 14

30 Oct 10:16
bce6905
Compare
Choose a tag to compare

This release adds Next.js 14 as a valid peerDependency.