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

Change Default Template Engine of the Application Generator #4627

Closed
ghost opened this issue Jul 2, 2021 · 1 comment
Closed

Change Default Template Engine of the Application Generator #4627

ghost opened this issue Jul 2, 2021 · 1 comment

Comments

@ghost
Copy link

ghost commented Jul 2, 2021

I know this is a personal subject and it's very easy to swap out template engines; however, Express does have an outdated template engine and would benefit from a change. I believe the best candidate for a new default is EJS - below are some reasons to why.

Popularity

EJS currently has the widest audience on NPM by a large margin.

Screen Shot 2021-07-02 at 15 39 08

Any other option is inconsistent with Node and Express

Using a template engine that introduces different syntax/structure makes little sense. Embedded JavaScript is similar to ERB - used in Ruby on Rails - and, IMO, should be the default in a server-side JavaScript framework.

Some candidates are inconsistent altogether (to me)

Handlebars, for instance, tries to "separate concerns" as if this is the HTML/CSS that's in the browser. Yet, it lets the use of some logic in the templates through if blocks, for loops, and custom helpers. Also, even if it was consistent, why separate them in a template engine? It spits out pure HTML/CSS anyway, which itself is enough separation of concerns for the end product. If the reason is to be portable, I can't say much, other than to show EJS's popularity.

Again, this is would be a small change, but that does not make it unnecessary. Feel free to add your opinions below - it doesn't have to be EJS!

@dougwilson
Copy link
Contributor

Duplicate of expressjs/generator#141

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant