The superpowered headless CMS for Node.js β built with GraphQL and React
MIT License
Bot releases are visible (Hide)
Published by dcousens almost 2 years ago
The following packages have been updated
@keystone-6/[email protected]
[core]
Fixes access.filter.*
passing listKey: undefined
(#8122) @dcousensPublished by dcousens almost 2 years ago
The following packages have been updated
@keystone-6/[email protected]
[core]
Fix http
server not binding to ::
by default (regression introduced by #8078) (#8105) @dcousensPublished by dcousens almost 2 years ago
The following packages have been updated
@keystone-6/[email protected]
[core]
Fixes ui.displayMode
in the relationship
field incorrectly defaulting to count
instead of select
(#8099) @emmatownPublished by dcousens almost 2 years ago
The following packages have been updated
@keystone-6/[email protected]
@keystone-6/[email protected]
@keystone-6/[email protected]
@keystone-6/[email protected]
@keystone-6/[email protected]
[core]
Adds a new group
function for grouping fields in the Admin UI (#8088) @emmatown[core]
Adds ui.searchFields
for the relationship field (#8074) @dcousens[core]
Adds fieldPosition
to field ui.itemView
, for moving a field to the sidebar (#8075) @borisno2[core]
Adds context.withRequest
, a method to derive an updated context from an incoming request and response (#8013) @borisno2[core]
Fix the startup message to use the configured http.options
host instead of assuming localhost
(#8078) @u-ishii[core, fields-document]
Fix relationship fields not using their ui.labelField
configuration (#8049) @georgekrax[auth, cloudinary, core, document-renderer, fields-document]
Adds exports
field to package.json
(#8054) @emmatownThanks to the following developers for making their first contributions to the project!
Lastly, thanks to @keystonejs-release-bot (#8064,#8064,#8064) for changes not shown above, but none-the-less appreciated.
Published by dcousens almost 2 years ago
The following packages have been updated
@keystone-6/[email protected]
@keystone-6/[email protected]
[core]
Improves performance of querying to-one relationships (#8000) @mitchellhamilton[core]
Fixes in
and not_in
filter views for integer
, bigInt
, decimal
and float
fields (#7930) @nya1[core]
Fixes issue where the custom field view controller
was not being used. You should be able to override field controller
when setting ui.views
parameter in fields. (#8034) @gautamsi[core]
Fixes changes to session
/ui.publicPages
/ui.isValidSession
/ui.pageMiddleware
not being updated in live reloads (#8038) @mitchellhamilton[core]
Fixes platform configuration for esbuild (#8031) @mmachatschek[fields-document]
Fixes selection for component blocks without child fields (#8021) @mitchellhamiltonThanks to the following developers for making their first contributions to the project!
Lastly, thanks to @mitchellhamilton (#8063,#8059,#8027), @renovate (#8056,#8055,#8053,#8045,#8041,#8036,#7974), @flexdinesh (#8060,#8039,#8048), @bladey (#8057), @dcousens (#8026) for changes not shown above, but none-the-less appreciated.
Published by dcousens about 2 years ago
The following packages have been updated
@keystone-6/[email protected]
[core]
Fixes the inputData field type for FieldCreateItemAccessArgs (#8017) @acburdineLastly, thanks to @dcousens (#8016) for changes not shown above, but none-the-less appreciated.
Published by dcousens about 2 years ago
The following packages have been updated
@keystone-6/[email protected]
@keystone-6/[email protected]
@keystone-6/[email protected]
@keystone-6/[email protected]
[core]
Changes access-control error messages to only show the list key and operation (#7914) @dcousens[core]
Replaces @keystone-6/core/testing
exports with { resetDatabase }
, for a context
use getContext
instead (#7968) @mitchellhamilton[core]
Removes @keystone-6/core/artifacts
from our exports (#7972) @mitchellhamilton[core]
Removes disconnect
from SessionStrategy
(#7971) @mitchellhamilton[core]
Removes isLiveReload
flag from createSystem
(#7969) @mitchellhamilton[core]
Removes the @graphql-tools/schema
wrapping functions graphQLSchemaExtension
and gql
. Developers should import @graphql-tools/schema
themselves, or use graphql
(as exported by @keystone-6/core
). (#7943) @borisno2[core]
Removes filters
export from @keystone-6/core/types
(#7919) @mitchellhamilton[core]
Removes experimental.generateNodeAPI
, use getContext
instead (#7957) @dcousens[core]
db.onConnect
is now called with an unprivileged context, not sudo. Use context.sudo()
if you need to bypass access control (#7955) @dcousens[core]
Removes the parameters for getAdminMeta
when writing field types, and the respective types AdminMetaRootVal
, ListMetaRootVal
and FieldMetaRootVal
therein. (#7913) @mitchellhamilton[core]
Removes createSessionContext
export from @keystone-6/core/session
(#7912) @mitchellhamilton[core]
Changes default Apollo Server configuration to use cache: "bounded"
and persistedQueries: false
(#7888) @mitchellhamilton[core]
Changes .access
control on list
to required, with new allowAll
and denyAll
functions for easy shorthand. (#7848) @Noviny[core]
Upgrade to graphql@16
(#7817) @mitchellhamilton[core]
Changes field .views
module resolution, from a path, to a module path that is resolved from where keystone start
is run (#7805) @mitchellhamilton[core]
Changes the return type for the resolveInput
hook with json
fields. Previously you may have used 'DbNull'
or 'JsonNull'
as respective null magic values - you can now always use a Javascript null
value.Prisma.DbNull
. (#7671) @renovate[core]
Adds [list].graphql.maxTake
, a list configuration option to enforce the maximum take
value in findMany queries for that list (#7963) @dcousens[core]
Adds new getContext
function (from @keystone-6/core/context
) for working with a Keystone configuration directly (#7954) @dcousens[core]
Adds a search input field to the list view, resulting in a contains
query across ui.searchFields
joined with the list view filters (#7841) @Noviny[core]
Adds a new isSingleton
property for configuring Singleton lists (#7863) @mitchellhamilton[core]
Fixes JSON field type view assuming the empty string is equivalent to null
(#7982) @dcousens[auth]
Adds type refinement for withAuth
using a TypeInfo type parameter (#7831) @dcousens[core]
Removes experimental.enableNextJsGraphqlApiEndpoint
(#7910) @mitchellhamilton[core]
Changed platform compilation to use esbuild, previously used next.js (#7809) @mitchellhamilton[core]
Removes prettier
from formatting the generated schema.graphql
(#7874) @mitchellhamiltonThanks to the following developers for making their first contributions to the project!
Lastly, thanks to @dcousens (#8012,#7998,#7997,#7995,#7981,#7979,#7973,#7897,#7895,#7894,#7864), @renovate (#8008,#7988,#7976,#7938,#7854,#7892,#7886,#7885,#7868), @flexdinesh (#8004,#8002,#7987,#7994,#7983,#7937,#7813), @mitchellhamilton (#7999,#7990,#7991,#7960,#7951,#7953,#7928,#7921,#7911,#7903,#7882,#7887,#7871,#7872,#7845,#7844), @Tekipeps (#7989), @Noviny (#7941) for changes not shown above, but none-the-less appreciated.
Published by dcousens about 2 years ago
The following packages have been updated
@keystone-6/[email protected]
We have identified and fixed 1 security vulnerabilities
GHSA-6mhr-52mv-6v6f
- The multiselect field is vulnerable to a field-level access-control bypass. We have patched the vulnerability in this release.[core]
Fixes the multiselect field type not using the provided label
, access
, graphql
, isFilterable
or isOrderable
configuration options (#8007) @marekryb[core]
Fixes BigInt values throwing on deserialisation in the item view (#8005) @dcousensThanks to the following developers for making their first contributions to the project!
Published by dcousens about 2 years ago
The following packages have been updated
@keystone-6/[email protected]
[fields-document]
Fixes a broken code path for conditional component-blocks when fields are missing - this previously resulted in invalid data structures within the document editor (#7922) @mitchellhamiltonPublished by dcousens about 2 years ago
The following packages have been updated
@keystone-6/[email protected]
@keystone-6/[email protected]
[core]
Fixes return types for context.graphql
so that correct types are returned when using a TypedDocumentNode
(#7878) @borisno2[fields-document]
Fixes expand/collapse button in the editor (#7926) @mitchellhamilton[core]
Adds contextualised types when using the graphql
export for GraphQL schema extensions (#7877) @dcousens[core]
Fixes nullable and non-nullable calendarDay fields existing in the same schema creating a GraphQL schema with two different types with the same name (#7866) @acburdine[core]
Fixes types for resolvedData
, and the return types for resolveInput
hooks. (#7833) @NovinyThanks to the following developers for making their first contributions to the project!
Lastly, thanks to @dcousens (#7876,#7839,#7832,#7819), @mitchellhamilton (#7875,#7873,#7847,#7830,#7828,#7818,#7928), @dependabot[bot] (#7869), @renovate[bot] (#7862,#7860,#7826,#7825,#7823,#7824), @renovate (#7721,#7812) and @moselhy (#7843) for changes not shown above, but none-the-less appreciated.
Published by dcousens about 2 years ago
The following packages have been updated
@keystone-6/[email protected]
@keystone-6/[email protected]
@keystone-6/[email protected]
@keystone-6/[email protected]
@keystone-6/[email protected]
@keystone-6/[email protected]
[core]
Adds cli
functions as exports to @keystone-6/core/scripts/cli
, assume to be an experimental unstable export and may change in a patch release. (#5645) @gautamsi[core]
Adds 'graphql' schema to extendHttpServer
. (#7722) @borisno2[core]
Adds the ability to set additional Prisma datasource fields in the schema.prisma
file, for example, referentialIntegrity
by adding options to db.additionalPrismaDatasourceProperties
(#7747) @willemmulder[core]
Adds http.Server options as configuration server.options
(#7324) @dcousens[core]
Adds a new multiselect
field type (#7683) @Achisingh[core]
Adds calendarDay
field to store a date without a time or timezone attached (#7658) @Achisingh[core]
Adds ui.displayMode: 'radio'
as an option for the select field. (#7752) @Achisingh[fields-document]
Changes the editors default overflow behaviour to align with other multi-line text inputs, supporting scrolling instead of an unbounded height for the field. (#7729) @Achisingh[core]
Adds a new bigInt
field type, an integer of width 8 bytes (64 bits), analogous with Prisma's BigInt
. (#5175) @MurzNN[core]
Removes wrong types for resolveInput
hooks until actual types are provided (#7801) @dcousens[auth, cloudinary, core, document-renderer, fields-document, session-store-redis]
Removes node .engines
restrictions (#7804) @dcousens[cloudinary, core]
Updates graphql-upload
to 15.0.2
(#7803) @mitchellhamilton[core]
Fixes environment variable PORT=
precedence; PORT=
now takes priority over the configured server.port
(#7787) @dcousens[fields-document]
Fixes the document editor erroring when handling HTML in certain cases (#7764) @mitchellhamilton[fields-document]
Fixes long lines in code blocks in the document editor overflowing the editor (#7783) @mitchellhamilton[fields-document]
Fixes pasting plain text in the document editor removing markdown link definition and usages (#null) @mitchellhamilton[session-store-redis]
Fixes errors not being thrown by your @redis/client
on connect
(#7771) @Noviny[fields-document]
Adds support for pasting a url onto text to create a link (#7766) @mitchellhamilton[core]
Updates @apollo/client
to 3.6.9
(#7744) @mitchellhamilton[core]
Updates @graphql-ts/schema
to 0.5.3
(#7742) @mitchellhamilton[core]
Fixes return type of findOne
to support null
, which is returned if no item is found (#7731) @nderkimWe have identified and fixed 1 upstream security vulnerability
CVE-2022-24434
- An upstream transitive dependency dicer
is vulnerable to a complete denial-of-service attack. We have upgraded to a version of graphql-upload
package to a version that doesn't use dicer
.Thanks to the following developers for making their first contributions to the project!
Lastly, thanks to @mitchellhamilton (#7786,#7785,#7784,#7769,#7745), @renovate (#7797,#7798,#7670,#7780,#7781,#7779,#7755,#7487,#7725), @dcousens (#7713,#7743,#7739,#7730), @Noviny (#7770), @Achisingh (#7757), @dependabot (#7728) for changes not shown above, but none-the-less appreciated.
Published by dcousens over 2 years ago
The following packages have been updated
@keystone-6/[email protected]
[fields-document]
Updates slate and slate-react to ^0.81.1 (#7701) @mitchellhamilton[fields-document]
Fixes inline relationships being removed when loading/saving an item in the Admin UI (#7685, #7700) @mitchellhamiltonThanks to @Skulek (#7695) for their first contribution to the project.
Published by dcousens over 2 years ago
Feature release.
@keystone-6/[email protected]
@keystone-6/[email protected]
@keystone-6/[email protected]
@keystone-6/[email protected]
@keystone-6/[email protected]
Keystone now supports MySQL by setting mysql
in your db.provider
see pull request #7538 for further information.
β οΈ There are some differences in how Postgres and MySQL operate so be sure to checkout our new choosing the right database guide.
ui.description
for fields to show a description below the label in the Admin UI - #7578
Firmware
or Shrimp
- as list names without receiving an error. This builds on the existing graphql.plural
configuration by adding the configuration options of ui.label
, ui.singular
, ui.plural
and ui.path
to change the auto-generated names of lists used in the Admin UI #7657
isRequired
is set - #7639 Thanks @u-ishii
cloudinaryImage
GraphQL output type to be exported for developer usage, for example in virtual fields - #7607 Thanks @mmachatschek!shadowDatabaseUrl
option with db.shadowDatabaseUrl
. Your Prisma schemas will now always include shadowDatabaseUrl = env("SHADOW_DATABASE_URL")
, though using db.shadowDatabaseUrl
is optional - #7350 Thanks @chelkyl and @jlarmstrongiv!idField: { kind: 'autoincrement', type: 'BigInt' }
- #7188 Thanks @MurzNN!graphQLSchemaExtension
, custom resolvers, if replacing default resolvers, were previously broken - #7644
db.nativeType
option to the text
field to customise the database type - #7538
{field}.isIndexed: true
and {field}.db.map
are set - #7666 Thanks @TonnyORG!Big shoutout to the following community members for their help in improving our documentation with their contributions:
Thanks to @mmachatschek (#7607), @ratson (#7627), @chelkyl (#7350) and @u-ishii (#7639) for making their first contributions to the project!
Star this repo π βοΈ or connect with Keystone on Twitter and in Slack.
You can also view the verbose changelog or compare via GitHub since 2022-06-09
Published by dcousens over 2 years ago
π¦ @keystone-ui/[email protected]
π¦ @keystone-ui/[email protected]
π¦ @keystone-ui/[email protected]
π¦ @keystone-ui/[email protected]
π¦ @keystone-ui/[email protected]
π¦ @keystone-ui/[email protected]
π¦ @keystone-ui/[email protected]
π¦ @keystone-ui/[email protected]
π¦ @keystone-ui/[email protected]
π¦ @keystone-ui/[email protected]
π¦ @keystone-ui/[email protected]
π¦ @keystone-ui/[email protected]
π¦ @keystone-ui/[email protected]
π¦ @keystone-6/[email protected]
π¦ @keystone-6/[email protected]
π¦ @keystone-6/[email protected]
π¦ @keystone-6/[email protected]
π¦ @keystone-6/[email protected]
π¦ @keystone-6/[email protected]
Warning: This new feature includes breaking changes that may affect you
Changes to the underlying document-editor component block interfaces, with the addition of array fields. The breaking changes are only for defining components, no database migration is needed.
The breaking changes for @keystone-6/fields-document/component-blocks
are:
component
function, rename component
to preview
component
function, rename props
to schema
.schema
(previously .props
), rename props.{innerFieldName}
to props.fields.{innerFieldName}
.props.{innerFieldName}
to props.{innerFieldName}.element
.For example, use props.fields.title
instead of props.title
.
For a nested example, use props.fields.someObject.fields.title
instead of props.someObject.title
.
See pull request #7428 for information on how to upgrade and solutions to common problems. If you have any other questions, please don't hesitate to open a GitHub discussion.
Warning: This new feature includes breaking changes that may affect you
The image
and files
configuration options have been removed from Keystone's configuration, and a new storage
configuration object introduced.
Note: A
preserve
flag has been added to the new storage configurations to default back to the previous behaviour
See pull request #7070 for information on how to upgrade and solutions to common problems.
If you have any other questions, please don't hesitate to open a GitHub discussion.
If you can't upgrade your dependencies for any reason and you think Keystone might be able to help, please open a GitHub discussion so we can try and help you.
We have updated React to version 18 (pull request #7410).
Our @keystone-6/session-store-redis
package has been upgraded to use @redis/[email protected]
/[email protected]
(pull request #7051).
Added support for body-parser
options when configuring GraphQL #7591
The following changes include a number of accessibility and quality of life improvements for users of the admin interface.
A number of users have reported problems with the Prisma binaries not being installed properly by their package manager.
As part of pull request #7595 the Prisma binaries are now downloaded just before they're needed.
Note this should not happen in production, they should still be downloaded before as part of your deployment step.
Big shoutout to the following community members for their help in improving our documentation with their contributions:
Star this repo π βοΈ or connect with Keystone on Twitter and in Slack.
You can also view the verbose changelog in this pull request.
Published by dcousens over 2 years ago
Maintenance release.
"@keystone-6/core": "1.1.1"
"@keystone-6/fields-document": "2.0.1"
validation.min
not being respected and validation.max
being used as the min if provided.Weβre proud to announce that two new members have joined the team:
If youβre an AU or NZ based developer or designer looking to work on projects like Keystone, feel free to send your CV through to us at Thinkmill.
Star this repo π βοΈ or connect to Keystone on Twitter and in Slack.
You can also view the verbose changelog in this pull request.
Published by bladey over 2 years ago
Maintenance release.
"@keystone-6/auth": "2.0.0",
"@keystone-6/cloudinary": "2.0.0",
"@keystone-6/core": "1.1.0",
"@keystone-6/fields-document": "2.0.0",
"@keystone-6/session-store-redis": "2.0.0",
β οΈ Β This release contains a breaking change! Please read the instructions below.
When selecting a date, the date picker sometimes changed to the previous day, this is now resolved.
The root of the problem as highlighted in https://github.com/keystonejs/keystone/issues/6115 is the inconsistency in how browsers handle new Date(value)
where value is some string representation of a Date
.
Year, month, and day to Date
is now explicitly passed in for more deterministic behaviour.
Thanks @ChuckJonas and community members for reporting this issue.
β οΈ Β Breaking change! Please follow the guidance below.
We've moved the configuration for relationships in component blocks, if you have relationships in component blocks, you'll need to update your configuration.
This configuration has moved so that it's configured at the relationship prop rather than in the relationships
key on the document field config.
The relationships
key in the document field config now exclusively refers to inline relationships.
We have also added documentation for child fields and early validation for checking that relationships in the document field (both inline relationships and props in component blocks) refer to lists that actually exist.
Before:
import { config, list } from '@keystone-6/core';
import { document } from '@keystone-6/fields-document';
export default config({
lists: {
ListName: list({
fields: {
fieldName: document({
relationships: {
featuredAuthors: {
kind: 'prop',
listKey: 'Author',
selection: 'id name posts { title }',
many: true,
},
},
/* ... */
}),
/* ... */
},
}),
/* ... */
},
/* ... */
});
import { fields } from '@keystone-6/fields-document/component-blocks';
fields.relationship({ label: 'Authors', relationship: 'featuredAuthors' });
After:
import { fields } from '@keystone-6/fields-document/component-blocks';
fields.relationship({
label: 'Authors',
listKey: 'Author',
selection: 'id name posts { title }',
many: true,
});
http
server, thanks @lachieh!require.resolve
to get the paths to views
not working with newer versions of Next.jsPopover
component to toggle open and closed on click of the trigger, previously trigger click would only open the dialog. This is necessary because the Admin UI has limited usability on mobile phones, and when certain dialogs open, it is difficult to close by clicking outside. This adds the option of closing it by clicking the menu button again.Star this repo π βοΈ or connect to Keystone on Twitter and in Slack.
You can also view the verbose changelog in the related PR (https://github.com/keystonejs/keystone/pull/7219) for this release.
Published by bladey almost 3 years ago
This patch release is related to security advisory CVE-2022-0087.
"@keystone-6/auth": "1.0.2"
This patch is relating to a security advisory that removes the capability for an attacker to exploit a reflected cross-site scripting vulnerability when using a previous version of the @keystone-6/auth
package. The original security advisory is located here.
The vulnerability can impact users of the administration user interface when following an untrusted link to the signin
or init
page.
This is a targeted attack and may present itself in the form of phishing and or chained in conjunction with some other vulnerability.
Please upgrade to @keystone-6/auth >= 1.0.2
(this patch), where this vulnerability has been closed.
If you are using @keystone-next/auth
, we strongly recommend you upgrade to @keystone-6
.
If for some reason you cannot upgrade the dependencies in software, you could alternatively
https://owasp.org/www-community/attacks/xss/
Thanks to Shivansh Khari (@Shivansh-Khari) for discovering and reporting this vulnerability.
Star this repo π βοΈ or connect to Keystone on Twitter and in Slack.
You can also view the verbose changelog in the related PR (https://github.com/keystonejs/keystone/pull/7156) for this release.
Published by bladey almost 3 years ago
Patch release.
"@keystone-6/auth": "1.0.1",
"@keystone-6/core": "1.0.1",
item
view shows the item's label, list
view shows the list name, other pages show Keystone
resolveInput
hook to support returning undefined
You must await server.start() before calling server.createHandler()
when using the generateNextGraphqlAPI
experimental optiondb.enableLogging
to false
erroringfast-glob
dependencyStar this repo π βοΈ or connect to Keystone on Twitter and in Slack.
You can also view the verbose changelog in the related PR (https://github.com/keystonejs/keystone/pull/7044) for this release.
Published by bladey almost 3 years ago
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.
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.
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:
BaseGeneratedListTypes
β BaseListTypeInfo
ItemRootValue
β BaseItem
ListInfo
β ListGraphQLTypes
TypesForList
β GraphQLTypesForList
FieldTypeFunc
now has a required type parameter which must satisfy BaseListTypeInfo
BaseKeystoneTypeInfo
:
ServerConfig
CreateRequestContext
AdminUIConfig
DatabaseConfig
ListOperationAccessControl
MaybeSessionFunction
MaybeItemFunction
GraphQLResolver
and GraphQLSchemaExtension
now have a required type parameter which must satisfy KeystoneContext
KeystoneGraphQLAPI
no longer has a type parametervirtual
field will be typed as the item type if the list is typed with Keystone.Lists
or Keystone.Lists.ListKey
, otherwise it will be typed as unknown
item
/originalItem
arguments in hooks/access control will now receive the Item
type if the list is typed with Keystone.Lists
or Keystone.Lists.ListKey
, otherwise it will be typed as BaseItem
args
has been removed from BaseListTypeInfo
inputs.orderBy
and all
has been added to BaseListTypeInfo
.keystone/types
:
ListKeyListTypeInfo
has been moved to Lists.ListKey.TypeInfo
KeystoneContext
has been renamed to Context
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!
You can view the verbose changelog in the related PR (https://github.com/keystonejs/keystone/pull/7018) for this release.
Published by bladey almost 3 years ago
The Release Candidate for Keystone 6 General Availability has arrived! Within you'll find numerous improvements across the project. βοΈ
After this release, we will be moving Keystone 6 to General Availability and promoting the project to the @keystone-6
namespace on npm.
We highly recommend you upgrade to this release:
"@keystone-next/auth": "37.0.0",
"@keystone-next/cloudinary": "12.0.0",
"@keystone-next/document-renderer": "5.0.0",
"@keystone-next/fields-document": "14.0.0",
"@keystone-next/keystone": "29.0.0",
"@keystone-next/session-store-redis": "9.0.0",
β οΈ Β This release contains breaking changes! Please backup your data before upgrading and read the instructions below.
Warning: β οΈΒ Breaking change! Please follow the guidance below to avoid losing data.
The names of one-sided and two-sided, many-many relationships has been shortened. Two-sided many-many relationship names contain only the left-hand side names now; and the _many
suffix has been dropped from one-sided many-many relationships.
This reduces the probability that you will exceed PostgreSQL's 63 character limit for identifiers with typical usage.
There are two different ways you can update your schema:
Explicitly set the db.relationName
on many-to-many relations, allowing your database to remain unchanged.
Rename your many-to-many relations and tables using a migration, changing your database.
db.relationName
on many to many relationsRather than doing a migration, you can set the new field property db.relationName
, for either side of a many-to-many relationship field.
If set to the existing relation name, your database will remain unchanged.
For example, given a schema like this:
Post: list({
fields: {
tags: relationship({ ref: 'Tag.posts', many: true }),
},
}),
Tag: list({
fields: {
posts: relationship({ ref: 'Post.tags', many: true }),
},
}),
Before this release, the generated Prisma schema looked like this:
// This file is automatically generated by Keystone, do not modify it manually.
// Modify your Keystone config when you want to change this.
datasource postgresql {
url = env("DATABASE_URL")
provider = "postgresql"
}
generator client {
provider = "prisma-client-js"
output = "node_modules/.prisma/client"
engineType = "binary"
}
model Post {
id String @id @default(cuid())
tags Tag[] @relation("Post_tags_Tag_posts")
}
model Tag {
id String @id @default(cuid())
posts Post[] @relation("Post_tags_Tag_posts")
}
By adding db: { relationName: 'Post_tags_Tag_posts' }
to one side of the many-to-many relationship; you can preclude yourself from a migration.
Note: It doesn't matter which side of the relationship you put this property, but it should be only on one side; otherwise you will receive an error.
Post: list({
fields: {
tags: relationship({ ref: 'Tag.posts', many: true, db: { relationName: 'Post_tags_Tag_posts' } }),
},
}),
Tag: list({
fields: {
posts: relationship({ ref: 'Post.tags', many: true }),
},
}),
For example, given a schema like this:
Post: list({
fields: {
tags: relationship({ ref: 'Tag.posts', many: true }),
},
}),
Tag: list({
fields: {
posts: relationship({ ref: 'Post.tags', many: true }),
},
}),
When updating to this change, and running yarn dev
, Keystone will prompt you to update your schema.
Warning: β οΈ Warning: DO NOT APPLY THE AUTOMATICALLY GENERATED MIGRATION! You will lose your data. Only apply the migration if you want to
DROP
your data.
If using useMigrations: true
, Keystone will follow the typical migration flow and offer to apply an automatically generated migration.
If using useMigrations: false
, Keystone will follow the typical flow and offer to automatically migrate your schema.
On PostgreSQL, Prisma will generate a migration that looks something like this:
/*
Warnings:
- You are about to drop the `_Post_tags_Tag_posts` table. If the table is not empty, all the data it contains will be lost.
*/
-- DropForeignKey
ALTER TABLE "_Post_tags_Tag_posts" DROP CONSTRAINT "_Post_tags_Tag_posts_A_fkey";
-- DropForeignKey
ALTER TABLE "_Post_tags_Tag_posts" DROP CONSTRAINT "_Post_tags_Tag_posts_B_fkey";
-- DropTable
DROP TABLE "_Post_tags_Tag_posts";
-- CreateTable
CREATE TABLE "_Post_tags" (
"A" TEXT NOT NULL,
"B" TEXT NOT NULL
);
-- CreateIndex
CREATE UNIQUE INDEX "_Post_tags_AB_unique" ON "_Post_tags"("A", "B");
-- CreateIndex
CREATE INDEX "_Post_tags_B_index" ON "_Post_tags"("B");
-- AddForeignKey
ALTER TABLE "_Post_tags" ADD FOREIGN KEY ("A") REFERENCES "Post"("id") ON DELETE CASCADE ON UPDATE CASCADE;
-- AddForeignKey
ALTER TABLE "_Post_tags" ADD FOREIGN KEY ("B") REFERENCES "Tag"("id") ON DELETE CASCADE ON UPDATE CASCADE;
You need to modify it so that it looks like this with the old and new table names for your schema substituted:
ALTER TABLE "_Post_tags_Tag_posts" RENAME TO "_Post_tags";
ALTER INDEX "_Post_tags_Tag_posts_AB_unique" RENAME TO "_Post_tags_AB_unique";
ALTER INDEX "_Post_tags_Tag_posts_B_index" RENAME TO "_Post_tags_B_index";
ALTER TABLE "_Post_tags" RENAME CONSTRAINT "_Post_tags_Tag_posts_A_fkey" TO "_Post_tags_A_fkey";
ALTER TABLE "_Post_tags" RENAME CONSTRAINT "_Post_tags_Tag_posts_B_fkey" TO "_Post_tags_B_fkey";
On SQLite, Prisma will generate a migration that looks something like this:
/*
Warnings:
- You are about to drop the `_Post_tags_Tag_posts` table. If the table is not empty, all the data it contains will be lost.
*/
-- DropTable
PRAGMA foreign_keys=off;
DROP TABLE "_Post_tags_Tag_posts";
PRAGMA foreign_keys=on;
-- CreateTable
CREATE TABLE "_Post_tags" (
"A" TEXT NOT NULL,
"B" TEXT NOT NULL,
FOREIGN KEY ("A") REFERENCES "Post" ("id") ON DELETE CASCADE ON UPDATE CASCADE,
FOREIGN KEY ("B") REFERENCES "Tag" ("id") ON DELETE CASCADE ON UPDATE CASCADE
);
-- CreateIndex
CREATE UNIQUE INDEX "_Post_tags_AB_unique" ON "_Post_tags"("A", "B");
-- CreateIndex
CREATE INDEX "_Post_tags_B_index" ON "_Post_tags"("B");
You need to modify it so that it looks like this with the old and new table names for your schema substituted:
ALTER TABLE "_Post_tags_Tag_posts" RENAME TO "_Post_tags";
DROP INDEX "_Post_tags_Tag_posts_AB_unique";
DROP INDEX "_Post_tags_Tag_posts_B_index";
CREATE UNIQUE INDEX "_Post_tags_AB_unique" ON "_Post_tags"("A", "B");
CREATE INDEX "_Post_tags_B_index" ON "_Post_tags"("B");
Keystone now uses Prisma's Node-API Query Engine instead of the Binary Query Engine. This should improve the performance of operations using Prisma.
From our initial testing, performance has increased significantly when getting large amounts of data and is marginally better for smaller amounts.
See the Prisma docs for more details.
Keystone officially supports running on LTS versions of Node.js - this is currently version 14 and 16. We've updated our engine values throughout the project to reflect this.
Note: We recommend you run Node.js
^14.15
or^16.13
for the best Keystone experience.
Fixed the init/sign in page showing for a short amount of time after submitting on the init/sign in page and seeing a loading spinner.
Fixed clear button not removing inline relationships when used in the document field.
Relationship field now respects ui.displayMode: 'cards'
in the create view.
The Set as Authenticated Item
/Add Authenticated Item
button is now hidden if the relationship field already has the authenticated item.
Fixed ui.isAccessAllowed
not being respected in the admin meta query when no session strategy was defined.
The item page in the Admin UI no longer crashes when failing to fetch an item.
The admin meta query now bypasses ui.isAccessAllowed
for sudo contexts.
Fixed doing multiple writes at the same time on SQLite causing an timeout immediately.
Thanks to gregpalaci, vicaia, jakegiri davebeauchemin, Temkit, and bkbooth for reporting bugs that were fixed in this release!
Fixed default renderer of layout
block in <DocumentRenderer />
. Thanks @datner!
Like this release? Give us a star on GitHub!
You can view the verbose changelog in the related PR (https://github.com/keystonejs/keystone/pull/6943) for this release.