chore!: make optional params required and deprecate outgoing APIs#16623
Open
paulpopus wants to merge 3 commits into
Open
chore!: make optional params required and deprecate outgoing APIs#16623paulpopus wants to merge 3 commits into
paulpopus wants to merge 3 commits into
Conversation
Contributor
📦 esbuild Bundle Analysis for payloadThis analysis was generated by esbuild-bundle-analyzer. 🤖
Largest pathsThese visualization shows top 20 largest paths in the bundle.Meta file: packages/next/meta_index.json, Out file: esbuild/index.js
Meta file: packages/payload/meta_index.json, Out file: esbuild/index.js
Meta file: packages/payload/meta_shared.json, Out file: esbuild/exports/shared.js
Meta file: packages/richtext-lexical/meta_client.json, Out file: esbuild/exports/client_optimized/index.js
Meta file: packages/ui/meta_client.json, Out file: esbuild/exports/client_optimized/index.js
Meta file: packages/ui/meta_shared.json, Out file: esbuild/exports/shared_optimized/index.js
DetailsNext to the size is how much the size has increased or decreased compared with the base branch of this PR.
|
…ove-deprecated-API-from-lexical
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Resolves all
@todo ... in 4.0markers acrosspackages/payload,packages/drizzle, andpackages/richtext-lexical. No new behaviour is introduced — this is purely the enforcement of contracts that were deferred from 3.x.richtext-lexical:LinkNodepersistent IDLinkNodenow stores a__idfield (auto-generated ObjectID viabson-objectidif none is provided) and always emits it inexportJSONat version 3.SerializedLinkNode.idis now a requiredstring(wasid?: string).AutoLinkNodeuses an empty string as it has no concept of a persistent ID.updateFromJSON, making it a no-op for the returned node. It now runs before construction, so the generated id is actually applied.updateFromJSONno longer needs theas stringcast onserializedNode.id.richtext-lexical: v1 link node migration removedThe v1→v2 migration (
fields.doc.valueobject → ID) has been removed fromLinkNode.importJSONandAutoLinkNode.importJSON. This was tagged@todo remove in 4.0. See the 3.0→4.0 migration guide for manual remediation steps if your database contains pre-3.x link content.payload/drizzle:parentIsLocalizedmade requiredparentIsLocalizedwas optional (with@todo make required in v4.0) across every field hook traversal function,getLocalizedPaths,validateSearchParams,PathToQuery,hasLocalesTable, andvalidateExistingBlockIsIdentical. It is now a requiredbooleanthroughout. All call sites that were usingfield.localizeddirectly now useBoolean(field.localized)to correctly handle theboolean | undefinedtype.validateQueryPathsnow explicitly passesparentIsLocalized: falseat the root.payload:DatabaseAdapterResult.namemade requirednameonDatabaseAdapterResultwasname?: stringwith a@todo make required in 4.0. It is nowname: string.payload:returningdeprecated on all database adapter arg typesAdded
@deprecatedJSDoc to thereturningparameter on all ten database adapter operation arg types (CreateArgs,UpdateOneArgs,UpdateManyArgs,UpsertArgs,DeleteOneArgs,CreateVersionArgs,CreateGlobalVersionArgs,UpdateGlobalVersionArgs,CreateGlobalArgs,UpdateGlobalArgs,UpdateJobsArgs).payload:JobLog.inputmade requiredJobLog.inputwasinput?: Record<string, any>with a@todo make required in 4.0. The type, the collection field config (required: true), and both write paths (handleTaskError,getRunTaskFunction) are updated. Write paths guard withinput ?? {}to handle any in-flight undefined values at runtime.Breaking Changes
SerializedLinkNode.idis now requiredAny code constructing a
SerializedLinkNodeliteral (e.g. in tests or custom serializers) must now includeid: string. Custom node types that extendLinkNodeand overrideexportJSONmust includeid.v1
LinkNode/AutoLinkNodemigration removedContent stored in the Payload 2.x / early 3.x link node format (version 1,
fields.doc.valueas a full object) is no longer automatically migrated on read. Projects that have run Payload 3.x and edited their content through the admin are not affected. See the 3.0→4.0 migration guide for details on detecting and remediating affected content.parentIsLocalizedis now requiredThe following internal functions now require
parentIsLocalized: booleanto be passed explicitly. This affects custom database adapters or plugins that call these functions directly:afterChange/traverseFields,afterRead/traverseFields,beforeChange/traverseFields,beforeValidate/traverseFieldsgetLocalizedPaths,validateSearchParamsdrizzle:hasLocalesTable,validateExistingBlockIsIdenticalDatabaseAdapterResult.nameis now requiredCustom database adapters must provide a
name: stringon the result object returned from the adapter factory.JobLog.inputis now requiredJobLog.inputis nowRecord<string, any>(not optional). Code readingJobLogentries should no longer treatinputas possibly undefined.