From 0f6a4cf47f27c5e7c024098d2656ee9db59371d1 Mon Sep 17 00:00:00 2001 From: tobscure Date: Fri, 19 Dec 2014 21:38:21 -0800 Subject: [PATCH] Created Extensions (markdown) --- Extensions.md | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) create mode 100644 Extensions.md diff --git a/Extensions.md b/Extensions.md new file mode 100644 index 0000000..3f6ae43 --- /dev/null +++ b/Extensions.md @@ -0,0 +1,25 @@ +At its core, Flarum actually contains [very few features](Features). It is really just a bare-bones platform for discussion. All of the power comes in the form of **Extensions**. + +Currently, no Extensions actually exist. The priority in development is to build out the core while thinking carefully about what Extensions will need to do and how they will be able to do it. Thus, the following discussion is mostly theoretical. + +Usually, an Extension will need to add functionality to all three layers of the application: the Laravel layers (core, API), and the Ember.js app. For example, a *Sticky* extension would need to: + +- Run a migration to add a “sticky” column in the domain/persistence layer +- Add its own commands and domain events to change a discussion’s sticky status +- Alter discussion-reading/writing API endpoints +- Add a sticky indicator and controls to the Ember app + +Various strategies are planned/implemented to allow this kind of extensibility: + +## Laravel + +- Listening for domain events +- Listening for standard events (e.g. when a discussion’s attributes are being serialized for an API endpoint) +- Adding JS/CSS files to be included with the Ember app via an asset manager + +## Ember + +- A “hook” template helper, so that plugins can hook on and render their own templates at certain positions +- Overriding templates completely +- Overriding methods and adding event listeners with Ember.Object’s reopen and reopenClass +- Use of ContainerViews so that controls can be easily manipulated in a consistent manner, without altering templates \ No newline at end of file