Closed lkuper closed 9 years ago
As part of addressing this bug, we should also update our existing examples, the tutorial, and everything else we've got to import the single minified script.
Still on my todo list, although @jsreeram, feel free to take it if you have time.
All the JS minification tools I've found either require Node or Java. My current best idea for how to do this is to use Grunt (a Node package) to concatenate and then minify the files.
I have added a single include file dist/RiverTrail.js and have updated the examples. On my local copy, I have a pre-commit hook that does this concat'ting. Perhaps this is the simplest solution ? If not, we can use Grunt. No minification/uglification as yet - I haven't added the source map and we want to keep it debuggable in the meanwhile.
I got concat/minify set up with Grunt, and I'd like to close this issue, but first we need to update the interactive shell and Tour de Block to use the single include. I thought this would be straightforward, but it caused errors on the interactive shell. And if I change the order of concatenation to match the old order of includes, then we get an error caused by "use strict" in one of the earlier files leaking into a later file.
Probably the right way to fix this is to clean up the code to follow strict mode as much as possible, but if that's not possible then we need to use "use strict" within function scope only. I'll work on this.
This appeared to be a bug in combine which I have pushed a patch for. On my setup, with the latest RiverTrail.js copied over, this make the interactive shell work for me.
@jsreeram Great! Thanks, it works for me now too. I just updated the submodules for RiverTrail-interactive and RiverTrail-TourDeBlock, and also updated the tutorial and test page in this repo to use the single include. I don't think there are any more places that don't use the single include now, so I'm closing this.
People using River Trail should only have to include a single script that concatenates all the existing ones, ideally minified.