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

Non-breaking React layer rewrite work #8419

Closed
hwillson opened this issue Jun 22, 2021 · 6 comments
Closed

Non-breaking React layer rewrite work #8419

hwillson opened this issue Jun 22, 2021 · 6 comments

Comments

@hwillson
Copy link
Member

hwillson commented Jun 22, 2021

We're going to publish the non-breaking React layer rewrite work as part of Apollo Client 3.6, so this issue will be used to track the non-breaking parts of apollographql/apollo-feature-requests#366. This will mostly cover:

  • React 18 based compatibility and enhancements
  • Ensuring better communication with the AC core (by making the React layer lighter weight)
  • Revamping our test suite (leveraging renderHook)
@hwillson hwillson added 2021-08 and removed 2021-07 labels Aug 3, 2021
@hwillson hwillson added this to the Release 3.5 milestone Aug 24, 2021
@hwillson hwillson added 2021-09 and removed 2021-08 labels Sep 7, 2021
@hwillson hwillson modified the milestones: Release 3.5, Release 3.6 Sep 13, 2021
@rajington
Copy link
Contributor

rajington commented Sep 24, 2021

from apollographql/apollo-feature-requests#366

To help get some of this work out sooner (especially React 18 compatibility changes), we're going to tackle the non-breaking parts of this work in Apollo Client 3.5. Progress will be tracked here: #8419

Would this include suspense support? If so, would the goal for these changes be sometime around React 18's (unannounced) release date?

Sorry to keep inquiring about this, but the (now deprecated) fork adding suspense is what keeps us on AC2 and we really don't have to revert our async handling updates. Thanks!

@hwillson hwillson added 2021-10 and removed 2021-09 labels Oct 5, 2021
@hwillson hwillson added 2021-11 and removed 2021-10 labels Nov 1, 2021
@ddiachkov
Copy link

We've just migrated one of our projects to React 18, and I've been working on adding Suspense support.

Here is my working PoC:
https://github.com/hired/apollo-query-resource (not a real package yet — I've just copy-pasted code from internal monorepo):

It looks like this:

const resource = useQueryResource(query, { variables });
resource.read(); // <-- suspends

The conclusion: Suspense and Apollo actually work great together (but only on experimental branch at a moment).

@hwillson
Copy link
Member Author

hwillson commented Apr 5, 2022

We're polishing up our React 18 support. We're aiming to have a new @apollo/client release candidate (for 3.6) with R18 support ready by the end of this week.

@joshlevinson
Copy link

@hwillson That's great to hear! To reiterate @rajington's question:

Would this include suspense support?

Does "our React 18 support" mean "basic compatibility with React 18" (i.e. one can update to React 18 and things won't immediately break) or "1st class support for Suspense as described in React 18's release announcement":

In React 18, you can start using Suspense for data fetching in opinionated frameworks like Relay, Next.js, Hydrogen, or Remix. Ad hoc data fetching with Suspense is technically possible, but still not recommended as a general strategy.

I understand if the answer is no, but across this issue and apollographql/apollo-feature-requests#366, folks are eager to get clarity from y'all on this!

@hwillson
Copy link
Member Author

React 18 support is now available in @apollo/client@next. Thanks!

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Feb 15, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

5 participants