
"One of the headline changes is support for opt-in feature inclusion. Features like local state management (@client directives) and the default HTTP link are no longer bundled unless explicitly imported. Combined with modern target transpilation (for browsers since ~2023 and Node.js 20+), better ESM support, and improved tree-shaking, many users should see a 20-30% reduction in the bundle size contribution from Apollo Client."
"On the TypeScript front, 4.0 introduces colocated/namespace types (e.g. useQuery.Options and useQuery.Result), stricter enforcement of required variables, a new dataState property to distinguish query states (empty, partial, streaming, complete), and module-augmentation for customizing context types instead of using fragile generics. These changes aim to reduce type errors and improve discoverability of types during everyday use. In addition, error handling has been improved."
Apollo Client 4.0 introduces a leaner, modular architecture that makes features opt-in so local state management and the default HTTP link are only included when explicitly imported. Modern target transpilation (recent browsers and Node.js 20+), improved ESM support, and better tree-shaking typically reduce bundle contribution by 20–30%. TypeScript improvements include colocated/namespace types, stricter required-variable checks, a dataState property for query statuses, and module-augmentation for context types. Error handling has been decomposed into specific classes with static .is() checks. Core client logic is separated from React into @apollo/client/react for framework-agnostic use.
Read at InfoQ
Unable to calculate read time
Collection
[
|
...
]