Skip to content
This repository has been archived by the owner on Oct 4, 2022. It is now read-only.

Latest commit

 

History

History
31 lines (19 loc) · 1.88 KB

DESIGN DECISIONS.md

File metadata and controls

31 lines (19 loc) · 1.88 KB

Design decisions

The purpose of this document is to document why certain choices have been made.

Technology choices

Lodash templates

To improve the readability and maintainability of our HTML, we've chosen to use lodash templates. These can be found in the templates folder.

The templates are precompiled using lodash-cli, this means the HTML is compiled into javascript. To see this in action look at the compiled template.js file.

Other options for the template language were underscore templates, mustache or handlebars. We decided against using mustache because it's options were limited for dynamic templating. We decided on using lodash because it is comparable to the other options and we were already planning on using lodash for other parts of our library.

Modules

We considered different module styles when introducing modules: AMD, node style and ES6 style. We decided against using AMD because we don't need any asynchronous operations. ES6 style modules are still very much in their infancy so for now we use node style modules until we think we can switch to

To provide a minified javascript file that can be included as is we use browserify to inline all the required dependencies. Browserify looks at the require calls and adds these dependencies in the concatenated file.

External links