@payloadcms/codemod 4.0.0-beta.4 → 4.0.0-beta.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/runbook/v4.mdx +15 -2
- package/package.json +1 -1
package/dist/runbook/v4.mdx
CHANGED
|
@@ -1244,7 +1244,7 @@ The deprecated `isHTMLElement` utility has been removed from `@payloadcms/richte
|
|
|
1244
1244
|
|
|
1245
1245
|
### Lexical now uses the upstream Markdown package
|
|
1246
1246
|
|
|
1247
|
-
`@payloadcms/richtext-lexical` no longer ships a vendored copy of `@lexical/markdown`. The package is now a direct dependency, every `@lexical/*` package was upgraded from `0.41.0` to `0.
|
|
1247
|
+
`@payloadcms/richtext-lexical` no longer ships a vendored copy of `@lexical/markdown`. The package is now a direct dependency, every `@lexical/*` package was upgraded from `0.41.0` to `0.53.0`, and `@payloadcms/richtext-lexical/lexical/markdown` is a pure passthrough of `@lexical/markdown`.
|
|
1248
1248
|
|
|
1249
1249
|
Most projects use markdown through the editor or through `convertMarkdownToLexical` / `convertLexicalToMarkdown` and need no changes. You are only affected if you import from `@payloadcms/richtext-lexical/lexical/markdown` directly.
|
|
1250
1250
|
|
|
@@ -1268,7 +1268,9 @@ If you keep calling `$convertFromMarkdownString` directly, pass `editorConfig.fe
|
|
|
1268
1268
|
|
|
1269
1269
|
**Whitespace-only markdown table cells now import as an empty paragraph** instead of a text node of padding spaces. This comes from the lexical upgrade, not Payload's own code. No action is required unless you assert on those padding spaces in stored content.
|
|
1270
1270
|
|
|
1271
|
-
|
|
1271
|
+
**Markdown export escapes literal brackets and HTML-like text.** `convertLexicalToMarkdown` now writes text such as `[note]` as `[note]` and `<b>` as `<b>`, so literal text no longer turns into links or HTML when the Markdown is parsed again. Ordinary text such as `AT&T` and `a < b` is unchanged, and `convertMarkdownToLexical` restores the original text. No action is required unless you compare exported Markdown against fixed strings or pass it to a parser that does not decode numeric character references.
|
|
1272
|
+
|
|
1273
|
+
If you import lexical APIs directly through `@payloadcms/richtext-lexical/lexical/*`, also review the [lexical breaking changes](https://github.com/facebook/lexical/releases) between `0.41.0` and `0.53.0`. None of them require action for typical Payload usage.
|
|
1272
1274
|
|
|
1273
1275
|
If your app imports Lexical types or adds custom features, check these changes from `0.50.0`. They also apply to imports through `@payloadcms/richtext-lexical/lexical` and its subpaths:
|
|
1274
1276
|
|
|
@@ -1278,6 +1280,8 @@ If your app imports Lexical types or adds custom features, check these changes f
|
|
|
1278
1280
|
- `SerializedEditorState<T>`, `SerializedElementNode<T>`, and `SerializedRootNode<T>` no longer accept a type argument. Remove `<T>` if you only need the base node type. For a document with your own node types, use Payload's `TypedEditorState<T>` instead. Without a type argument, Lexical's `children` are still typed as `SerializedLexicalNode[]`.
|
|
1279
1281
|
- `ReturnType<Node['exportJSON']>` can now infer partial JSON, making fields such as `version` and `url` optional. If your code expects the full format, use the node's explicit serialized type, such as `SerializedLinkNode`. A normal `node.exportJSON()` call still returns the full format.
|
|
1280
1282
|
- `LexicalNode.getCommonAncestor` was removed. Use `$getCommonAncestor(a, b)?.commonAncestor ?? null`; pass the parents of non-element nodes if you need the old method's behavior.
|
|
1283
|
+
- Node traversal and key lookup methods no longer accept a type argument: `getParent<T>()`, `getParentOrThrow<T>()`, `getChildren<T>()`, `getFirstChild<T>()`, `getNextSibling<T>()`, `$getNodeByKey<T>()` and the rest of that family. Remove `<T>` and narrow the result with a node guard, for example `node.getChildren().filter($isTableCellNode)`. Runtime behavior is unchanged.
|
|
1284
|
+
- The deprecated `LinkImportExtension`, `ListImportExtension` and `RichTextImportExtension` were removed. Use `LinkExtension`, `ListExtension` and `RichTextExtension` instead. `HorizontalRuleImportExtension` was also removed; use `HorizontalRuleExtension` from `@lexical/extension` together with an extension that includes `CoreImportExtension`. The `*ImportRules` arrays remain.
|
|
1281
1285
|
|
|
1282
1286
|
### Lexical table support is no longer experimental
|
|
1283
1287
|
|
|
@@ -1874,6 +1878,15 @@ File versioning adds a required `GeneratedAdapter.copyFile` method. Copy `from`
|
|
|
1874
1878
|
|
|
1875
1879
|
Replace `clientUploadContext` with `uploadReference` in generated file metadata and static handler parameters. `handleUpload` no longer receives it because Payload skips uploading files that are already stored.
|
|
1876
1880
|
|
|
1881
|
+
Payload keeps only `_objectKey`, `prefix`, and `signedReceipt` at the top level of `uploadReference`, plus signed `adapterData` when `requiresUploadReceipt` is set. Read any other field your adapter or client added from `uploadReference.clientData`:
|
|
1882
|
+
|
|
1883
|
+
```diff
|
|
1884
|
+
- const objectID = uploadReference.providerObjectID
|
|
1885
|
+
+ const objectID = uploadReference.clientData?.providerObjectID
|
|
1886
|
+
```
|
|
1887
|
+
|
|
1888
|
+
`clientData` is not verified. To trust a value, sign it into the upload receipt as `adapterData` instead. See [Upload receipts](../upload/storage-adapters#custom-upload-receipts).
|
|
1889
|
+
|
|
1877
1890
|
Set `uploadInstructions.enabled`. When false, Payload adds `adminHandler` to the import map without rendering it. When true, Payload also renders it and exposes the instructions and supporting endpoint.
|
|
1878
1891
|
|
|
1879
1892
|
Move access checks into the generator or supporting endpoint that authorizes the upload:
|