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

Stackedit modularization: Plugins folders #595

Closed
wants to merge 6 commits into from

Conversation

jesperronn
Copy link

UPDATE 2014-11-04: Need an example for testing, so don't merge until we know it works

To follow up on #542, this branch provides a modularized structure for loading plugins into Stackedit

Usage: PLugins are now defined in the /public/plugins folder and are activated one place only: in the file public/res/plugins.js (and only once in this file as opposed to previously)

Work done:

  • All providers moved into new plugins structure
  • All specific extensions moved into one place: public/res/plugins.js
  • All specific extensions removed from publisher.js, synchronizer.js, sharing.js

And it already works as is!

How it works: All plugins are registered in public/res/plugins.js, which now loads each of the defined plugins by sending them to Publisher, Synchronizer, Sharing for initialization. After that the onPluginsLoaded event is submitted.

This fully solves the means of #542 but could be improved further so that for instance html snippets relevant for each plugin can be put in that specific directory and loaded only if relevant.

Tobias Haagen Michaelsen and others added 6 commits October 30, 2014 14:49
Instead of having every model which might need a provider having to
specify every possible provider as input argument, we now have a plugin
model which can expose a list of providers, which the event manager then
will notify about when they are loaded.

Conflicts:
	public/res/publisher.js
	public/res/sharing.js
@benweet
Copy link
Owner

benweet commented Nov 3, 2014

I don't think it would work (have you tested it?). synchronizer, publisher and sharing modules are not supposed to be linked to all providers. Some providers are meant to be used by publisher but not by synchronizer...

@jesperronn
Copy link
Author

Thanks for input. In the original code synchronizer, publisher and sharing were included and if they respond to certain methods, they were included.

For example, provider.js loads the js-file as a Provider module if it responds to the property isPublishEnabled (and it must be true)

Are there specific synchroinzers/publishers/sharing components you know will give problems? I have not tried with all of them (don't use all). But the principle applied here is that it should be included if the js-file responds to certain methods.

I will gladly test with an example.

And I should perhaps also document which methods should be present (undocumentded for now in developer-guide.md )

@jesperronn jesperronn changed the title Stackedit modularization: Plugins folders WIP: Stackedit modularization: Plugins folders Nov 4, 2014
@jesperronn
Copy link
Author

@benweet do you have an example of this:

Some providers are meant to be used by publisher but not by synchronizer

Also, the interface between publisher, synchronizer and sharing would be more clean if they expose different methods, so that any object that implements specific methods could be a publisher, synchronizer, whatever.

I really need your guidance here so that this branch can eventually be merged

@benweet
Copy link
Owner

benweet commented Dec 7, 2014

Hi, I prefer not to merge your work as I'm working on a complete rewrite of the project. Sorry about that.

@jesperronn
Copy link
Author

@benweet thanks for the update. any pointers, branches, ideas that you want to share to get feedback?

@benweet
Copy link
Owner

benweet commented Dec 7, 2014

No, it's a private repo at the moment. I'll let you know as soon as it become public.

@jesperronn jesperronn changed the title WIP: Stackedit modularization: Plugins folders Stackedit modularization: Plugins folders Dec 30, 2014
@benweet benweet closed this Oct 3, 2017
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.

None yet

2 participants