Picture of Matt Leathes
some ideas for improvements to the Adapt output
by Matt Leathes - Friday, 10 April 2015, 6:31 PM
 

We've been discussing some ideas for improvements to the Adapt output on the chat today which we'd like to put out to the community for feedback.

First up - 'uglifying' the JSON files. It would be better for performance if the contents of the various JSON files in the build were 'uglified' - which essentially just means putting all the data on a single line (you can actually see an example of this if you look at config.json in the output). In a large JSON file, this can make quite a difference to file size - in my tests, a 94KB components.json file drops to 57KB when uglified, nearly halving load time. Clearly this means it is far less human-readable, but it's easy to 'prettify' it again, either using online tools or browser extensions - or we could easily add a grunt/gulp task to do this for you.

Next item discussed was some method of ensuring that plugins you weren't actually using would be excluded from the output, thereby reducing the footprint of the JavaScript/CSS. A few ideas as to how to determine what plugins weren't required were bandied around but I don't think we really came to any solid conclusions, so any thoughts about how best to do this would be very welcome.

Finally we discussed what to do about what we termed 'helper plugins'. These are plugins that you might well want to take advantage of during development/testing - for example, Tom Greenfields' excellent adapt-inspector, adapt-forceLoad and adapt-teleporter plugins - as well as Kineo's adapt-cheat plugin - but which you wouldn't want to leave in any final 'production-ready' build (esp. the adapt-cheat plugin!). The proposal for this was to have some way of tagging them as being 'helper plugins' - which would then allow the authoring tool to warn you after selecting 'publish' that you were using such plugins, giving you the option to exclude any/all of them from the output.

Please let us know your thoughts about these ideas.

Picture of Brian Quinn
Re: some ideas for improvements to the Adapt output
by Brian Quinn - Monday, 13 April 2015, 2:58 PM
 

Hi Matt,

Thanks for posting this. 

First up I think uglifying the JSON is an easy win, and should be the default for any grunt build or grunt server-build output.

Regarding reducing the footprint of the Javascript/CSS by only specifying which plugins are used, with the authoring tool we have this information already.  Although nothing is done with it in terms of the build right now, we could probably add something into the grunt server-build option to support this.

About the helper plugins, a way of tagging them asnot for production would be good.  It might be a good idea for the authoring tool to have a 'debug' version of courses, separate from the published version, which enabled functionality like the plugins you mentioned.

Regards,

Brian

Picture of Matt Leathes
Re: some ideas for improvements to the Adapt output
by Matt Leathes - Wednesday, 15 April 2015, 2:19 PM
 

Great stuff. I suggest that uglifying the JSON is something we might as well do as part of the v2 release.

The other two we can park for future exploration/development

Picture of Helen Bailey
Re: some ideas for improvements to the Adapt output
by Helen Bailey - Thursday, 16 April 2015, 9:40 AM
 

With regards plugins from a very simple perspective - I've installed some that don't really work properly so I'd like a button to delete them as deleting every trace I can find of them doesn't seem to eraicate them from the list!!