forked from expressjs/express
-
Notifications
You must be signed in to change notification settings - Fork 0
Migrating from 2.x to 3.x
visionmedia edited this page Nov 10, 2011
·
33 revisions
-
res.render()"status" option (useres.statusCode=) -
res.render()"charset" option (useres.charset=) -
app.dynamicHelpers()(useapp.locals.use(callback)) -
app.helpers()(useapp.locals) - the concept of a "layout" (template engine specific now)
-
partial()(template engine specific) res.partial()- "view options" setting, use
app.locals - "hints" setting
-
req.isXMLHttpRequest(usereq.xhr) -
app.error()(use middleware with (err, req, res, next))
-
res.send(body[, code])is nowres.send([code,] body) -
res.redirect(url[, code])is nowres.redirect([code,] url) -
res.json(obj[, code])is nowres.json([code,] obj) - renamed
app.register()toapp.engine()
.. todo
By removing the concept of a "layout" & partials in Express 3.x template engines will have greater control over file I/O. This means integration with template engines much easier, and greatly simplify the view system's internals.
This also enables template engines to supply their own means of inheritance, for example later releases of Jade provide Django-inspired template inheritance, where the view being rendering specifies the layout it wants to extend.
.. todo
.. todo