v4.0.0-alpha.1
Breaking Changes📦 apollo-client
⚠ 2 breaking✨ 2 features🔧 3 symbols
Summary
Apollo Client removes legacy streaming workarounds and several polyfills, adds a react-server entry point, and drops the rehackt dependency, resulting in a smaller bundle but requiring updated fetch implementations and React Native versions.
⚠️ Breaking Changes
- Support for fetch implementations that return Node Streams, Async Iterators, or Blob instances as Response.body has been removed. Switch to a WhatWG-compliant fetch (e.g., native node fetch or undici) to avoid runtime errors.
- Polyfills for Object.freeze, Object.seal and Object.preventExtensions have been removed for React Native. Projects still using React Native versions older than 0.61 may encounter errors and should upgrade RN or re-introduce polyfills.
Migration Steps
- Replace any custom fetch polyfills that return Node Streams, Async Iterators, or Blob instances with a WhatWG-compliant fetch implementation such as the built-in fetch in Node 18+ or the undici package.
- If your project runs on React Native, ensure you are using version 0.61 or newer; otherwise, re-add the Object.freeze/seal/preventExtensions polyfills.
- Remove imports of rehackt and import needed symbols directly from react.
✨ New Features
- Added a react-server entry point with stubbed exports to enable compatibility with React Server Components.
- Dropped the rehackt dependency, allowing direct imports from react without build errors in RSC.
🔧 Affected Symbols
fetchResponseBodyHandlerreact-server entry point (index.server.js)rehackt