Skip to content

3.0.0-beta.31

Pre-release
Pre-release
Compare
Choose a tag to compare
@denolfe denolfe released this 14 May 16:44
· 281 commits to main since this release
bc9e591

3.0.0-beta.31 (2024-05-14)

Features

Bug Fixes

  • ui: step-nav breadcrumbs ellipsis (#6344) (353c2b0)
  • collection labels with multiple locales showing incorrectly (#5998) (58bbbbd)
  • depth field in api view throws error when no value present (#6106) (fcee13b)
  • implements graphql schema generation (#6254) (3abc2e8)
  • next: replaces default svg favicons with png (a48043c)
  • named tab being required in generated types without any required fields (#6324) (aa5ad47)
  • payload: loader alias issues (#6341) (890c21d)
  • ui: properly adds readOnly styles to disabled radio fields (#6240) (c7635b2)
  • db-postgres: too many clients already, cannot read properties 'transaction' of undefined (#6338) (47cd5f4)
  • some custom components were not handled properly if they are RSCs (#6315) (0d98b4b)
  • wrong translation key being used as upload:Sizes instead of upload:sizes (#6323) (2f02b3a)

BREAKING CHANGES

BREAKING: all i18n functions are now strongly typed, which will create errors if you have custom translations. If you do, you will have to pass a generic to i18n containing the types of your custom translations

Example of adding your own translations to the default translations type on the client:

const linkTranslations = {
 en: {
   lexical: {
     link: {
       custom: 'Custom',
       internal: 'Internal',
     },
   },
 },
}

type LinkTranslationKeys = NestedKeysStripped<typeof linkTranslations.en>

type MyI18n = I18nClient<typeof linkTranslations.en, LinkTranslationKeys>

const myI18n: MyI18n

myI18n.t('lexical:link:custom') // custom translations have been ADDED to the default client translations

Example for the useTranslation hook within a component:

const linkTranslations = {
 en: {
   lexical: {
     link: {
       custom: 'Custom',
       internal: 'Internal',
     },
   },
 },
}

type LinkTranslationKeys = NestedKeysStripped<typeof linkTranslations.en>

export const MyComponent: React.FC = () => {
 const { i18n, t } = useTranslation<typeof linkTranslations.en, LinkTranslationKeys>()

 return t('lexical:link:custom')
}

The admin.favicon: string property has been succeeeded by admin.icons: string | Icons | Icon[]. See nextjs.org/docs/app/api-reference/functions/generate-metadata#icons for full details.

  • some custom components were not handled properly if they are RSCs (#6315) (0d98b4b)

Breaking: The following, exported components now need the payload object as a prop rather than the config object:

  • RenderCustomComponent (optional)
  • Logo
  • DefaultTemplate
  • DefaultNav

Contributors