-
Notifications
You must be signed in to change notification settings - Fork 15.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Express 4.0 #1838
Comments
What does the new cookie lib buy us? Any cookie parsing changes we should
|
not sure. just saw that issue. i'm not totally sure how cookies in express work right now. for one, we're going to move to jed/cookies in connect instead of doing our own cookie parsing and signing. |
yeah i wanted to move from res.cookie(key, val) to using jed's stuff with res.cookies.set() and so on like koa so we can delegate key handling blah blah |
Is there an advantage to that type of api change? res.cookie always seems simple enough to me. Does it not do something currently? Or was this more cosmetic? |
https://github.com/jed/keygrip for one, which i like. |
What does one have to do with the other? That sounds like a cool lib tho. On November 30, 2013 at 2:18:37 PM, Jonathan Ong (notifications@github.com) wrote: https://github.com/jed/keygrip for one, which i like. — |
for setting it doesn't really matter, we could retain that but for getting the lazy .cookies.get() is nice |
"Remove app inheritance" - please don't remove. I use them in the separation modules. |
can you explain what you're doing in #1843 and how you can't just use routers instead? |
for routing, we're going to go with this: https://github.com/expressjs/routification. it'll wrap the express prototype and we'll have to do some fixing to work with settings and
|
Thanks for the advance notice, guys. |
Are we working on this in a branch somewhere? |
Not yet. Was going to do connect 3 first. Did you want to start now? |
Yea, I was thinking of taking down some of the super trivial stuff like app.configure |
Sounds good to me. I'll start doing some connect 3 stuff |
do you want to just release connect 3 and express 4 asap? i wanted to wait until node 0.12, but it's taking too long. still want to drop 0.8 support, though. |
I am in no particular hurry. I wouldn't wait on 0.12. fixing 0.11 support On Wed, Jan 1, 2014 at 6:15 PM, Jonathan Ong notifications@github.comwrote:
|
3.x is its own branch now. @defunctzombie although i made routification, which is more inline with @visionmedia plans for v4, i'm going to let you handle all the routing and performance stuff :) |
So master is 4?
|
Yeah |
I would also like to look at making app.route() a thing. I can't find the issue right now but it was brought up as a way to make it easier to add multiple METHOD handlers onto a route without repeating yourself. |
Is there an issue for "Remove app inheritance"? What does that mean? |
like when you do basically, it would just mean removing this stuff: https://github.com/visionmedia/express/blob/master/lib/application.js#L57 |
Ah. Gotcha. My new router stuff replaces the need for mounting apps.
|
@jonathanong @visionmedia anything off this you guys want to accomplish? https://github.com/visionmedia/express/wiki/4.x-roadmap The only thing I would think about is the |
http utility methods. i'll go over the prototype later to see if there's more we can refactor. a lot of it was content negotiation though which i've already refactored. view system could be extracted. i know people create subapps just for the view system. could be something like https://github.com/visionmedia/co-views
i mean we could, but then there would be support issues coming when something breaks :/ |
@jonathanong very cool :) would be awesome to be able to use the router as a standalone module as well- I'd be down to help with that if I could |
extracting view system could be useful. That way you could |
"Remove dependency on connect" How do we plan to accomplish this? |
@hacksparrow most of the major work was done in PR #1909 The rest is just a matter of making repos for the various middleware we care about that is still in the connect module and using those modules separately. |
Thanks, that explains it. |
I am now working on the final pieces (view system as middleware). Once this is complete, the codebase will go into feature freeze for 4.0 documentation and release. If you would like to see any other major things implemented for 4.0 now is the time to speak! |
With express not depending on connect, and connect not including middleware, is there a discussion somewhere where I can read up on the rationale of how/why a project should choose to build on express 4 vs connect 3? The express changes look great btw, simplification + more modules sounds good to me :) |
@jonathanong I worked on making the view system just another middleware however ran into one issue exposed by the following example: app.use(views);
app.use('/foobar', routes);
app.use(function(err, req, res, next) {
res.render('error');
});
routes.use(views2);
routes.get('/blah', function(req, res, next) {
next(new Error('foobar'));
}); Imagine that |
i don't think it shoudl be middleware, just a library. something like https://github.com/visionmedia/co-views. the default var render = new View({
ext: '.jade',
engine: 'jade',
})
app.use(function (req, res, next) {
render('home', res.locals, function (err, html) {
if (err) return next(err)
res.send(html)
})
}) so if people want complicated view systems or apps just for views, they can use the lib instead. |
This makes rendering much harder on the user. |
@glenjamin expressjs/expressjs.com#113 it grew out of our own laziness, but it does make sense |
well it's up to you. i don't believe in coupling view systems to apps or routes - they should be completely independent. but yeah, it is less convenient, especially if you remove encapsulation. |
We have this same problem with our res.view() method- it's pretty annoying, but dunno if it's unworkaroundable. Along the same lines, user middleware could override other core res methods like json, right? I may not understand the complete problem here, but as an express user, I wouldn't mind being told not to install multiple view-rendering middleware. Just my 2 cents :) Great work, fellas. Mike's phone
|
I like @jonathanong's idea about just using modules. From a user point of view, being able to use() view middleware might be confusing if only one is allowed. You could set the middleware up to throw an exception if res.render is already defined, and point the user to some docs about views-as-functions. You could also create a multiview middleware which does the extension checking and delegates to other view middleware if multiple view systems via res.render is desired. |
The view system will remain tied to the app and will not become middleware (too involved). However this does make me a bit sad in that I was hoping to allow subapps/routers to have their own views if they wanted (something currently not supported) but the more I think about it, the more I think this is a hard approach to pull off realistically. The way express is written, an |
I still think a separate lib for views is the way to go. Are you going to move the router to its own repo? We can always release an alpha version and see how people react |
I'd love to be able to use the router as it's own module Mike's phone
|
Router could be own repo. Routification repo? or do you have plans for that codebase? |
nope no plans. you can use it. |
$npm update mixin(app, proto); app.request = { proto: req, app: app }; Couldn't one expect a warning about these backward incompatible changes, much like the bodyParser warning? |
@pontusen A change from 3.x.x to 4.x.x is basically a guarantee your stuff will break. |
since all the checkboxes are checked and rc1 is out, i'll close this issue. any 4.x issues should be new issues :D |
npm uses semver-looking versions, nothing more than that. The choice of using semver is up to a package maintainer, and there are different schools of thought. |
@rlidwka
I'm not sure how much more |
No longer relevant to this issue. Please take it elsewhere. I dont want to
|
@defunctzombie Were you interested in helping pull the router out? I'm down to take the lead on that if you want to team up. @defunctzombie @jonathanong To avoid cluttering things up and notifying a bunch of people who aren't interested in this feature, I just created a new issue. Before I jump in, would you mind passing along your thoughts? (I want to make sure the PR I work on is something y'all are cool with.) I jotted down some quick questions there. |
@mikermcneil you can already use the router on it's own. routes.js was broken out of connect 3 years ago. |
Backwards incompatible changes. Woo!
Remove app inheritance/revisit mountingapp
and what this means. Right now it is too confusing and not documented. Remove app inheritance, encourage using multiple routers instead of mounting apps #1843Lazy cookies Lazy cookies #1139View middleware/module (allows for view engine as middleware)The text was updated successfully, but these errors were encountered: