Picture of Oliver Foster
RUB vs GRUNT vs new idea
by Oliver Foster - Friday, 18 November 2016, 1:13 PM
 

Here is a chat dump I thought could bring interesting conversations about how to break the Adapt Framework apart into a better and more manageable stack.

Aniket Dharia @aniketdharia Nov 17 16:07
rub is awesome..
is it tested inside AT?

Aniket Dharia @aniketdharia Nov 17 16:20
i checked in AT it is one line change.. can we pass output folder as a argument to ./rub -b?
the differece is awesome.. each time the current command takes 3.7 seconds...
using ./rub -b takes 3 seconds initially and then rebuild each time after it at less then 2 seconds

Oliver Foster @oliverfoster 12:06
i could add an output parameter quite easily

Aniket Dharia @aniketdharia 12:30
https://github.com/adaptlearning/adapt_authoring/blob/master/plugins/output/adapt/index.js#L164-L176
this is where the new buildkit should be integrated..
if build kit works.. I will push it in with live preview while going open source..
will request everyone with your support to take buildkit in adaptlearning
as it has great efficiency..
first task 3.6 secs republish with new theme and extensions 1.1 secs
woooooohhhoooo
I loved it right from the start..
I tried checking the args option in the current build-kit it seems to be missing in there.. also the command "./rub -c -b"
should work...
as currently it just cleans and ignores build..

Oliver Foster @oliverfoster 12:43
i'm not sure open source should adopt that version
it's very messy
i'm working on a version 2
but it has a few small issues at the moment
equally, the exclusions + inclusions aren't supported at the minute
nor are the multi language bits

Oliver Foster @oliverfoster 12:50
it might be better to take some of the ideas from rub and put them into the grunt builder?
i've been doing that piece by piece
it's the separation of the js in "core, libraries and plugins"
that makes it so fast
the core, in my opinion should be built once only
the components are more likely to change
and as the libraries are now in their own folder in both rub and grunt it makes things a lot easier
at the moment grunt compiles the core + plugins together every time, but rub compiles them separately
that's the main difference

[12:54:57] Oliver Foster: actually.... now that I think about it, it might be better to have the core as a distinct api layer, available globally, so we don't have to require it in every time

[12:55:34] Oliver Foster: that way grunt could, really simply, build the core as a single unit without having to worry about enforcing the separation

[12:56:59] Oliver Foster: it'd really easily allow us to use typescript/similar on the core
[12:57:18] Oliver Foster: it'd be a different build process altogether
[12:57:31] Oliver Foster: exposing a single api



This could lead to a global API similar in concept to:

window.Adapt = {
   View: { 
      Adapt: adaptView.js,
      Article: articleView.js,
      Block: blockView.js
      ....
   }
}