-
Notifications
You must be signed in to change notification settings - Fork 2.7k
introduce a versioning policy for Apollo Client #12850
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
Merged
Merged
Changes from all commits
Commits
Show all changes
9 commits
Select commit
Hold shift + click to select a range
2c4fe60
introduce a versioning policy for Apollo Client
phryneas cc8fabd
changeset
phryneas 5bb02d2
Apply suggestions from code review
phryneas cecd694
add TS note
phryneas 1693af7
peer dependency section
phryneas c8ede6f
rename `VERSIONING.md` to `VERSIONING_POLICY.md`
phryneas 5283e48
add to sidebar
phryneas 1eca8c8
move changelog down
phryneas 575cc23
Merge branch 'release-4.0' into pr/versioning-policy
phryneas File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,5 @@ | ||
| --- | ||
| "@apollo/client": major | ||
| --- | ||
|
|
||
| Introduce a versioning policy. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,93 @@ | ||
| # Apollo Client Versioning Policy | ||
|
|
||
| Apollo Client tries to follow SemVer versioning. | ||
|
|
||
| However, we reserve the right to change transpilation targets, drop polyfills or update required dependencies. These changes will be released in minor versions. | ||
| This is to ensure that Apollo Client can take advantage of the latest JavaScript features, performance improvements, and security fixes. | ||
|
|
||
| This document outlines the versioning strategy for Apollo Client's dependencies. | ||
|
|
||
| ## Syntax transpilation target | ||
|
|
||
| The current transpilation target for Apollo Client is `@babel/preset-env` with the `browserlist` target `since 2023, node >= 20, not dead`. | ||
|
|
||
| That means Apollo Client supports the following environments and their derivatives: | ||
|
|
||
| | Environment | Version | | ||
| | ---------------- | ------- | | ||
| | Chrome | 97+ | | ||
| | Firefox | 96+ | | ||
| | Edge | 97+ | | ||
| | Safari | 15.4+ | | ||
| | Opera | 83+ | | ||
| | Samsung Internet | 17+ | | ||
| | Node.js | 20+ | | ||
|
|
||
| Using Apollo Client in different environments may require you to transpile the syntax using a lower version, or polyfilling missing APIs. | ||
|
|
||
| We reserve the right to update the transpilation target in minor releases, but we commit to always include at least two years of browser support and the officially supported Node.js versions in the target. | ||
|
|
||
| ## Language features | ||
|
|
||
| Apollo Client might start using new APIs and language features that are considered ["Baseline: Widely available"](https://developer.mozilla.org/en-US/docs/Glossary/Baseline/Compatibility) by MDN. Usage of new language features will be released in a new minor version. | ||
|
|
||
| ### Non-polyfillable, non-transpilable language features | ||
|
|
||
| We try to avoid new features that cannot be transpiled or polyfilled. | ||
|
|
||
| However, we consider the following features to be supported widely enough that Apollo Client can use them at any time without considering it a major breaking change. | ||
|
|
||
| - [`WeakMap`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/WeakMap) (already used in Apollo Client) | ||
| - [`WeakSet`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/WeakSet) (already used in Apollo Client) | ||
| - [`WeakRef`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/WeakRef) (already used by dependencies) | ||
| - [`FinalizationRegistry`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/FinalizationRegistry) (already used by dependencies) | ||
| - [`Proxy`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Proxy) | ||
|
|
||
| > [!NOTE] | ||
| > Not all of the these features are currently used at this time. Usage of these features might fluctuate between minor versions. | ||
|
|
||
| ## TypeScript types | ||
|
|
||
| We reserve the right to update TypeScript types as needed, such as to fix bugs, align types with actual runtime behavior or add compatibility with changes in upcoming TypeScript versions. | ||
| Updates to types might requires changes to your application, and while we are careful to keep such changes to a minimum, we do not consider these breaking changes in the sense of SemVer. | ||
|
|
||
| ## Dependencies | ||
|
|
||
| ### TypeScript | ||
|
|
||
| We make an effort to only use TypeScript features that have been available as stable for at least one year. This generally means we support the [last four minor versions](https://github.com/microsoft/TypeScript/wiki/TypeScript%27s-Release-Process#how-often-does-typescript-release) of TypeScript. If you use a TypeScript version older than these, you might experience some type compatibility issues with Apollo Client. | ||
|
|
||
| > Note that this is a shorter support window than [DefinitelyTyped](https://github.com/DefinitelyTyped/DefinitelyTyped#support-window). | ||
|
|
||
| However, we reserve the right to use newer syntax in new features, in a way that doesn't break compilation with older TypeScript versions. These new features might not be available to consumers on older TypeScript versions. | ||
|
|
||
| ### React | ||
|
|
||
| We aim to support, at minimum, the latest two major versions of React. | ||
| Some Apollo Client features might require the latest major version of React and won't be available to consumers on older React versions (e.g. `useSuspenseQuery` which relies on React Suspense). | ||
|
|
||
| We will note when such a case occurs so that you understand when a feature requires a specific React version. | ||
|
|
||
| > Please note that the React team almost never backports bugfixes to older major versions. From time to time, you might encounter bugs when using Apollo Client caused by React itself that are fixed in recent React versions, but are unavailable in older major versions. We strongly recommend you keep up-to-date with the latest React version. | ||
|
|
||
| ### React Native | ||
|
|
||
| We try to support, at minimum, the latest version of React Native. Note that React Native relies on many polyfills that might differ from the implementations of other platforms. Some polyfills might also be missing. | ||
|
|
||
| Where possible, we try to avoid using APIs that are not available in React Native. | ||
| If an API is not available, we will try to provide workarounds using the [`react-native` exports condition](https://reactnative.dev/blog/2023/06/21/package-exports-support#the-new-react-native-condition). | ||
|
|
||
| ### The `graphql` package | ||
|
|
||
| We commit to supporting the latest major version of the `graphql` package, with a grace period of at least one year before we drop support for older versions. | ||
|
|
||
| Within a `graphql` major, we only guarantee compatibility with the latest minor version. We strongly encourage consumers to regularly update the `graphql` package to get the latest bugfixes and features. | ||
|
|
||
| ### Other dependencies | ||
|
|
||
| We reserve the right to update dependencies in minor releases of Apollo Client, as well as dropping support for older versions of dependencies. | ||
|
|
||
| ### Peer dependencies | ||
|
|
||
| The rules stated above apply to peer dependencies as well. Peer dependencies can be updated in minor releases, just like regular dependencies. | ||
| However, we do commit to not adding new peer depenencies during the lifetime of a major - but if an existing peer dependency is renamed, we might follow that rename in a minor release. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
see https://docs.npmjs.com/cli/v11/configuring-npm/package-json#files
