Giant Feature List
The heart of batman.js is a tiny microframework that makes building web apps easier and more beautiful. It embodies a set of principles that makes trivial the parts of development that should be trivial.
If you are starting a new app, batman.js is also an optional full stack framework that embodies the same principles. It sports a utility belt that includes a toolchain, a powerful node.js server, and a push based persistence layer.
It's also worth defining a microframework as it applies here: batman.js only includes code to do what it needs to do in order to run. It won't give you utilities to work with objects like Prototype.js or manipulate the DOM like jQuery. But batman.js is a good JavaScript citizen; it won't pollute the global namespace and you can use it with any other library.
For example, if you're doing a lot of DOM manipulation, you can, and probably should, still include something like jQuery. If you want to use a full UI library like jQuery UI, UKI, or even (with a bit of hackery) Cappuccino, batman.js will happily work with those as well.
Fast Everything
- <1020kb
- <10002000 lines
- all one file, (almost) no extras
- nothing you don't need
- immediate startup
- layout is rendered by the browser as plain html
- optimized runtime
- everything is built on bindings
- every object manages itself
Developer Happiness
- coffee-script beauty (you don't need to use coffee-script, but you should)
- looks like rails for familiarity
- but it works like javascript
- less trivial code; just write your app
- consistent conventions and the path of least resistence
- built in handiness like model associations and pagination
Designer Happiness
- decoupling design and development
- designers write the html and css they're used to
- developers and designers can add liquid style filters to DRY up or enchance their views
- write less javascript for complex interactions
- mostly logicless views to maximize designer productivity
- the path of least resistance
- whole view system is built on top of bindings, so the data in memory is the data on screen, guaranteed.
Convention over Configuration
- a place to put your stuff
- a way to structure your code
- fewer options to configure
- easier to make advances internally
- most codebases will work in a similar way
Robust Bindings
- any property on any object is observable
- know when any piece of your app changes from anywhere else in your app
- fast, robust, but observer notification is guaranteed
- highly integrated: entire framework built around bindings
Template-less Views
- traditional templates worked great for servers, but browsers are inherently different
- write regular html that doesn't need to be rendered manually
- immediate app startup since there's nothing to render
- add data-* attributes to bind your nodes to your app's objects
- entire chunks of dom won't be destroyed whenever a binding changes
- extremely fast since each node manages its own observers
- use mixins or views to easily turn a node into a more advanced object
- optionally plug in any ui framework to build powerful javascript ui's
Toolchain
- generators to define a clean application structure
- easily generate boilerplate code
- management tasks are taken care off
- easy install via npm
Node Server
- extremely fast app server based on node.js
- uses all your same app code (models, controllers) so you don't duplicate code*
- include specific server side code, like security or proprietary code or extra validations*
- can do extra things like compile and minimize your code
- zero setup
Push Persistence*
- add `@persist Batman` to any model to automatically persist its records
- some form of websockets or now.js pushes data to all clients
- calling `.save()` on a persisted model in one client sends changes to everyone else
- node server can persist to a database with database adapters
- default database TBD
- zero setup
