sezione

Broke - A Javascript Framework inspired by the Django Web Framework

Broke Javascript Framework

On Github

The Broke Javascript Framework is a porting of the fantastic Django Web Framework on Javascript. It summarizes all the best concepts present in Django like url resolving, decoupling, DRY principle, project-specific settings and a pretty simple template engine. It could be put in the big Javascript MVC frameworks group outside there, but, as Django is, this is more a MTV (Model-Template-View) framework. Yet another Javascript MVC framework.

Please refer to the examples shipped with the release for a full understanding. Live demo

Summary

For everyone of you who do not know the Django Web Framework and couldn't care less, here is a summary of the philosophy behind Broke:

Broke take advantage of the latest 'onhashchange' event, if present, and if not it will fake one. Generally Broke uses the 'elements' method to trigger 'broke.request' events instead of the 'hashchange' method. Please refer to the 'events' documentation for more insight.

I'll try to summarize the pros and cons of both solutions:

  1. hashchange: * pros: * you can bookmark the page * the forward/backward buttons, changing the hash, trigger a request * cons: * poor control over the event happening in the page * whenever a link tries asks for the same url twice, it does not get intercepted twice but just once, the first time the hash changes (which could both be good and bad)

  2. elements:

  3. pros: -you can bookmark the page

    • more control over the event, since you can prevent default actions on forms/links/whatever, like submit or visualization of the hash on the page url
    • every time you trigger a request, it gets intercepted by broke
  4. cons:

    • the forward/backward buttons do not trigger any kind of events on the page, so going backward and forward does nothing. So far I could not think of a good method to prevent this

For a good understanding, please refer to the examples shipped with Broke.

TODOs and BUGS

* Internationalization support
* Improving the template engine
* A better documentation (the actual documentation is a rip-off of the original Django documentation)

Posted on febbraio 3, 2010

About

Brokenseal รจ Davide Callegari, un giovane professionista con la passione per la programmazione e il web design.

Tag cloud

Archive

Credits

ponybadge

Django powered Portfolio