Skip to content
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

refactor view engine #2217

Open
jonathanong opened this issue Jul 7, 2014 · 15 comments
Open

refactor view engine #2217

jonathanong opened this issue Jul 7, 2014 · 15 comments
Labels

Comments

@jonathanong
Copy link
Member

it shoudl just be in its own library. i quickly hacked together https://github.com/expressjs/templation. some opinions would be nice.

a really good view engine is https://github.com/ericf/express3-handlebars, but the one express includes should be able to use most templating languages

@defunctzombie
Copy link
Contributor

-1. Don't see a major win by pulling out out completely. We should remove the "app.render" and clean up some code but I don't see removing it as gaining much. It can still be a module, but we should include it.

@jonathanong
Copy link
Member Author

Oh yeah separate module but still included

@thomasfr
Copy link

thomasfr commented Jul 9, 2014

👍
I saw that templation supports then-jade with kind of streaming support. Does this mean we could get real streaming views in express 5.x (of course we would also need a template engine which supports it correctly) ? 👍 for streaming views!

@aredridel
Copy link
Contributor

I'd love to see streaming views. Of course, that's pretty much templateEngine(whatever).pipe(res)...

@rlidwka
Copy link
Member

rlidwka commented Jul 10, 2014

If you pull out view engine, how express would be any different from connect? :)

@dougwilson
Copy link
Contributor

If you pull out view engine, how express would be any different from connect? :)

It means like the view engine would be a module, and express would require() that module and still use it--i.e. to the user, nothing would change, there'd still be views, etc. :)

@rlidwka
Copy link
Member

rlidwka commented Jul 10, 2014

It means like the view engine would be a module, and express would require() that module and still use it--i.e. to the user, nothing would change

Hmm... let me think... can I then include this view engine to my connect application, and get something like express without actually using express? :)

I don't quite remember why connect had gotten rid of, but if you modularize everything, I feel a lot of feature overlap there.

@dougwilson
Copy link
Contributor

Hmm... let me think... can I then include this view engine to my connect application, and get something like express without actually using express? :)

Yes.

I don't quite remember why connect had gotten rid of, but if you modularize everything, I feel a lot of feature overlap there.

Well, I'm not 100% of the reasoning, but I eventually want to reconsider it for 5.x. We are also going to do the same thing for the router, so it would reason that express would be connect + views + router + other stuff. connect as it is is basically just .use(), which is the core of express as well. I have slowly been extracting the commonalities anyway :)

@defunctzombie
Copy link
Contributor

There was already a lot of overlap and express was pretty highly coupled to
connect. We removed connect because the router we wanted to ship got more
complex than connect's basic .use middleware handling.
On Jul 10, 2014 11:24 AM, "Douglas Christopher Wilson" <
notifications@github.com> wrote:

Hmm... let me think... can I then include this view engine to my connect
application, and get something like express without actually using express?
:)

Yes.

I don't quite remember why connect had gotten rid of, but if you
modularize everything, I feel a lot of feature overlap there.

Well, I'm not 100% of the reasoning, but I eventually want to reconsider
it for 5.x. We are also going to do the same thing for the router, so it
would reason that express would be connect + views + router + other
stuff. connect as it is is basically just .use(), which is the core of
express as well. I have slowly been extracting the commonalities anyway :)


Reply to this email directly or view it on GitHub
#2217 (comment)
.

@dougwilson
Copy link
Contributor

We removed connect because the router we wanted to ship got more complex than connect's basic .use middleware handling.

Yep, that's what I figured--, though in it's current state that no longer applies. I'll push up a branch with connect 3 at the express core that we can mull over.

@Floby
Copy link

Floby commented Jul 10, 2014

I kind of made a streaming template engine a while ago called "blue"

Le 10 juil. 2014 17:31, "Douglas Christopher Wilson" < notifications@github.com> a écrit :

We removed connect because the router we wanted to ship got more complex
than connect's basic .use middleware handling.

Yep, that's what I figured--, though in it's current state that no longer
applies. I'll push up a branch with connect 3 at the express core that we
can mull over.


Reply to this email directly or view it on GitHub
#2217 (comment)
.

@dougwilson dougwilson mentioned this issue Jul 14, 2014
39 tasks
@jonathanong
Copy link
Member Author

what's your views on templation? if it's good enough for 5.x i'll work on it some more. some help with more templating engines as well as collabs would be great

@dougwilson
Copy link
Contributor

I have not taken a look at it just yet.

@Fishrock123 Fishrock123 added future and removed ideas labels Nov 21, 2014
@ilanbiala
Copy link

Any progress on this? Streaming views would be pretty nice.

@gdl276s
Copy link

gdl276s commented Sep 15, 2015

This may belong in another feature ticket, but I would prefer to couple view engines with view directories together in order to accommodate handling multiple view engines and multiple view directories within a single express app. For example ...

// hypothetical initialization
app.set('view engines', [
    { 'engine': 'jade', 'views': [ 'views/jade1', 'views/jade2' ] },
    { 'engine': 'handlebars', 'views': [ 'views/handlebards' ] }
]);

@dougwilson dougwilson removed this from the 5.0 milestone Mar 26, 2020
@dougwilson dougwilson removed the 5.x label Mar 26, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

10 participants