Skip to content

Update Content Editor Packages

What does this MR do?

This MR upgrades Tiptap packages used by the Content Editor. You can see the list of upgraded packages in the table below. This Tiptap upgrade introduces breaking changes in the InputRule API. An input rule is a mechanism to convert text that the user types into something else, i.e. headings, lists, emojis, etc.

2021-10-19_12.08.54

API Breaking changes

In https://github.com/ueberdosis/tiptap/pull/1997, the Input Rule API changed in this way:

// old
markInputRule(/(?:^|\s)((?:\*\*)((?:[^*]+))(?:\*\*))$/gm, this.type)

// new
markInputRule({
  find: /(?:^|\s)((?:\*\*)((?:[^*]+))(?:\*\*))$/gm,
  type: this.type,
})

This MR fixes the breaking changes in the Content Editor’s custom extensions. Most of the changes in content_editor/extensions are switching from the old pattern to the new one

Unit test improvements

We discovered that some of the input rules implemented in the Content Editor didn’t have test coverage. We added new test specs to address this situation and introduced two test helpers: triggerNodeInputRule and triggerMarkInputRule. The purpose of these test helpers is making input rule tests more readable and maintainable.

All tests follow the same pattern:

  • Create a expected document that we use to validate the input rule applied the correct changes (or wasn’t applied at all).
  • Trigger the input rule.
  • Assert that the editor document and the expected document are the same.

Does this MR introduce user-facing changes?

No, it doesn’t.

Are there other changes not related to input rules?

Yes, there is one change not related to input rules.

Updated packages

Package Type Update Change
@tiptap/core (source) dependencies patch ^2.0.0-beta.118 -> ^2.0.0-beta.125
@tiptap/extension-blockquote (source) dependencies patch ^2.0.0-beta.15 -> ^2.0.0-beta.19
@tiptap/extension-bold (source) dependencies patch ^2.0.0-beta.15 -> ^2.0.0-beta.19
@tiptap/extension-bullet-list (source) dependencies patch ^2.0.0-beta.15 -> ^2.0.0-beta.18
@tiptap/extension-code (source) dependencies patch ^2.0.0-beta.16 -> ^2.0.0-beta.20
@tiptap/extension-code-block-lowlight (source) dependencies patch 2.0.0-beta.41 -> 2.0.0-beta.47
@tiptap/extension-gapcursor (source) dependencies patch ^2.0.0-beta.24 -> ^2.0.0-beta.27
@tiptap/extension-hard-break (source) dependencies patch ^2.0.0-beta.21 -> ^2.0.0-beta.24
@tiptap/extension-heading (source) dependencies patch ^2.0.0-beta.15 -> ^2.0.0-beta.18
@tiptap/extension-horizontal-rule (source) dependencies patch ^2.0.0-beta.21 -> ^2.0.0-beta.24
@tiptap/extension-image (source) dependencies patch ^2.0.0-beta.15 -> ^2.0.0-beta.19
@tiptap/extension-italic (source) dependencies patch ^2.0.0-beta.15 -> ^2.0.0-beta.19
@tiptap/extension-link (source) dependencies patch ^2.0.0-beta.20 -> ^2.0.0-beta.23
@tiptap/extension-ordered-list (source) dependencies patch ^2.0.0-beta.16 -> ^2.0.0-beta.19
@tiptap/extension-strike (source) dependencies patch ^2.0.0-beta.17 -> ^2.0.0-beta.21
@tiptap/extension-table (source) dependencies patch ^2.0.0-beta.31 -> ^2.0.0-beta.34
@tiptap/extension-task-item (source) dependencies patch ^2.0.0-beta.18 -> ^2.0.0-beta.21
@tiptap/extension-task-list (source) dependencies patch ^2.0.0-beta.17 -> ^2.0.0-beta.18
@tiptap/vue-2 (source) dependencies patch ^2.0.0-beta.57 -> ^2.0.0-beta.60
prosemirror-test-builder devDependencies patch ^1.0.4 -> ^1.0.5
prosemirror-view dependencies patch ^1.20.2 -> ^1.20.3

MR created with the help of gitlab-org/frontend/renovate-gitlab-bot


Release Notes

ueberdosis/tiptap

v2.0.0-beta.125

Compare Source

v2.0.0-beta.124

Compare Source

v2.0.0-beta.123

Compare Source

v2.0.0-beta.122

Compare Source

v2.0.0-beta.121

Compare Source

v2.0.0-beta.120

Compare Source

v2.0.0-beta.119

Compare Source

prosemirror/prosemirror-test-builder

v1.0.5

Compare Source

prosemirror/prosemirror-view

v1.20.3

Compare Source


Configuration

📅 Schedule: At any time (no schedule defined).

🚦 Automerge: Disabled by config. Please merge this manually once you are satisfied.

Rebasing: Renovate will not automatically rebase this PR, because other commits have been found.

👻 Immortal: This MR will be recreated if closed unmerged. Get config help if that's undesired.


  • If you want to rebase/retry this MR, check this box.

This MR has been generated by Renovate Bot.

Edited by Enrique Alcántara

Merge request reports

Loading