What could be wrong with passing the request object to the jade renderer?
This seem like a simple way to work. Especially as express.js already uses the request object as a vehicle from append data as the HTTP request makes its way to its middleware end point.
Therefore, instead of passing a custom data object to the jade rendered, could one just append data to the request allowing more logic to be handled from with in jade. For example:
app.get("/", function (req, res) {
res.render("index", req);
});
Are there consequences to doing such a technique? Could this be frown upon or admired? Could it expose to much to jade? Performance impact?
For example, here is some people wishing to send data already in the request to jade:
I am sure there are more related questions which could be solved by just sending the request. It's not suggested, why?