Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

I really like the fact the the code is shrinking. It's refreshing to be able to read and understand all of the source code that your apps are using.

There are a few changes that worry me:

* req.get() instead of req.header() - 'get' is an ambiguous word here, might be confused with req.params(). I'd keep the overloaded req.header() just dropping the `defaultValue` parameter

* res.render(404, 'not here') doesn't work anymore. res.statusCode goes against the rest of the 'minimal' api like res.xhr and res.type

* removal of layout/partials (but curious to see what will come out of it)



What would you suggest in lieu of the layouts/partials for visual elements?

The Django community has issues with this from time to time, where packages sometimes don't include any templating, leaving people to guess at what needs to be there.

I don't know of an obvious solution though, except maybe a kitchen sink example of some sort. Thoughts?


Up to the engines now, Jade implements django-like inheritance and includes, same with swig and a few of the others. There are a few that do not have any notion of IO so I plan on having a third-party implementation of the old partial() function, removing it greatly simplified the view system for people who were not using it previously anyway, and some of the rules partial() employed were needlessly confusing (collections etc).


I expect at least the most used template engines to re-implement both partials and layout as they were. They will benefit from custom cache strategies, but I don't see reason for radical changes. I wish one like jqtpl was made default :)


req.get / res.set are obvious in use so it's not bad (res.set('Content-Type', 'application/json')). I'll likely keep the old .header() methods for BC. "res.render(404, 'not here')" never worked, maybe you mean res.send(404, 'sorry')?


That's correct, my mistake. I see that `res.status(code)` was added to the docs, that's nice.


oh I see maybe you meant res.render(view, {status: n }), the problem with that is that people were passing non-numeric values there, causing bugs because they were not aware of "status" being special-cased




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: