-
Notifications
You must be signed in to change notification settings - Fork 2.7k
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
Structure: Modularize build of Stackedit #542
Comments
One other strategy could be to add a node package, like, for instance, For example:
Still, this would probably require all hooks to work so that the events/functionality can be insert correctly. |
To get rid of MathJax, just remove the |
Sorry to bother, this is NOT just about getting rid of MathJax. See #549 and #551 for that.This is about Stackedit being more modular, and thus making it easy to add/remove functionality. This will eventually bring faster load times, faster build times and smaller payloads. I suggest your comment fits better for #549 and #551. Also I cannot see how this issue is solved or addressed? Maybe I am missing a point. I will gladly add to developers guide if you can help me understand how I can easily create a new plugin where all functionality is encapsulated in it's own area (folder, dependency, or similar). Please, once again, help me understand :) |
Indeed, I've read too quickly, sorry about that. I guess your question is about refactoring the whole project. StackEdit is organized around few big modules like core, fileMgr, synchronizer, publisher (as described in the architecture diagram here). These modules are here since the beginning (including the providers and helpers mechanism). After that I tried to create patterns as soon as I added some features, so I ended up with the eventMgr and the extension pattern. Today, the number of features is quite significant so I guess the best strategy for a whole refactoring is to list each feature and try to define new patterns that could tackle them all (the developer guide describes most of them, but may not be up to date..) About DOM in general (elements, events, templating...), I guess there are some good frameworks out there (like angular.js) that I didn't consider at that time. Though, it has to be flexible enough to integrate with the editor and the layout modules. |
@benweet I have some ideas on how to refactor and modularize, at least for the publisher/synchronizer/provider structure.. Will make a pull-request as WIP (work in progress) so that I can get your input on it. |
Closing this as too old. |
Obviously an enhancement.
Stackedit has grown very big in terms of included javascripts, html, libraries.
As a developer, I want to be able to build only the parts I need. For example, if I don't need Mathjax, I want to be able to create a build without Mathjax.
This will probably require a more clean way to define extensions (or maybe I just have not figured out how to do it the 'right' way).
Let's discuss how the modularity could look. One example could be a /plugins folder with the following structure:
I got this idea when looking at where hooks are added for example for Mathjax, MonetizeJS and Google Picasa integration. There is probably a thing or too I am missing out. For example, where is the correct place to attach browser events (such as click) to DOM elements?
I would like your feedback on this. Also, I am not aware if this structure is already possible. Furthermore, what do you think it would take to make the structure more modularizable?
The text was updated successfully, but these errors were encountered: