express icon indicating copy to clipboard operation
express copied to clipboard

deprecate app.render (make private)

Open defunctzombie opened this issue 10 years ago • 12 comments

First step in isolating the view system away from "app" level and towards something that can be used via middleware later.

defunctzombie avatar Mar 01 '14 18:03 defunctzombie

Getting rid of these app.* stuff in 5.x will let us get rid of req.next as well (horray!)

dougwilson avatar May 13 '14 03:05 dougwilson

@dougwilson should we target this for 4.x deprecation?

Tbh I can't even find app.render in the codebase..

Fishrock123 avatar Nov 22 '14 01:11 Fishrock123

Tbh I can't even find app.render in the codebase..

https://github.com/strongloop/express/blob/master/lib/application.js#L477

dougwilson avatar Nov 22 '14 01:11 dougwilson

~~Github search keeps becoming worse and worse. -_-~~

Actually I tried to search this via in-browser find. weird.

Fishrock123 avatar Nov 22 '14 02:11 Fishrock123

Any particular reason why?

On Friday, November 21, 2014, Jeremiah Senkpiel [email protected] wrote:

@dougwilson https://github.com/dougwilson should we target this for 4.x deprecation?

Tbh I can't even find app.render in the codebase..

— Reply to this email directly or view it on GitHub https://github.com/strongloop/express/issues/1942#issuecomment-64063533.

defunctzombie avatar Nov 22 '14 02:11 defunctzombie

Makes people aware of things that will be removed, and I wouldn't say this is the recommended method to use. (just render it from your template engine imo)

Fishrock123 avatar Nov 22 '14 02:11 Fishrock123

The problem is we cannot easily deprecate this, because res.render calls this and there is no real good way to make res.render not yell and yet make app.render yell while still letting res.render work with people overriding app.render (backwards-compatibility).

dougwilson avatar Nov 22 '14 02:11 dougwilson

make app.render a proxy to app._render, call app._render from res.render?

while still letting res.render work with people overriding app.render (backwards-compatibility).

oops, nevermind.

Fishrock123 avatar Nov 22 '14 02:11 Fishrock123

Also, I didn't say there was no way, because it's possible using some Object.defineProperty tricks, but it's just not really worth the complexity to just show a deprecation.

dougwilson avatar Nov 22 '14 02:11 dougwilson

@dougwilson how will apps work without req.next()?

ilanbiala avatar Jan 01 '15 23:01 ilanbiala

@ilanbiala what apps use req.next() ? They should be calling the next() function passed as the argument to the middleware.

dougwilson avatar Jan 01 '15 23:01 dougwilson

Oh I thought deprecating req.next() was talking about the next argument. That makes more sense.

ilanbiala avatar Jan 02 '15 00:01 ilanbiala