Skip to content

Basepattern migration - #5

Merged
thet merged 2 commits into
masterfrom
basepattern-migration
Nov 29, 2026
Merged

thet merged 2 commits into
masterfrom
basepattern-migration

Conversation

@thet

@thet thet commented Nov 29, 2026

Copy link
Copy Markdown
Member

No description provided.

thet added 2 commits November 29, 2026 05:51
pat-tinymce is now based on BasePattern:

- The existing destroy method now also calls the BasePattern destroy and
  removes the pattern instance from the element.

- The `plugins` attribute is now per pattern instance. Before, it was shared
  between all instances via the prototype.

Breaking change for JavaScript users: the default export is now the pattern
class. The jQuery plugin and the static `init($el)` method are gone.

Ref: Patternslib ADR 0009

Assisted-by: Claude Opus 5.5
…ialization.

When the pattern was destroyed while TinyMCE and its plugins were loading,
the editor was created anyway afterwards and was never removed. Now the
initialization stops when the pattern was destroyed while loading, and an
editor which finished initializing after a destroy is removed again,
restoring the textarea in inline mode.

The inline editable element is now created after the plugins are loaded, so
that nothing needs to be cleaned up when the pattern is destroyed while
loading.

This relies on the `destroyed` flag of BasePattern, which is set by
`destroy()` since @patternslib/patternslib 9.12.0. With older versions the
pattern behaves as before.

Assisted-by: Claude Opus 5.5
@thet
thet force-pushed the basepattern-migration branch from 280bafd to 8a8d08b Compare November 29, 2026 10:08
@thet
thet merged commit b025fe2 into master Nov 29, 2026
1 check passed
@thet
thet deleted the basepattern-migration branch November 30, 2026 07:59
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