Maybe it’s because I was so overwhelmed by the dozen files that made the previous combination tick, but I was ready to kiss CanJS when I saw the directory tree contained a grand total of four files. Yes, I know, four large files are not better than a dozen small ones, but it seemed that an application as simple as this Todo list shouldn’t need such granularity.
The CanJS homepage is a hoot. You can go to the download button, and instead of just sending a giant file your way, it asks you what kind of templates you’d like and what modules you’d like to include. Then it gives you the option to minify the download. So you get exactly what you’d use in production.
The self-description of the framework is as follows:
Frankly not very exciting, but that’s par for the course so far. The index.html is polluted, as was to be expected, by Handlebars directives – but you don’t need those, you can use something else. The app.js (the main entry point) simply sets up the routes. There is a model file, todo.js, that handles both the item and the list (which is a static member of the item).