The beta is a near re-write consisting of roughly 300 commits, introducing new features, removing legacy code, and improving documentation. Express now runs on the Connect middleware framework, which replaces the previous concept of a Plugin. The performance of express has also been optimized and can now respond much faster than previous versions.
By abstracting the Express Plugin’s to a specific middleware framework, the community can now build on, and utilize this functionality to power their own frameworks. Connect currently provides:
- bodyDecoder Buffers and parses json and urlencoded request bodies (extenable)
- conditionalGet Provides 304
- errorHandler Handles exceptions thrown, or passed through the stack
- debug Outputs debugging console to all html responses
- format Handles url path extensions or
- gzip Compresses response bodies with gzip executable
- lint Aids in middleware development
- logger Provides common logger support, and custom log formats
- methodOverride Provides faux HTTP method support via the _method param
- responseTime Responds with the X-Response-Time header in milliseconds
- compiler Supports arbitrary static compilation of files, currently supports less and sass.
- cacheManifest Provides cache manifest for offline apps
- jsonrpc Provides JSON-RPC 2.0 support
- staticProvider Serves static files
- cookieDecoder Provides cookie parsing support
- session Provides session support
- cache Provides memory caching
- pubsub Publish subscribe messaging support
- repl Read Evaluate Print Loop attached to
- vhost Virtual host support
Express is now much faster, with a concurrency of 80, and 8000 it can easily serve the typical “Hello World” response with ~10,000 requests per second on my machine. Ruby’s Thin (1.2.7) by comparison serves ~6500 rps. Finally by adding Sinatra in the mix I get ~1900 rps.
These numbers are to be taken lightly of course, and are simply relative, to re-cap:
Express ~10,000 Rack/Thin ~6,500 Rack/Sinatra ~1,900
Graph for fun:
The new docs include a 1.x Migration Guide which should cover most of the changes that would be required to get you up and running. Another thing worth mentioning is that the docs are now generated via Markdown, and are located within ./docs which provides an easy way for developers to contribute docs.
Application Generating Executable
Express now ships with the express executable, creating app skeletons with a single tiny command:
thats it! of course view —help for more information.
Future of Express
From now on Express is clutter-free, no more dependencies on random extension libraries, no more high level http client library, just simply performance, routing, responding, configuration, and views. Feel free to post an issue if you find a bug, or have suggestions for focused features that you would like to see in the framework.
Looking forward to 1.0, Happy Express-ing everyone :)