✨ 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!
Note: 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
→BaseListTypeInfo
ItemRootValue
→BaseItem
ListInfo
→ListGraphQLTypes
TypesForList
→GraphQLTypesForList
FieldTypeFunc
now has a required type parameter which must satisfyBaseListTypeInfo
- The following types now have a required type parameter which must satisfy
BaseKeystoneTypeInfo
:ServerConfig
CreateRequestContext
AdminUIConfig
DatabaseConfig
ListOperationAccessControl
MaybeSessionFunction
MaybeItemFunction
GraphQLResolver
andGraphQLSchemaExtension
now have a required type parameter which must satisfyKeystoneContext
KeystoneGraphQLAPI
no longer has a type parameter- The first parameter to the resolver in a
virtual
field will be typed as the item type if the list is typed withKeystone.Lists
orKeystone.Lists.ListKey
, otherwise it will be typed asunknown
- The
item
/originalItem
arguments in hooks/access control will now receive theItem
type if the list is typed withKeystone.Lists
orKeystone.Lists.ListKey
, otherwise it will be typed asBaseItem
args
has been removed fromBaseListTypeInfo
inputs.orderBy
andall
has been added toBaseListTypeInfo
- In
.keystone/types
:ListKeyListTypeInfo
has been moved toLists.ListKey.TypeInfo
KeystoneContext
has 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!
Changelog
You can view the verbose changelog in the related PR (#7018) for this release.