Skip to content
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

Generic node factory #3459

Closed
wants to merge 2 commits into from
Closed

Conversation

nklhtv
Copy link
Contributor

@nklhtv nklhtv commented Aug 22, 2024

Checklist

  • yarn typecheck
  • yarn lint:fix
  • yarn test
  • yarn brl
  • yarn changeset
  • ui changelog

Copy link

changeset-bot bot commented Aug 22, 2024

🦋 Changeset detected

Latest commit: 5833cde

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 57 packages
Name Type
@udecode/plate-core Major
@udecode/plate-common Major
@udecode/plate-utils Major
@udecode/plate-alignment Major
@udecode/plate-autoformat Major
@udecode/plate-basic-elements Major
@udecode/plate-basic-marks Major
@udecode/plate-block-quote Major
@udecode/plate-break Major
@udecode/plate-callout Major
@udecode/plate-caption Major
@udecode/plate-cloud Major
@udecode/plate-code-block Major
@udecode/plate-combobox Major
@udecode/plate-comments Major
@udecode/plate-cursor Major
@udecode/plate-date Major
@udecode/plate-diff Major
@udecode/plate-dnd Major
@udecode/plate-emoji Major
@udecode/plate-excalidraw Major
@udecode/plate-find-replace Major
@udecode/plate-floating Major
@udecode/plate-font Major
@udecode/plate-heading Major
@udecode/plate-highlight Major
@udecode/plate-horizontal-rule Major
@udecode/plate-indent-list Major
@udecode/plate-indent Major
@udecode/plate-juice Major
@udecode/plate-kbd Major
@udecode/plate-layout Major
@udecode/plate-line-height Major
@udecode/plate-link Major
@udecode/plate-list Major
@udecode/plate-math Major
@udecode/plate-media Major
@udecode/plate-mention Major
@udecode/plate-node-id Major
@udecode/plate-normalizers Major
@udecode/plate-paragraph Major
@udecode/plate Major
@udecode/plate-reset-node Major
@udecode/plate-resizable Major
@udecode/plate-select Major
@udecode/plate-selection Major
@udecode/plate-serializer-csv Major
@udecode/plate-serializer-docx Major
@udecode/plate-serializer-html Major
@udecode/plate-serializer-md Major
@udecode/plate-slash-command Major
@udecode/plate-suggestion Major
@udecode/plate-tabbable Major
@udecode/plate-table Major
@udecode/plate-toggle Major
@udecode/plate-trailing-block Major
@udecode/plate-yjs Major

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

Copy link

vercel bot commented Aug 22, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
plate ✅ Ready (Inspect) Visit Preview 💬 Add feedback Aug 22, 2024 4:36pm

@nklhtv
Copy link
Contributor Author

nklhtv commented Aug 22, 2024

That is a non breaking change which will allow me to create nodes without the need of declaring every attribute as optional.
for example thats how one of my custom elements looks like:

export interface MyCustomTElement extends TElement {
  id: string;
  type: "my-custom-element";
  language: Language;
  children: TText[];
  ....
  something: Else;
}
....
export type EditorValue = (MyCustomTElement | MyOtherCustomTElement)[];

The name of the option, createBlock, might not be the best thogh.

Copy link
Member

@zbeyens zbeyens left a comment

Choose a reason for hiding this comment

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

Since it's a core plugin, and you can override editor.blockFactory in your own plugin, I don't think there is much added-value to do this, especially with the incoming Plate 37 (there is so much changes I can't resume it here)

@nklhtv
Copy link
Contributor Author

nklhtv commented Aug 22, 2024

nd you can override editor.blockFactory in your own plugin, I don't think there is much added-value to do this, especially with the incoming Plate 37 (there is so much changes I can't resume it her

That's what i do, i override almost all core plugins. Will stick to that approach then. Thank you.

@nklhtv nklhtv closed this Aug 22, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants