I
I
Islam Ibakaev2017-04-10 01:42:17
JavaScript
Islam Ibakaev, 2017-04-10 01:42:17

Why use template engines(pug, handlebars, etc.) if there are ui libraries(react, vue)?

Do you use a combination of node(express) + pug(other template engine) for your projects? Why pug? Why not react or twist, for example.
What should be the project for me to prefer react over templating engines like pug?

Answer the question

In order to leave comments, you need to log in

2 answer(s)
K
Konstantin Kitmanov, 2017-04-10
@devellopah

I wouldn't lump it all together like that.
pug is not only a template engine, but also a preprocessor, that is, it provides an alternative, in many ways convenient syntax.
For vue/react, generating html is only part of the job, they have to update it neatly and quickly and respond to user input.
If the project does not provide for a dynamic frontend, then it is quite possible to get by with one templating engine - pug / handlebars / whatever you want. Not everywhere you need SSR.
PS the fact that react cannot be used with pug is the personal sexual difficulties of a purely react. I use vue+pug and am happy as an elephant :)

A
account-6, 2017-04-10
@account-6

For starters, React and Vue are a couple of years old (active use and hype).
And templateing is some miserable percentage of their capabilities.
The question is incorrect. To use pug, handlebars, one module is enough. For React, you need to raise the whole environment (in order to use it normally). It’s easier with Vue, but to get the benefits of templateing, Vue alone is also not enough, you need an accompanying ecosystem (vue-loader at least). And with the same vue-loader, Jade is also quietly used.
In general, you would first try everything yourself, judging by the question, the understanding is very vague.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question