Skip to content

fix(richtext-lexical): incorrect UploadData types #11288

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Feb 19, 2025
Merged

Conversation

AlessioGr
Copy link
Member

This PR fixes the UploadData type that was weakened in a previous PR, causing a breaking change. It also improves the newly added UploadDataImproved type by bringing back its support for generated types and using the UploadCollectionSlug type helper to restrict collection slugs to upload-enabled collections.

@AlessioGr AlessioGr enabled auto-merge (squash) February 19, 2025 20:03
@AlessioGr AlessioGr merged commit 2612756 into main Feb 19, 2025
74 checks passed
@AlessioGr AlessioGr deleted the fix/uploaddata-type branch February 19, 2025 20:22
@@ -8,34 +8,29 @@ export const UploadJSXConverter: JSXConverters<SerializedUploadNode> = {
upload: ({ node }) => {
// TO-DO (v4): SerializedUploadNode should use UploadData_P4
const uploadDocument = node as UploadDataImproved
if (typeof uploadDocument.value !== 'object') {
if (typeof uploadDocument?.value !== 'object') {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I guess ts was asking for optional chaining here? any reason why it is needed now? afaik value should be defined

Copy link
Contributor

🚀 This is included in version v3.25.0

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants