v4.0.0-alpha.1
版本发布时间: 2019-12-04 23:08:30
vuejs/apollo最新发布版本:v4.2.1(2024-08-23 17:42:42)
V4 Alpha is now live! It is full packed with changes, most notably an entirely new API based on the new Vue Composition API. This releases prepares the future full v4 release which will be streamlined and lighter.
Although the alpha is already quite extensively tested, it is not recommended to use it in production just yet. We will do our best to have the least number of breaking changes during the development cycle, but it can still happen until the beta when the API will be stable.
Documentation preview lives here: https://v4.apollo.vuejs.org/
BREAKING CHANGES
- Packages are now split:
-
@vue/apollo-option
: Classic Option API -
@vue/apollo-components
: Apollo Components such as<ApolloQuery>
-
@vue/apollo-composable
(NEW): Composition API -
@vue/apollo-ssr
: SSR utils -
@vue/apollo-util
(NEW): Apollo-related utils (such as error formatter)
-
- This also means setup have changed, you need to update your imports
- If you want to register the Apollo Components globally, you can enable the components plugin alongside the Classic one:
import VueApolloOption from '@vue/apollo-option'
import VueApolloComponents from '@vue/apollo-components'
Vue.use(VueApolloOption)
Vue.use(VueApolloComponents)
- The SSR utility functions now accept an object of ApolloClient instead of an ApolloProvider (which is deprecated).
Before:
ApolloSSR.getStates(apolloProvider)
After:
ApolloSSR.getStates({
defaultClient: apolloClient
})
Or:
ApolloSSR.getStates(apolloProvider.clients)
New
- New API based on Vue Composition API (docs).