Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Reorganized the repo, creating a src and dist directory as well as defining the build process using Grunt.
Structure
RequireJS
$LABjs has been replaced with RequireJS as it provides plug-ins for css, text, and maps file paths to simple names so we can declare deps as
require(['jquery', 'angular'])
and at the same times have deps which depend on others. The project now uses the r.js optimizer as well to concatenate files and remove the files that are no longer needed.Notes
"vendor/jquery/jquery-1.8.0.js" -> "jquery"
. This allows us to simply switch out the source for a module in the future, and makes things a lot more readable.$templateCache
. When in use, the app failed to boot even though the templates were loading properly. (seemed like the initial refresh event never got called). Couldn't figure out how to make it work so it's just sitting invendor/require/tmpl.js
.$scope.require
which. See the bettermap module for an example.kibanaPanel directive
In order to ensure that a panel's module is loaded before its template, the kibanaPabel directive was modified to do the heavy lifting (I first created a loadKibanaPanel directive, but it seemed strange to have both). The directive will first use RequireJS to load the panel's module.html, if it finds a controller within the template, it will them load module.js. Once both are loaded, the module is inserted into the DOM and compiled.
Build Process
Thanks to how awesome grunt and its plug-ins are, this was probably the simplest part of this whole process.
The steps carried out by the build process are as follows:
<a ng-click="function('arg')"></a>
<a ng-click='function("arg")'></a>
this is my first time setting-up up a build process, critisism appreciated
Up to date
I have manually applied changes made since I forked the repo, since filenames don't map properly. I've stashed some patch files in the project root to keep track of what I've merged, but obviously those don't need to be merged.