erulabs/skinnyjs — pull request #10 by erulabs (2014-02-28 23:45:31+00:00)
Title: Bump to 0.0.48

0.0.48 brings quite a few improvements:

Controller actions which do not have corresponding views now do not need to return { skip: true }; While it's still a good idea to do this because it's not always clear what your code is returning (in the case of coffeescript this is especially true), you dont _have to_. If a controller returns undefined (ie: no return) and the view exists, everything will happen as it has in the past. However, if the view _doesnt_ exist and the controller returns undefined, skinny will now _assume_ you meant "skip: true".

MongoDB actions have all been improved substantially. This includes catching common errors, returning the _inserted object to .save() (so that you can get the mongodb ID back from a .save()), and improvements to the code for .find, etc. Complex searches and particularly sorting are still clumsy, and it's still recommended to app.db.collection('something').method... if you're doing any heavy lifting.

Multiple routes which have the same URL can now be expressed as an "array of routes" in app.routes. I'll provide examples of this in the template project, but now it means:
'/someRoute': [ { method: 'GET', ... }, { method: 'POST', ... } ]
behaves as expected.

A complete precompile phase has been added. You can disable this with "skinny.precompile = false". This implies that configs/compiler.js is included before any other file (which it explicitly is). It will when scan all directories in skinny.cfg.layout and compile all matching files _before_ it begins to include them into the application. NOTE THAT THIS BREAKS BACKWARDS COMPATIBILITY WITH OLDER SKINNY PROJECTS. You'll need to copy /lib/templateProject/configs/compiler* to your existing project.

Small quality-of-life improvements such as exposing app.http (server is still app.httpd), code cleanup and express urlencoding by default.

Logging has been improved and all logging now occurs via skinny.log(). That method is easily overridden for custom logging.