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

Feature: allow for plugins to reload dynamically #390

Merged
merged 10 commits into from
Oct 6, 2022

Conversation

elpoelma
Copy link
Contributor

@elpoelma elpoelma commented Oct 4, 2022

This PR includes the following features:

  • The option for plugins to be dynamically reloaded: when changing the plugins array which is passed to the editor-component, a restart/rebuild of the app is no longer required.
  • Introduction of some new dummy plugins: the editor now contains highlight, code-mark and inline-components dummy plugins.

Additionally, this PR also changes the interface of some classes:

  • Registering widgets, marks and inline components now happen on the transaction-level. The corresponding methods are moved from the Controller to the Transaction class.

  • The plugin initalize method signature has changed, it now also expects a transaction object:

    initialize(
     transaction: Transaction,
     controller: Controller,
     options: unknown
    )
    
  • Plugins can now also implement an optional willDestroy method. This is useful to remove listeners which have been added in the initialize method.

    willDestroy(transaction: Transaction)
    

@elpoelma elpoelma added enhancement New feature or request breaking Breaking api changes labels Oct 4, 2022
@elpoelma elpoelma requested a review from abeforgit October 4, 2022 15:41
@elpoelma elpoelma changed the title Feature/tedi plugin reload Feature: allow for plugins to reload dynamically Oct 4, 2022
@abeforgit abeforgit merged commit 9e99b97 into transactional-edits Oct 6, 2022
@abeforgit abeforgit deleted the feature/TEDI-plugin-reload branch October 6, 2022 09:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
breaking Breaking api changes enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants