Hi, I want to make my own discourse plugins and what languages I need to know and what tools/programs/apps I need to do so. I appreciate it.
AI-generated summary
In a discussion titled ‘How can I make my own Discourse plugins?’, Blinq asks what languages and tools are needed to build plugins. merefield responds with a beginner’s guide, recommending reading beginner tutorials and studying simple, popular plugins to understand their structure. Key skills include mastering JavaScript (specifically ECMAScript, used in both web and Node.js contexts as clarified in post 4), Ember.js, Ruby, Git/GitHub, and HTML/CSS. Tools suggested include Atom with the Nuclide add-on and a local or cloud-based Discourse development instance, optionally enhanced with the outlet locations plugin. Blinq asks if they can start with a simple plugin.js file, but merefield clarifies that Discourse plugins use .js.es6 and .rb files, and involve complex concepts like Ember’s MVC architecture, serialization, and routing. The advice is to install and modify an existing plugin first, rather than starting from scratch, and to not skip foundational reading — as the learning curve is steep due to multiple technologies and Discourse’s unique conventions.
I’ve only just started but here’s my ‘starter for 10’ to get you going:
Read:
- these
- this
- Try and read the code on the simplest, but popular plugins and see if you can understand what they are doing (this is not always easy, especially with the complexity of dealing with multiple files and the sometimes brutal functional brevity of javasctipt, but persevere)
You need to learn:
- Lots of Javascript (look no further than @mpj’s Fun Fun Function excellent & fun (!) videos (thanks man!))
- Lots of Ember & a bit of Ruby (Start here)
- Github & Git
- (And HTML/CSS of course!)
Install:
- Atom and consider the excellent nuclide add-in that facilitates remote file tree navigation & editing
- A dev instance of Discourse using this guide, preferably on a cheap cloud server, and probably install the outlet locations plugin to make things more visual.
I appreciate it! What “kind” of JavaScript, like web or node.js?
ECMAScript. It’s used in both ‘places’.
Would I just make a new atom file named plugin.js and work on a plugin there?
No. There are no ‘.js’ files. JavaScript is mainly stored in ‘.js.es6’ files. Ruby in ‘.rb’ files. It’s more complex. Take a look at existing plugins for example file arrangement and content. You need to understand serialisation, Ember templates, the Router and the Model, View, Controller concept.
I would highly recommend you install a simple existing plugin of your choice and try modify it in some sensible way.
Dont skip on the reading.
I think it’s fair to say is a pretty steep learning curve because there are a lot of concepts to get to grips with, two languages, one framework and Discourse’s ‘way of doing things’ …