Hey,
I've done an initial prototype of Adapt's initial loading that can be viewed here.
What this proof of concept proves is the following:
- Use RequireJS to load our core modules into a single file based upon their dependancies.
- Register a component with Adapt and create it using Adapt's API.
- Load components into the main file (I understand this will be done in a slightly different way)
- Create a plugin that prints out hello world.
Although the src folder isn't up to the final process - the build folder is what is meant to be run in the browser.
I have setup the following grunt processes:
grunt - this will build the Handlebars templates and preprocess the Less files into CSS files and then 'watch' the files for any changes.
grunt build - this will build all the source files together putting the dependancies into the correct order.
I envisage a Grunt process that spawns off and fetchs the components and extensions and their dependancies.
What I like about RequireJS is that is supports some great features, is widely used and documentation is great. We can use it in the src folder as well as the build folder, without having to compile our core code.
It does everything Browserify does - i.e. put all our scripts into a closure to lock away data. We can also write the syntax as a commonJS module definition. We're also not locked into using NPM (which for me should be used for node modules not front end dependancies) so we could use something like BowerJS that has been built as a front end dependancy manager - and my favourite thing about it - is we can have our own Bower server.
This leads us to having a nice separate dependancy server just for Adapt plugins. This would fit nicely with our editor as there could be one central registry and no need to avoid naming collisions.
I still think there's much to do here but in terms of a first glimpse/prove of concept it's something we can work from - discuss ideas and alternatives. Please feel free to play/prototype with it by branching off.
Daryl