From c4491c17093ff7fb357cebcd5cb20911f2466712 Mon Sep 17 00:00:00 2001 From: Jacob Fletcher Date: Mon, 18 Nov 2024 10:47:33 -0500 Subject: [PATCH 1/7] removes information about custom providers being client-only --- docs/admin/components.mdx | 6 +++--- packages/richtext-lexical/src/lexical/LexicalProvider.tsx | 2 ++ 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/docs/admin/components.mdx b/docs/admin/components.mdx index f00a60dced9..1d2de2e1478 100644 --- a/docs/admin/components.mdx +++ b/docs/admin/components.mdx @@ -8,7 +8,7 @@ keywords: admin, components, custom, documentation, Content Management System, c The Payload [Admin Panel](./overview) is designed to be as minimal and straightforward as possible to allow for easy customization and full control over the UI. In order for Payload to support this level of customization, Payload provides a pattern for you to supply your own React components through your [Payload Config](../configuration/overview). -All Custom Components in Payload are [React Server Components](https://react.dev/reference/rsc/server-components) by default, with the exception of [Custom Providers](#custom-providers). This enables the use of the [Local API](../local-api/overview) directly on the front-end. Custom Components are available for nearly every part of the Admin Panel for extreme granularity and control. +All Custom Components in Payload are [React Server Components](https://react.dev/reference/rsc/server-components) by default. This enables the use of the [Local API](../local-api/overview) directly on the front-end. Custom Components are available for nearly every part of the Admin Panel for extreme granularity and control. Note: @@ -151,7 +151,7 @@ export default buildConfig({ ## Building Custom Components -All Custom Components in Payload are [React Server Components](https://react.dev/reference/rsc/server-components) by default, with the exception of [Custom Providers](#custom-providers). This enables the use of the [Local API](../local-api/overview) directly on the front-end, among other things. +All Custom Components in Payload are [React Server Components](https://react.dev/reference/rsc/server-components) by default. This enables the use of the [Local API](../local-api/overview) directly on the front-end, among other things. ### Default Props @@ -546,5 +546,5 @@ export const useMyCustomContext = () => useContext(MyCustomContext) ``` - Reminder: Custom Providers are by definition Client Components. This means they must include the `use client` directive at the top of their files and cannot use server-only code. + Reminder:React Context exists only within Client Components. This means they must include the `use client` directive at the top of their files and cannot contain server-only code. To use a Server Component here, simply _wrap_ your Client Component with it. diff --git a/packages/richtext-lexical/src/lexical/LexicalProvider.tsx b/packages/richtext-lexical/src/lexical/LexicalProvider.tsx index 1ab0714308b..ba254bd582c 100644 --- a/packages/richtext-lexical/src/lexical/LexicalProvider.tsx +++ b/packages/richtext-lexical/src/lexical/LexicalProvider.tsx @@ -30,7 +30,9 @@ const NestProviders = ({ children, providers }) => { if (!providers?.length) { return children } + const Component = providers[0] + if (providers.length > 1) { return ( From 34b4c337bd6fd6958d530b03f02e9a1b7db789be Mon Sep 17 00:00:00 2001 From: Jacob Fletcher Date: Mon, 18 Nov 2024 15:24:09 -0500 Subject: [PATCH 2/7] adds docs for Filter component --- docs/admin/fields.mdx | 40 ++++++++++++++++++++++++++++++++-------- 1 file changed, 32 insertions(+), 8 deletions(-) diff --git a/docs/admin/fields.mdx b/docs/admin/fields.mdx index 9bcea4408ab..fa0bf3c958a 100644 --- a/docs/admin/fields.mdx +++ b/docs/admin/fields.mdx @@ -66,7 +66,7 @@ A description can be configured in three ways: - As a function which returns a string. [More details](#description-functions). - As a React component. [More details](#description). -To easily add a Custom Description to a field, use the `admin.description` property in your [Field Config](../fields/overview): +To add a Custom Description to a field, use the `admin.description` property in your [Field Config](../fields/overview): ```ts import type { SanitizedCollectionConfig } from 'payload' @@ -95,7 +95,7 @@ export const MyCollectionConfig: SanitizedCollectionConfig = { Custom Descriptions can also be defined as a function. Description Functions are executed on the server and can be used to format simple descriptions based on the user's current [Locale](../configuration/localization). -To easily add a Description Function to a field, set the `admin.description` property to a _function_ in your [Field Config](../fields/overview): +To add a Description Function to a field, set the `admin.description` property to a _function_ in your [Field Config](../fields/overview): ```ts import type { SanitizedCollectionConfig } from 'payload' @@ -173,7 +173,7 @@ Within the [Admin Panel](./overview), fields are represented in three distinct p - [Cell](#cell) - The table cell component rendered in the List View. - [Filter](#filter) - The filter component rendered in the List View. -To easily swap in Field Components with your own, use the `admin.components` property in your [Field Config](../fields/overview): +To swap in Field Components with your own, use the `admin.components` property in your [Field Config](../fields/overview): ```ts import type { CollectionConfig } from 'payload' @@ -211,7 +211,7 @@ The following options are available: The Field Component is the actual form field rendered in the Edit View. This is the input that user's will interact with when editing a document. -To easily swap in your own Field Component, use the `admin.components.Field` property in your [Field Config](../fields/overview): +To swap in your own Field Component, use the `admin.components.Field` property in your [Field Config](../fields/overview): ```ts import type { CollectionConfig } from 'payload' @@ -312,7 +312,7 @@ import type { The Cell Component is rendered in the table of the List View. It represents the value of the field when displayed in a table cell. -To easily swap in your own Cell Component, use the `admin.components.Cell` property in your [Field Config](../fields/overview): +To swap in your own Cell Component, use the `admin.components.Cell` property in your [Field Config](../fields/overview): ```ts import type { Field } from 'payload' @@ -337,11 +337,35 @@ All Cell Components receive the same [Default Field Component Props](#field), pl For details on how to build Custom Components themselves, see [Building Custom Components](./components#building-custom-components). +### Filter + +The Filter Component is the actual input element rendered within the "Filter By" dropdown of the List View used to represent this field when building filters. + +To swap in your own Filter Component, use the `admin.components.Filter` property in your [Field Config](../fields/overview): + +```ts +import type { Field } from 'payload' + +export const myField: Field = { + name: 'myField', + type: 'text', + admin: { + components: { + Filter: '/path/to/MyCustomFilterComponent', // highlight-line + }, + }, +} +``` + +All Custom Filter Components receive the same [Default Field Component Props](#field). + +For details on how to build Custom Components themselves, see [Building Custom Components](./components#building-custom-components). + ### Label The Label Component is rendered anywhere a field needs to be represented by a label. This is typically used in the Edit View, but can also be used in the List View and elsewhere. -To easily swap in your own Label Component, use the `admin.components.Label` property in your [Field Config](../fields/overview): +To swap in your own Label Component, use the `admin.components.Label` property in your [Field Config](../fields/overview): ```ts import type { Field } from 'payload' @@ -377,7 +401,7 @@ import type { Alternatively to the [Description Property](#the-description-property), you can also use a [Custom Component](./components) as the Field Description. This can be useful when you need to provide more complex feedback to the user, such as rendering dynamic field values or other interactive elements. -To easily add a Description Component to a field, use the `admin.components.Description` property in your [Field Config](../fields/overview): +To add a Description Component to a field, use the `admin.components.Description` property in your [Field Config](../fields/overview): ```ts import type { SanitizedCollectionConfig } from 'payload' @@ -419,7 +443,7 @@ import type { The Error Component is rendered when a field fails validation. It is typically displayed beneath the field input in a visually-compelling style. -To easily swap in your own Error Component, use the `admin.components.Error` property in your [Field Config](../fields/overview): +To swap in your own Error Component, use the `admin.components.Error` property in your [Field Config](../fields/overview): ```ts import type { Field } from 'payload' From 58bc8bee1725954f8b7a398c6f435775af92e2bb Mon Sep 17 00:00:00 2001 From: Jacob Fletcher Date: Mon, 18 Nov 2024 15:59:10 -0500 Subject: [PATCH 3/7] adjusts language --- docs/admin/customizing-css.mdx | 2 +- docs/admin/hooks.mdx | 2 +- docs/admin/views.mdx | 8 ++++---- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/docs/admin/customizing-css.mdx b/docs/admin/customizing-css.mdx index 4ed40e70700..88ab9d601b7 100644 --- a/docs/admin/customizing-css.mdx +++ b/docs/admin/customizing-css.mdx @@ -8,7 +8,7 @@ keywords: admin, css, scss, documentation, Content Management System, cms, headl Customizing the Payload [Admin Panel](./overview) through CSS alone is one of the easiest and most powerful ways to customize the look and feel of the dashboard. To allow for this level of customization, Payload: -1. Exposes a [root-level stylesheet](#global-css) for you to easily to inject custom selectors +1. Exposes a [root-level stylesheet](#global-css) for you to inject custom selectors 1. Provides a [CSS library](#css-library) that can be easily overridden or extended 1. Uses [BEM naming conventions](http://getbem.com) so that class names are globally accessible diff --git a/docs/admin/hooks.mdx b/docs/admin/hooks.mdx index 2886eb85f62..680367e30bd 100644 --- a/docs/admin/hooks.mdx +++ b/docs/admin/hooks.mdx @@ -785,7 +785,7 @@ const Greeting: React.FC = () => { ## useConfig -Used to easily retrieve the Payload [Client Config](./components#accessing-the-payload-config). +Used to retrieve the Payload [Client Config](./components#accessing-the-payload-config). ```tsx 'use client' diff --git a/docs/admin/views.mdx b/docs/admin/views.mdx index 9679bca7864..72376815c1d 100644 --- a/docs/admin/views.mdx +++ b/docs/admin/views.mdx @@ -21,7 +21,7 @@ To swap in your own Custom View, first consult the list of available components, Root Views are the main views of the [Admin Panel](./overview). These are views that are scoped directly under the `/admin` route, such as the Dashboard or Account views. -To easily swap Root Views with your own, or to [create entirely new ones](#adding-new-root-views), use the `admin.components.views` property of your root [Payload Config](../configuration/overview): +To swap Root Views with your own, or to [create entirely new ones](#adding-new-root-views), use the `admin.components.views` property of your root [Payload Config](../configuration/overview): ```ts import { buildConfig } from 'payload' @@ -143,7 +143,7 @@ The above example shows how to add a new [Root View](#root-views), but the patte Collection Views are views that are scoped under the `/collections` route, such as the Collection List and Document Edit views. -To easily swap out Collection Views with your own, or to [create entirely new ones](#adding-new-views), use the `admin.components.views` property of your [Collection Config](../collections/overview): +To swap out Collection Views with your own, or to [create entirely new ones](#adding-new-views), use the `admin.components.views` property of your [Collection Config](../collections/overview): ```ts import type { SanitizedCollectionConfig } from 'payload' @@ -198,7 +198,7 @@ The following options are available: Global Views are views that are scoped under the `/globals` route, such as the Document Edit View. -To easily swap out Global Views with your own or [create entirely new ones](#adding-new-views), use the `admin.components.views` property in your [Global Config](../globals/overview): +To swap out Global Views with your own or [create entirely new ones](#adding-new-views), use the `admin.components.views` property in your [Global Config](../globals/overview): ```ts import type { SanitizedGlobalConfig } from 'payload' @@ -248,7 +248,7 @@ The following options are available: Document Views are views that are scoped under the `/collections/:collectionSlug/:id` or the `/globals/:globalSlug` route, such as the Edit View or the API View. All Document Views keep their overall structure across navigation changes, such as their title and tabs, and replace only the content below. -To easily swap out Document Views with your own, or to [create entirely new ones](#adding-new-document-views), use the `admin.components.views.Edit[key]` property in your [Collection Config](../collections/overview) or [Global Config](../globals/overview): +To swap out Document Views with your own, or to [create entirely new ones](#adding-new-document-views), use the `admin.components.views.Edit[key]` property in your [Collection Config](../collections/overview) or [Global Config](../globals/overview): ```ts import type { SanitizedCollectionConfig } from 'payload' From ab4f0ac12b4319f8cfb7711026fc55ea74615d73 Mon Sep 17 00:00:00 2001 From: Jacob Fletcher Date: Mon, 18 Nov 2024 17:30:37 -0500 Subject: [PATCH 4/7] includes file extensions in all examples that use component paths --- docs/admin/views.mdx | 20 ++++++++++---------- docs/migration-guide/overview.mdx | 8 ++++---- test/_community/Field.tsx | 7 +++++++ test/_community/collections/Posts/index.ts | 15 +++++++++++++++ 4 files changed, 36 insertions(+), 14 deletions(-) create mode 100644 test/_community/Field.tsx diff --git a/docs/admin/views.mdx b/docs/admin/views.mdx index 72376815c1d..3af5da4be2e 100644 --- a/docs/admin/views.mdx +++ b/docs/admin/views.mdx @@ -32,7 +32,7 @@ const config = buildConfig({ components: { views: { customView: { - Component: '/path/to/MyCustomView#MyCustomView', // highlight-line + Component: '/path/to/MyCustomView.tsx#MyCustomView', // highlight-line path: '/my-custom-view', } }, @@ -113,7 +113,7 @@ const config = buildConfig({ // highlight-start myCustomView: { // highlight-end - Component: '/path/to/MyCustomView#MyCustomViewComponent', + Component: '/path/to/MyCustomView.tsx#MyCustomViewComponent', path: '/my-custom-view', }, }, @@ -155,7 +155,7 @@ export const MyCollectionConfig: SanitizedCollectionConfig = { views: { edit: { root: { - Component: '/path/to/MyCustomEditView', // highlight-line + Component: '/path/to/MyCustomEditView.tsx', // highlight-line } // other options include: // default @@ -167,7 +167,7 @@ export const MyCollectionConfig: SanitizedCollectionConfig = { // See "Document Views" for more details }, list: { - Component: '/path/to/MyCustomListView', + Component: '/path/to/MyCustomListView.tsx', } }, }, @@ -210,7 +210,7 @@ export const MyGlobalConfig: SanitizedGlobalConfig = { views: { edit: { root: { - Component: '/path/to/MyCustomEditView', // highlight-line + Component: '/path/to/MyCustomEditView.tsx', // highlight-line } // other options include: // default @@ -260,7 +260,7 @@ export const MyCollectionOrGlobalConfig: SanitizedCollectionConfig = { views: { edit: { api: { - Component: '/path/to/MyCustomAPIViewComponent', // highlight-line + Component: '/path/to/MyCustomAPIViewComponent.tsx', // highlight-line }, }, }, @@ -301,14 +301,14 @@ export const MyCollection: SanitizedCollectionConfig = { views: { edit: { myCustomTab: { - Component: '/path/to/MyCustomTab', + Component: '/path/to/MyCustomTab.tsx', path: '/my-custom-tab', tab: { - Component: '/path/to/MyCustomTabComponent' // highlight-line + Component: '/path/to/MyCustomTabComponent.tsx' // highlight-line } }, anotherCustomTab: { - Component: '/path/to/AnotherCustomView', + Component: '/path/to/AnotherCustomView.tsx', path: '/another-custom-view', // highlight-start tab: { @@ -342,7 +342,7 @@ export const MyCollectionConfig: SanitizedCollectionConfig = { components: { views: { edit: { - Component: '/path/to/MyCustomView' // highlight-line + Component: '/path/to/MyCustomView.tsx' // highlight-line } }, }, diff --git a/docs/migration-guide/overview.mdx b/docs/migration-guide/overview.mdx index 55247d833f5..51602d0ef22 100644 --- a/docs/migration-guide/overview.mdx +++ b/docs/migration-guide/overview.mdx @@ -397,7 +397,7 @@ For more details, see the [Documentation](https://payloadcms.com/docs/getting-st ``` 3. For Fields, use the `admin.components.Description` key: - + ```diff // fields/MyField.ts import type { FieldConfig } from 'payload' @@ -501,7 +501,7 @@ For more details, see the [Documentation](https://payloadcms.com/docs/getting-st slug: 'my-collection', admin: { views: { - - Edit: MyCustomView + - Edit: MyCustomView + edit: { + Component: './components/MyCustomView.tsx' + } @@ -552,8 +552,8 @@ For more details, see the [Documentation](https://payloadcms.com/docs/getting-st + edit: { + tab: { + isActive: ({ href }) => true, - + href: ({ href }) => '' - + Component: './path/to/CustomComponent.tsx', // Or use a Custom Component + + href: ({ href }) => '' // or use a Custom Component (see below) + + // Component: './path/to/CustomComponent.tsx' + } + }, }, diff --git a/test/_community/Field.tsx b/test/_community/Field.tsx new file mode 100644 index 00000000000..1c1be60ae7f --- /dev/null +++ b/test/_community/Field.tsx @@ -0,0 +1,7 @@ +'use client' + +const ClientTestComponent = () => { + return <>I should be rendered on the client +} + +export default ClientTestComponent diff --git a/test/_community/collections/Posts/index.ts b/test/_community/collections/Posts/index.ts index ffed2abbd1e..183314bdb79 100644 --- a/test/_community/collections/Posts/index.ts +++ b/test/_community/collections/Posts/index.ts @@ -12,6 +12,21 @@ export const PostsCollection: CollectionConfig = { name: 'title', type: 'text', }, + { + name: 'array', + type: 'array', + fields: [ + { + name: 'ui', + type: 'ui', + admin: { + components: { + Field: '/Field.tsx', + }, + }, + }, + ], + }, ], versions: { drafts: true, From 10c4475e35b36d6e4fb516178668718a3d252019 Mon Sep 17 00:00:00 2001 From: Jacob Fletcher Date: Mon, 18 Nov 2024 17:33:13 -0500 Subject: [PATCH 5/7] updates all gh links from beta branch to main --- docs/admin/customizing-css.mdx | 6 +++--- docs/admin/overview.mdx | 2 +- docs/configuration/i18n.mdx | 2 +- docs/getting-started/installation.mdx | 2 +- docs/jobs-queue/overview.mdx | 16 ++++++++-------- docs/jobs-queue/tasks.mdx | 4 ++-- docs/lexical/building-custom-features.mdx | 2 +- docs/migration-guide/overview.mdx | 20 ++++++++++---------- docs/plugins/sentry.mdx | 2 +- docs/production/deployment.mdx | 10 +++++----- docs/queries/select.mdx | 4 ++-- docs/upload/storage-adapters.mdx | 10 +++++----- 12 files changed, 40 insertions(+), 40 deletions(-) diff --git a/docs/admin/customizing-css.mdx b/docs/admin/customizing-css.mdx index 88ab9d601b7..ff612b38ca4 100644 --- a/docs/admin/customizing-css.mdx +++ b/docs/admin/customizing-css.mdx @@ -62,13 +62,13 @@ You can also override Payload's built-in [CSS Variables](https://developer.mozil The following variables are defined and can be overridden: -- [Breakpoints](https://github.com/payloadcms/payload/blob/beta/packages/ui/src/scss/queries.scss) -- [Colors](https://github.com/payloadcms/payload/blob/beta/packages/ui/src/scss/colors.scss) +- [Breakpoints](https://github.com/payloadcms/payload/blob/main/packages/ui/src/scss/queries.scss) +- [Colors](https://github.com/payloadcms/payload/blob/main/packages/ui/src/scss/colors.scss) - Base color shades (white to black by default) - Success / warning / error color shades - Theme-specific colors (background, input background, text color, etc.) - Elevation colors (used to determine how "bright" something should be when compared to the background) -- [Sizing](https://github.com/payloadcms/payload/blob/beta/packages/ui/src/scss/app.scss) +- [Sizing](https://github.com/payloadcms/payload/blob/main/packages/ui/src/scss/app.scss) - Horizontal gutter - Transition speeds - Font sizes diff --git a/docs/admin/overview.mdx b/docs/admin/overview.mdx index 4a5766ab419..dd3fd8a9ce6 100644 --- a/docs/admin/overview.mdx +++ b/docs/admin/overview.mdx @@ -237,7 +237,7 @@ The following options are available: ## I18n -The Payload Admin Panel is translated in over [30 languages and counting](https://github.com/payloadcms/payload/tree/beta/packages/translations). Languages are automatically detected based on the user's browser and used by the Admin Panel to display all text in that language. If no language was detected, or if the user's language is not yet supported, English will be chosen. Users can easily specify their language by selecting one from their account page. See [I18n](../configuration/i18n) for more information. +The Payload Admin Panel is translated in over [30 languages and counting](https://github.com/payloadcms/payload/tree/main/packages/translations). Languages are automatically detected based on the user's browser and used by the Admin Panel to display all text in that language. If no language was detected, or if the user's language is not yet supported, English will be chosen. Users can easily specify their language by selecting one from their account page. See [I18n](../configuration/i18n) for more information. ## Light and Dark Modes diff --git a/docs/configuration/i18n.mdx b/docs/configuration/i18n.mdx index 85d41029dfe..a64faf3b5fd 100644 --- a/docs/configuration/i18n.mdx +++ b/docs/configuration/i18n.mdx @@ -6,7 +6,7 @@ desc: Manage and customize internationalization support in your CMS editor exper keywords: internationalization, i18n, config, configuration, documentation, Content Management System, cms, headless, javascript, node, react, nextjs --- -The [Admin Panel](../admin/overview) is translated in over [30 languages and counting](https://github.com/payloadcms/payload/tree/beta/packages/translations). With I18n, editors can navigate the interface and read API error messages in their preferred language. This is similar to [Localization](./localization), but instead of managing translations for the data itself, you are managing translations for your application's interface. +The [Admin Panel](../admin/overview) is translated in over [30 languages and counting](https://github.com/payloadcms/payload/tree/main/packages/translations). With I18n, editors can navigate the interface and read API error messages in their preferred language. This is similar to [Localization](./localization), but instead of managing translations for the data itself, you are managing translations for your application's interface. By default, Payload comes with preinstalled with English, but you can easily load other languages into your own application. Languages are automatically detected based on the request. If no language was detected, or if the user's language is not yet supported by your application, English will be chosen. diff --git a/docs/getting-started/installation.mdx b/docs/getting-started/installation.mdx index f4721afe19d..85c21f892e3 100644 --- a/docs/getting-started/installation.mdx +++ b/docs/getting-started/installation.mdx @@ -73,7 +73,7 @@ To install a Database Adapter, you can run **one** of the following commands: #### 2. Copy Payload files into your Next.js app folder -Payload installs directly in your Next.js `/app` folder, and you'll need to place some files into that folder for Payload to run. You can copy these files from the [Blank Template](https://github.com/payloadcms/payload/tree/beta/templates/blank/src/app/(payload)) on GitHub. Once you have the required Payload files in place in your `/app` folder, you should have something like this: +Payload installs directly in your Next.js `/app` folder, and you'll need to place some files into that folder for Payload to run. You can copy these files from the [Blank Template](https://github.com/payloadcms/payload/tree/main/templates/blank/src/app/(payload)) on GitHub. Once you have the required Payload files in place in your `/app` folder, you should have something like this: ```plaintext app/ diff --git a/docs/jobs-queue/overview.mdx b/docs/jobs-queue/overview.mdx index 4769b12e394..31af49390f6 100644 --- a/docs/jobs-queue/overview.mdx +++ b/docs/jobs-queue/overview.mdx @@ -32,7 +32,7 @@ Examples: **Periodic sync or similar scheduled action** -Some applications may need to perform a regularly scheduled operation of some type. Jobs are perfect for this because you can execute their logic using `cron`, scheduled nightly, every twelve hours, or some similar time period. +Some applications may need to perform a regularly scheduled operation of some type. Jobs are perfect for this because you can execute their logic using `cron`, scheduled nightly, every twelve hours, or some similar time period. Examples: @@ -49,22 +49,22 @@ Examples: - You need to create (and then keep in sync) vector embeddings of your documents as they change, but you use an open source model to generate embeddings - You have a PDF generator that needs to dynamically build and send PDF versions of documents to customers - You need to use a headless browser to perform some type of logic -- You need to perform a series of actions, each of which depends on a prior action and should be run in as "durable" of a fashion as possible +- You need to perform a series of actions, each of which depends on a prior action and should be run in as "durable" of a fashion as possible ### How it works There are a few concepts that you should become familiarized with before using Payload's Jobs Queue. We recommend learning what each of these does in order to fully understand how to leverage the power of Payload's Jobs Queue. -1. [Tasks](/docs/beta/jobs-queue/tasks) -1. [Workflows](/docs/beta/jobs-queue/workflows) -1. [Jobs](/docs/beta/jobs-queue/jobs) -1. [Queues](/docs/beta/jobs-queue/queues) +1. [Tasks](/docs/main/jobs-queue/tasks) +1. [Workflows](/docs/main/jobs-queue/workflows) +1. [Jobs](/docs/main/jobs-queue/jobs) +1. [Queues](/docs/main/jobs-queue/queues) -All of these pieces work together in order to allow you to offload long-running, expensive, or future scheduled work from your main APIs. +All of these pieces work together in order to allow you to offload long-running, expensive, or future scheduled work from your main APIs. Here's a quick overview: - A Task is a specific function that performs business logic - Workflows are groupings of specific tasks which should be run in-order, and can be retried from a specific point of failure - A Job is an instance of a single task or workflow which will be executed -- A Queue is a way to segment your jobs into different "groups" - for example, some to run nightly, and others to run every 10 minutes +- A Queue is a way to segment your jobs into different "groups" - for example, some to run nightly, and others to run every 10 minutes diff --git a/docs/jobs-queue/tasks.mdx b/docs/jobs-queue/tasks.mdx index b79a270f5f9..b13f121dd2f 100644 --- a/docs/jobs-queue/tasks.mdx +++ b/docs/jobs-queue/tasks.mdx @@ -2,7 +2,7 @@ title: Tasks label: Tasks order: 20 -desc: A Task is a distinct function declaration that can be run within Payload's Jobs Queue. +desc: A Task is a distinct function declaration that can be run within Payload's Jobs Queue. keywords: jobs queue, application framework, typescript, node, react, nextjs --- @@ -10,7 +10,7 @@ keywords: jobs queue, application framework, typescript, node, react, nextjs A "Task" is a function definition that performs business logic and whose input and output are both strongly typed. -You can register Tasks on the Payload config, and then create [Jobs](/docs/beta/jobs-queue/jobs) or [Workflows](/docs/beta/jobs-queue/workflows) that use them. Think of Tasks like tidy, isolated "functions that do one specific thing". +You can register Tasks on the Payload config, and then create [Jobs](/docs/main/jobs-queue/jobs) or [Workflows](/docs/main/jobs-queue/workflows) that use them. Think of Tasks like tidy, isolated "functions that do one specific thing". Payload Tasks can be configured to automatically retried if they fail, which makes them valuable for "durable" workflows like AI applications where LLMs can return non-deterministic results, and might need to be retried. diff --git a/docs/lexical/building-custom-features.mdx b/docs/lexical/building-custom-features.mdx index 4384b384a4a..449edd1dc1c 100644 --- a/docs/lexical/building-custom-features.mdx +++ b/docs/lexical/building-custom-features.mdx @@ -836,4 +836,4 @@ The reason the client feature does not have the same props available as the serv ## More information -Have a look at the [features we've already built](https://github.com/payloadcms/payload/tree/beta/packages/richtext-lexical/src/features) - understanding how they work will help you understand how to create your own. There is no difference between the features included by default and the ones you create yourself - since those features are all isolated from the "core", you have access to the same APIs, whether the feature is part of Payload or not! +Have a look at the [features we've already built](https://github.com/payloadcms/payload/tree/main/packages/richtext-lexical/src/features) - understanding how they work will help you understand how to create your own. There is no difference between the features included by default and the ones you create yourself - since those features are all isolated from the "core", you have access to the same APIs, whether the feature is part of Payload or not! diff --git a/docs/migration-guide/overview.mdx b/docs/migration-guide/overview.mdx index 51602d0ef22..a59b436dcb3 100644 --- a/docs/migration-guide/overview.mdx +++ b/docs/migration-guide/overview.mdx @@ -67,7 +67,7 @@ For more details, see the [Documentation](https://payloadcms.com/docs/getting-st + const var = process.env.NEXT_PUBLIC_MY_ENV_VAR ``` - For more details, see the [Documentation](https://payloadcms.com/docs/beta/configuration/environment-vars). + For more details, see the [Documentation](https://payloadcms.com/docs/main/configuration/environment-vars). 1. The `req` object used to extend the [Express Request](https://expressjs.com/), but now extends the [Web Request](https://developer.mozilla.org/en-US/docs/Web/API/Request). You may need to update your code accordingly to reflect this change. For example: @@ -224,7 +224,7 @@ For more details, see the [Documentation](https://payloadcms.com/docs/getting-st }) ``` - For more details, see the [Documentation](https://payloadcms.com/docs/beta/admin/metadata#icons). + For more details, see the [Documentation](https://payloadcms.com/docs/main/admin/metadata#icons). 1. The `admin.meta.ogImage` property has been replaced by `admin.meta.openGraph.images`: @@ -245,7 +245,7 @@ For more details, see the [Documentation](https://payloadcms.com/docs/getting-st }) ``` - For more details, see the [Documentation](https://payloadcms.com/docs/beta/admin/metadata#open-graph). + For more details, see the [Documentation](https://payloadcms.com/docs/main/admin/metadata#open-graph). 1. The args of the `admin.livePreview.url` function have changed. It no longer receives `documentInfo` as an arg, and instead, now has `collectionConfig` and `globalConfig`. @@ -332,7 +332,7 @@ For more details, see the [Documentation](https://payloadcms.com/docs/getting-st }) ``` - For more details, see the [Documentation](https://payloadcms.com/docs/beta/admin/components#component-paths). + For more details, see the [Documentation](https://payloadcms.com/docs/main/admin/components#component-paths). 1. All Custom Components are now server-rendered by default, and therefore, cannot use state or hooks directly. If you’re using Custom Components in your app that requires state or hooks, add the `'use client'` directive at the top of the file. @@ -352,7 +352,7 @@ For more details, see the [Documentation](https://payloadcms.com/docs/getting-st } ``` - For more details, see the [Documentation](https://payloadcms.com/docs/beta/admin/components#client-components). + For more details, see the [Documentation](https://payloadcms.com/docs/main/admin/components#client-components). 1. The `admin.description` property within Collection, Globals, and Fields no longer accepts a React Component. Instead, you must define it as a Custom Component. @@ -743,7 +743,7 @@ For more details, see the [Documentation](https://payloadcms.com/docs/getting-st } ``` - For more details, see the [Documentation](https://payloadcms.com/docs/beta/admin/components#accessing-the-payload-config). + For more details, see the [Documentation](https://payloadcms.com/docs/main/admin/components#accessing-the-payload-config). 1. The `useCollapsible` hook has had slight changes to its property names. `collapsed` is now `isCollapsed` and `withinCollapsible` is now `isWithinCollapsible`. @@ -876,10 +876,10 @@ export default buildConfig({ | Service | Package | | -------------------- | ---------------------------------------------------------------------------- | -| Vercel Blob | https://github.com/payloadcms/payload/tree/beta/packages/storage-vercel-blob | -| AWS S3 | https://github.com/payloadcms/payload/tree/beta/packages/storage-s3 | -| Azure | https://github.com/payloadcms/payload/tree/beta/packages/storage-azure | -| Google Cloud Storage | https://github.com/payloadcms/payload/tree/beta/packages/storage-gcs | +| Vercel Blob | https://github.com/payloadcms/payload/tree/main/packages/storage-vercel-blob | +| AWS S3 | https://github.com/payloadcms/payload/tree/main/packages/storage-s3 | +| Azure | https://github.com/payloadcms/payload/tree/main/packages/storage-azure | +| Google Cloud Storage | https://github.com/payloadcms/payload/tree/main/packages/storage-gcs | ```tsx // ❌ Before (required peer dependencies depending on adapter) diff --git a/docs/plugins/sentry.mdx b/docs/plugins/sentry.mdx index 0f653cf75e2..9298fe654f2 100644 --- a/docs/plugins/sentry.mdx +++ b/docs/plugins/sentry.mdx @@ -31,7 +31,7 @@ This multi-faceted software offers a range of features that will help you manage - **Integrations**: Connects with various tools and services for enhanced workflow and issue management - This plugin is completely open-source and the [source code can be found here](https://github.com/payloadcms/payload/tree/beta/packages/plugin-sentry). If you need help, check out our [Community Help](https://payloadcms.com/community-help). If you think you've found a bug, please [open a new issue](https://github.com/payloadcms/payload/issues/new?assignees=&labels=plugin%3A%20seo&template=bug_report.md&title=plugin-sentry%3A) with as much detail as possible. + This plugin is completely open-source and the [source code can be found here](https://github.com/payloadcms/payload/tree/main/packages/plugin-sentry). If you need help, check out our [Community Help](https://payloadcms.com/community-help). If you think you've found a bug, please [open a new issue](https://github.com/payloadcms/payload/issues/new?assignees=&labels=plugin%3A%20seo&template=bug_report.md&title=plugin-sentry%3A) with as much detail as possible. ## Installation diff --git a/docs/production/deployment.mdx b/docs/production/deployment.mdx index 8b94c4884ed..6f128433015 100644 --- a/docs/production/deployment.mdx +++ b/docs/production/deployment.mdx @@ -147,11 +147,11 @@ But, if you do, and you still want to use an ephemeral filesystem provider, you Payload provides a list of official cloud storage adapters for you to use: -- [Azure Blob Storage](https://github.com/payloadcms/payload/tree/beta/packages/storage-azure) -- [Google Cloud Storage](https://github.com/payloadcms/payload/tree/beta/packages/storage-gcs) -- [AWS S3](https://github.com/payloadcms/payload/tree/beta/packages/storage-s3) -- [Uploadthing](https://github.com/payloadcms/payload/tree/beta/packages/storage-uploadthing) -- [Vercel Blob Storage](https://github.com/payloadcms/payload/tree/beta/packages/storage-vercel-blob) +- [Azure Blob Storage](https://github.com/payloadcms/payload/tree/main/packages/storage-azure) +- [Google Cloud Storage](https://github.com/payloadcms/payload/tree/main/packages/storage-gcs) +- [AWS S3](https://github.com/payloadcms/payload/tree/main/packages/storage-s3) +- [Uploadthing](https://github.com/payloadcms/payload/tree/main/packages/storage-uploadthing) +- [Vercel Blob Storage](https://github.com/payloadcms/payload/tree/main/packages/storage-vercel-blob) Follow the docs to configure any one of these storage providers. For local development, it might be handy to simply store uploads on your own computer, and then when it comes to production, simply enable the plugin for the cloud storage vendor of your choice. diff --git a/docs/queries/select.mdx b/docs/queries/select.mdx index 45e7729a521..6f887227b5a 100644 --- a/docs/queries/select.mdx +++ b/docs/queries/select.mdx @@ -107,9 +107,9 @@ const getPosts = async () => { The `defaultPopulate` property allows you specify which fields to select when populating the collection from another document. This is especially useful for links where only the `slug` is needed instead of the entire document. -With this feature, you can dramatically reduce the amount of JSON that is populated from [Relationship](/docs/beta/fields/relationship) or [Upload](/docs/beta/fields/upload) fields. +With this feature, you can dramatically reduce the amount of JSON that is populated from [Relationship](/docs/main/fields/relationship) or [Upload](/docs/main/fields/upload) fields. -For example, in your content model, you might have a `Link` field which links out to a different page. When you go to retrieve these links, you really only need the `slug` of the page. +For example, in your content model, you might have a `Link` field which links out to a different page. When you go to retrieve these links, you really only need the `slug` of the page. Loading all of the page content, its related links, and everything else is going to be overkill and will bog down your Payload APIs. Instead, you can define the `defaultPopulate` property on your `Pages` collection, so that when Payload "populates" a related Page, it only selects the `slug` field and therefore returns significantly less JSON: diff --git a/docs/upload/storage-adapters.mdx b/docs/upload/storage-adapters.mdx index 94e68deaf35..d24282f4715 100644 --- a/docs/upload/storage-adapters.mdx +++ b/docs/upload/storage-adapters.mdx @@ -10,11 +10,11 @@ Payload offers additional storage adapters to handle file uploads. These adapter | Service | Package | | -------------------- | ----------------------------------------------------------------------------------------------------------------- | -| Vercel Blob | [`@payloadcms/storage-vercel-blob`](https://github.com/payloadcms/payload/tree/beta/packages/storage-vercel-blob) | -| AWS S3 | [`@payloadcms/storage-s3`](https://github.com/payloadcms/payload/tree/beta/packages/storage-s3) | -| Azure | [`@payloadcms/storage-azure`](https://github.com/payloadcms/payload/tree/beta/packages/storage-azure) | -| Google Cloud Storage | [`@payloadcms/storage-gcs`](https://github.com/payloadcms/payload/tree/beta/packages/storage-gcs) | -| Uploadthing | [`@payloadcms/storage-uploadthing`](https://github.com/payloadcms/payload/tree/beta/packages/uploadthing) | +| Vercel Blob | [`@payloadcms/storage-vercel-blob`](https://github.com/payloadcms/payload/tree/main/packages/storage-vercel-blob) | +| AWS S3 | [`@payloadcms/storage-s3`](https://github.com/payloadcms/payload/tree/main/packages/storage-s3) | +| Azure | [`@payloadcms/storage-azure`](https://github.com/payloadcms/payload/tree/main/packages/storage-azure) | +| Google Cloud Storage | [`@payloadcms/storage-gcs`](https://github.com/payloadcms/payload/tree/main/packages/storage-gcs) | +| Uploadthing | [`@payloadcms/storage-uploadthing`](https://github.com/payloadcms/payload/tree/main/packages/uploadthing) | ## Vercel Blob Storage [`@payloadcms/storage-vercel-blob`](https://www.npmjs.com/package/@payloadcms/storage-vercel-blob) From a2fbf7619786950b9312de2031c789223c0a0295 Mon Sep 17 00:00:00 2001 From: Jacob Fletcher Date: Thu, 21 Nov 2024 13:52:46 -0500 Subject: [PATCH 6/7] removes file extensions --- docs/admin/views.mdx | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/docs/admin/views.mdx b/docs/admin/views.mdx index f07c856b869..b8ab94a6556 100644 --- a/docs/admin/views.mdx +++ b/docs/admin/views.mdx @@ -32,7 +32,7 @@ const config = buildConfig({ components: { views: { customView: { - Component: '/path/to/MyCustomView.tsx#MyCustomView', // highlight-line + Component: '/path/to/MyCustomView#MyCustomView', // highlight-line path: '/my-custom-view', } }, @@ -113,7 +113,7 @@ const config = buildConfig({ // highlight-start myCustomView: { // highlight-end - Component: '/path/to/MyCustomView.tsx#MyCustomViewComponent', + Component: '/path/to/MyCustomView#MyCustomViewComponent', path: '/my-custom-view', }, }, @@ -155,7 +155,7 @@ export const MyCollectionConfig: SanitizedCollectionConfig = { views: { edit: { root: { - Component: '/path/to/MyCustomEditView.tsx', // highlight-line + Component: '/path/to/MyCustomEditView', // highlight-line } // other options include: // default @@ -167,7 +167,7 @@ export const MyCollectionConfig: SanitizedCollectionConfig = { // See "Document Views" for more details }, list: { - Component: '/path/to/MyCustomListView.tsx', + Component: '/path/to/MyCustomListView', } }, }, @@ -210,7 +210,7 @@ export const MyGlobalConfig: SanitizedGlobalConfig = { views: { edit: { root: { - Component: '/path/to/MyCustomEditView.tsx', // highlight-line + Component: '/path/to/MyCustomEditView', // highlight-line } // other options include: // default @@ -260,7 +260,7 @@ export const MyCollectionOrGlobalConfig: SanitizedCollectionConfig = { views: { edit: { api: { - Component: '/path/to/MyCustomAPIViewComponent.tsx', // highlight-line + Component: '/path/to/MyCustomAPIViewComponent', // highlight-line }, }, }, @@ -301,14 +301,14 @@ export const MyCollection: SanitizedCollectionConfig = { views: { edit: { myCustomTab: { - Component: '/path/to/MyCustomTab.tsx', + Component: '/path/to/MyCustomTab', path: '/my-custom-tab', tab: { - Component: '/path/to/MyCustomTabComponent.tsx' // highlight-line + Component: '/path/to/MyCustomTabComponent' // highlight-line } }, anotherCustomTab: { - Component: '/path/to/AnotherCustomView.tsx', + Component: '/path/to/AnotherCustomView', path: '/another-custom-view', // highlight-start tab: { @@ -342,7 +342,7 @@ export const MyCollectionConfig: SanitizedCollectionConfig = { components: { views: { edit: { - Component: '/path/to/MyCustomView.tsx' // highlight-line + Component: '/path/to/MyCustomView' // highlight-line } }, }, From e672ca85527bfc1ead104af7b07acc6d40aaf9ba Mon Sep 17 00:00:00 2001 From: Jacob Fletcher Date: Thu, 21 Nov 2024 13:57:18 -0500 Subject: [PATCH 7/7] resets test configs --- .../src/lexical/LexicalProvider.tsx | 2 -- test/_community/Field.tsx | 7 ------- test/_community/collections/Posts/index.ts | 15 --------------- 3 files changed, 24 deletions(-) delete mode 100644 test/_community/Field.tsx diff --git a/packages/richtext-lexical/src/lexical/LexicalProvider.tsx b/packages/richtext-lexical/src/lexical/LexicalProvider.tsx index ba254bd582c..1ab0714308b 100644 --- a/packages/richtext-lexical/src/lexical/LexicalProvider.tsx +++ b/packages/richtext-lexical/src/lexical/LexicalProvider.tsx @@ -30,9 +30,7 @@ const NestProviders = ({ children, providers }) => { if (!providers?.length) { return children } - const Component = providers[0] - if (providers.length > 1) { return ( diff --git a/test/_community/Field.tsx b/test/_community/Field.tsx deleted file mode 100644 index 1c1be60ae7f..00000000000 --- a/test/_community/Field.tsx +++ /dev/null @@ -1,7 +0,0 @@ -'use client' - -const ClientTestComponent = () => { - return <>I should be rendered on the client -} - -export default ClientTestComponent diff --git a/test/_community/collections/Posts/index.ts b/test/_community/collections/Posts/index.ts index 183314bdb79..ffed2abbd1e 100644 --- a/test/_community/collections/Posts/index.ts +++ b/test/_community/collections/Posts/index.ts @@ -12,21 +12,6 @@ export const PostsCollection: CollectionConfig = { name: 'title', type: 'text', }, - { - name: 'array', - type: 'array', - fields: [ - { - name: 'ui', - type: 'ui', - admin: { - components: { - Field: '/Field.tsx', - }, - }, - }, - ], - }, ], versions: { drafts: true,