Commits on Feb 14, 2015
  1. Validator.context/2 can now set multiple contexts at once

    + Add Validator.prototype.getContexts() to get the defined contexts
    mendezcode committed Feb 14, 2015
Commits on Feb 3, 2015
Commits on Jan 27, 2015
  1. Passing a pure String instead of a Handlebars SafeString to helpers

    Helpers should not receive a SafeString as the text parameter, instead
    they should receive a string. The helpers interface should only get
    native objects, not the template engine's internal string representation.
    mendezcode committed Jan 27, 2015
Commits on Jan 17, 2015
  1. Request handlers now receive a state object

    Controllers now pass the request state as an additional parameter
    to the route handlers. The state can be used to store temporary data,
    which the different route callbacks and handlers can use while
    handling the request:
    get('/records', function(req, res, params, state) {
      state.user = 'john';;
    }, function(req, res, params, state) {
    mendezcode committed Jan 17, 2015
Commits on Jan 15, 2015
Commits on Jan 14, 2015
  1. Protos 0.5.0

    [ci skip]
    mendezcode committed Jan 14, 2015
Commits on Jan 13, 2015
Commits on Aug 14, 2014
  1. Merge pull request #192 from pdehaan/patch-1

    Update qs dependency
    mendezcode committed Aug 14, 2014
Commits on Apr 3, 2014
  1. Add events to control handlebars engine helpers & partials

    The events are handlebars_helpers and handlebars_partials
    mendezcode committed Apr 3, 2014
Commits on Mar 24, 2014
Commits on Feb 16, 2014
Commits on Feb 11, 2014
Commits on Feb 9, 2014
  1. Add Application::multiThreaded(callback) method

    This method allows a function to be converted to a multi-process
    friendly function. Such function will be properly executed on
    all running processes simultaneously.
    Behind the scenes, the master process coordinates the internal
    communication between processes, and passes any arguments to
    all processes, providing a totally transparent behavior.
    The arguments received by the callback should be able to be
    serialized to JSON, since node's IPC serializes data into JSON
    before sending to other processes.
    The method returns a function which does the following:
    1. If Master: tell all workers to run callback with args
    2. If Worker: send to master which will subsequently tell
       all workers to run callback with args.
      var fun = app.multiThreaded(function(val) { ... });
      fun(99); // Will run function with arguments on all processes
    This method provides a fully transparent way to working with apps
    that run on multiple process, making it very simple to run call
    and synchronize between all running processes.
    It is best used after all workers are up, because it relies
    on the available workers reported on node's cluster module.
    The workers_up event can be used to ensure all workers are running.
    mendezcode committed Feb 9, 2014
Commits on Feb 7, 2014
  1. Add static_asset_request and non_static_asset_request events

    These are provided by the asset compiler, when rendering both
    static assets and non static assets.
    These routes are called within the static_file_request event.
    Routes can be stopped using req.stopRoute().
    mendezcode committed Feb 7, 2014
  2. Add controller_request event

    This request will run before routes are dispatched to each
    of the available controllers.
    This adds up to the application request events, now having:
    request, static_file_request, head_request, controller_request
    Routes can be stopped using req.stopRoute(), this will make
    sure no further route processing is done, and the function
    stopping the processing must handle the view rendering.
    mendezcode committed Feb 7, 2014
  3. Add events for all application loading states

    The following events are now available no the app:
    See the commit for details.
    mendezcode committed Feb 7, 2014
  4. Add asset_compiler_all_done event

    The event runs after everything is complete, this includes
    compilation, minification and concatenation.
    mendezcode committed Feb 7, 2014
  5. Ensure environment data is loaded before hooks

    This makes sure the environment data can be mutated by hooks
    set by the application, prior to initialization.
    The modified data is already available on the pre_init event.
    mendezcode committed Feb 7, 2014
  6. Add ability to set multiple values using objects with req.set()

    Multiple values can be set using req.set() as follows:
      one: 1,
      two: 2,
      three: 3
    They can be retrieved normally with req.get().
    mendezcode committed Feb 7, 2014
Commits on Feb 6, 2014
  1. Add config.transientRaw option to render transient views

    This option will provide more control to render transient views,
    which are 404, 500 and regular messages. The application methods
    that render transient views are:
    - app.notFound();
    - app.serverError();
    - res.httpMessage();
    Prior to this commit, such messages were always rendered in raw,
    which means the header/footer templates were never included.
    The config.transientRaw option controls whether or not to display
    the transient views in raw.
    If config.transientRaw is false, it will automatically take the
    value of config.rawViews, to adapt properly for global raw views.
    Additionally, the transient_view event is emitted each time a
    transient view is about to be rendered, which is useful to perform
    specific actions prior to the views being rendered.
    mendezcode committed Feb 6, 2014
Commits on Feb 4, 2014
  1. Asset compiler minor refactor

    * Make sure asset_compiler_compile_all_complete is always emitted
    This fixes a bug which caused assets not to be reloaded, because
    the event was never being emitted when there were no files to
    compile in the public directory.
    The issue caused reloading of assets not to work because it relies
    on this and other events to register its completion (which in turn,
    flushes are the caches, causing the assets to be regenerated).
    * Prevent dual compilation of files on startup
    When watching is enabled, the asset compiler compiled each file
    twice, because each file watched did compile the file on watcher
    initialization. Then the file got compiled once again when the
    asset_compiler_compile_all was emitted.
    This behavior has been fixed, and files are compiled only once
    when starting the application.
    mendezcode committed Feb 4, 2014
  2. Add env_data_loaded event

    mendezcode committed Feb 4, 2014
  3. Add templates_loaded event

    mendezcode committed Feb 4, 2014
Commits on Feb 3, 2014
  1. Implement Application::renderTemplate()

    The method renders application templates, which are not directly
    related to the application's views and partials.
    These are templates used to render system related things, such as
    emails sent to users, or any other type of string that requires
    template functionality (specially due to JavaScript's lack of
    multiline string support).
    Templates are are created on app/templates/ and can be created with
    any registered view engine.
    Templates can be added using the protos template command, as such:
    $ protos template some-template message/template a/b/c/template
    In addition, templates have access to all of the application's locals,
    helpers, partials and shortcodes. The config.shortcodeFilter (option to
    control whether shortcodes will be replaced in the buffer) will also
    apply to rendered templates.
    To access templates, you use the template's path relative to the
    app/templates directory, without the extension, which serves as a
    namespacing system for the templates.
    Here's some code that renders a template:
    var buf = app.renderTemplate('some/template-name', {
      name: "John Doe",
      user: true,
      something: 99
    This will return the rendered template. Notice that an empty string is
    returned in case the template does not exist.
    Additional changes in this commit:
    + Renamed lib/ directory on skeleton with vendor/
    + Add the allowReloadAll option to asset compiler
    + Add Utility::walkDir() method to walk directories recursively
    mendezcode committed Feb 3, 2014