Release: 1st December 2021
This release marks the achievement of General Availability status for Keystone 6! 🚀
We’ve also included a range of improvements to Keystone’s TypeScript DX since shipping last week’s release candidate.
Keystone 6 ⚡️
With this major release, the project has moved to the @keystone-6 namespace on npm, and our version numbers have been reset.
We highly recommend you upgrade your existing Keystone Next projects to Keystone 6 with the packages below:
"@keystone-6/auth": "1.0.0","@keystone-6/cloudinary": "1.0.0","@keystone-6/document-renderer": "1.0.0","@keystone-6/fields-document": "1.0.0","@keystone-6/core": "1.0.0","@keystone-6/session-store-redis": "1.0.0",
Note: @keystone-next/keystone has been changed to @keystone-6/core
Among other internal naming changes, our CLI commands have switched from keystone-next to simply keystone, please ensure you update your startup scripts to suit!
To learn more about this major release and what’s in store for the road ahead, checkout our official general availability announcement and updated roadmap.
Type Enhancements ✨
We've shipped a significant update to our generated TypeScript types.
The types for your schema are stricter when your lists are contextually typed by the newly provided Lists types from .keystone/types.
This results in a smoother, type-safe auto-complete experience and stricter types for your access control, hooks, and any other code that uses a Keystone context.
For example, if you write all your lists in one object:
import { Lists } from '.keystone/types'export const lists: Lists = {Blah: list({...})}
If you're defining your lists separately, you can do this:
import { Lists } from '.keystone/types'export const Blah: Lists.Blah = list({...})
For a more in-depth view of what TypeScript types have been changed, see below:
- The following types have been renamed:
BaseGeneratedListTypes→BaseListTypeInfoItemRootValue→BaseItemListInfo→ListGraphQLTypesTypesForList→GraphQLTypesForListFieldTypeFuncnow has a required type parameter which must satisfyBaseListTypeInfo
- The following types now have a required type parameter which must satisfy
BaseKeystoneTypeInfo:ServerConfigCreateRequestContextAdminUIConfigDatabaseConfigListOperationAccessControlMaybeSessionFunctionMaybeItemFunction
GraphQLResolverandGraphQLSchemaExtensionnow have a required type parameter which must satisfyKeystoneContextKeystoneGraphQLAPIno longer has a type parameter- The first parameter to the resolver in a
virtualfield will be typed as the item type if the list is typed withKeystone.ListsorKeystone.Lists.ListKey, otherwise it will be typed asunknown - The
item/originalItemarguments in hooks/access control will now receive theItemtype if the list is typed withKeystone.ListsorKeystone.Lists.ListKey, otherwise it will be typed asBaseItem argshas been removed fromBaseListTypeInfoinputs.orderByandallhas been added toBaseListTypeInfo- In
.keystone/types:ListKeyListTypeInfohas been moved toLists.ListKey.TypeInfoKeystoneContexthas been renamed toContext
Credits 💫
This release would not have been possible without the support and feedback of such an awesome developer community.
We’re grateful for the ideas you bring, the help you give others, and the code contributions the you’ve made to get Keystone to where it is today.
Like this release? Give us a star on GitHub!
Complete Changelog 📜
You can also view the verbose release notes for this release on GitHub.