payloadcms / payload

Payload is the open-source, fullstack Next.js framework, giving you instant backend superpowers. Get a full TypeScript backend and admin panel instantly. Use Payload as a headless CMS or for building powerful applications.
https://payloadcms.com
MIT License
23.54k stars 1.5k forks source link

fix(ui)!: standardizes named field exports #6907

Closed jacobsfletch closed 3 months ago

jacobsfletch commented 3 months ago

Description

Standardizes all named field exports. This improves semantics when using these components by appending Field onto the end of their names. Some components were already doing this, i.e. ArrayField and BlocksField. Now, all field components share this same convention. And since bundled components were already aliasing most exports in this way, this change will largely go unnoticed because most apps were already importing the correctly named components. What is ultimately means is that there was a mismatch between the unbundled vs bundled exports. This PR resolves that conflict. But this also introduces a potentially breaking change for your app. If your app is using components that import from the unbundled @payloadcms/ui package, those import paths likely changed:

Old:

import { Text } from '@payloadcms/ui/fields/Text'

New:

import { TextField } from '@payloadcms/ui/fields/Text'

If you were importing direcetly from the bundled version, you're imports likely have not changed. For example:

This still works (the import path is top-level, pointing to the bundled code):

import { TextField } from '@payloadcms/ui'

Type of change

Checklist: