Skip to content

DRAFT: Decorations API #6239

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

Draft
wants to merge 7 commits into
base: next
Choose a base branch
from
Draft

DRAFT: Decorations API #6239

wants to merge 7 commits into from

Conversation

bdbch
Copy link
Member

@bdbch bdbch commented Apr 5, 2025

Changes Overview

This PR is currently only a draft and is meant to keep a discussion on the ongoing development of the Decorations API.

Implementation Approach

The Decoration API implements a new DecorationManager as well as adding new options to the ExtendableConfig of Extensions (Node, Mark and Extension classes) that allow developers to add decorations without touching the underlying Prosemirror APIs making it easier and more integrated.

Difficulties

  1. Performance: Right now performance is a big bummer as we need to expose the correct API to allow users to control the recalculation of each decoration set while keeping it simple enough to not make the API more complicated than the vanilla Prosemirror API
  2. React / Vue components: Those are also dragging performance down. Rendering a React component via the ReactRenderer works fine but since Decorations are often recreated, leads to performance drops when adding to many decorations and then editing / shifting content around requiring recreations of said React components.

Testing Done

N/A

Verification Steps

N/A

Additional Notes

You can check out the status of this PR in the /src/Experiments/DecorationsAPI/React/ demo.

Checklist

  • I have created a changeset for this PR if necessary.
  • My changes do not break the library.
  • I have added tests where applicable.
  • I have followed the project guidelines.
  • I have fixed any lint issues.

Copy link

changeset-bot bot commented Apr 5, 2025

⚠️ No Changeset found

Latest commit: 2dfabbd

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

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

Copy link

netlify bot commented Apr 5, 2025

Deploy Preview for tiptap-embed failed. Why did it fail? →

Name Link
🔨 Latest commit 2dfabbd
🔍 Latest deploy log https://app.netlify.com/sites/tiptap-embed/deploys/680edd430df6960008e31eb0

@bdbch bdbch marked this pull request as draft April 5, 2025 02:19
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.

1 participant