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

Clarify what you're supposed to do on 3 stages of plugin initialisation #75

Closed
Reinmar opened this issue Oct 13, 2015 · 2 comments
Closed
Labels

Comments

@Reinmar
Copy link
Member

Reinmar commented Oct 13, 2015

There are 3 stages:

  1. Static (directly inside module definition) – code executed only once for all editors.
  2. Inside plugin constructor – code executed for every editor.
  3. Inside plugin's init() method – code executed for every editor right after plugins are constructed (may this change in the future?)

The wiki article: https://github.com/ckeditor/ckeditor5-design/wiki/Plugins

It's a bit unclear even for me what's the difference between step 2 and 3. The 3rd step allows you to do async stuff and you can be sure that instances all other plugins are already available in editor.plugins, so if you need their instances or you need to do something asynchronous, then you'll definitely want to use the init() method. But other than that it's not clear if we meant something special, so I think this should be documented.

@Reinmar Reinmar added the wiki label Oct 13, 2015
@fredck
Copy link
Contributor

fredck commented Oct 13, 2015

The 3rd step allows you to do async stuff and you can be sure that instances all other plugins are already available in editor.plugins

Yes, that's the whole point about it.

@Reinmar
Copy link
Member Author

Reinmar commented Apr 20, 2018

Cleaning up outdated discussions. See #186

@Reinmar Reinmar closed this as completed Apr 20, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants