Wednesday 15 November 2017

Starting out with Node+Express+React - do I need another server-side templating language at all, or can I just use React?

I'm a PHP dev (been doing webdev on and off for 18 years), who so far pretty much just knows enough JS to do typical stuff with JQuery. I'm diving head on into completely switching over to Express for backend, and React for frontend over the coming year.When I create my first Express project (using express-generator), I'm given the choice of which templating language I want to to use on the backend: ejs|hbs|hjs|jade|pug|twig|vashGiven that I want to dive into using React for both client-side and server-side rendering for the most part... does it still make sense to use one of the above templating systems for the general backend site-wide layout rendering for the core stuff like global header/footer/menu, meta tags etc? ...if so, keen on opinions comparing them.Or can I ignore them altogether and do all templating in React?I know there's probably no binary right/wrong answer here, so I'm mostly after opinions... What would you recommend?Also I'm guessing that I might kind of be comparing apples to oranges here, as React mostly serves a different purpose to most templating systems, especially regarding "page rendering (this part is the core of my question)" -vs- "building interactive applications"... but I'm just wondering if there is a good enough case to use React for both purposes... or if I'm just making things harder for myself?In case it's relevant, my personal situation is that I do have quite a bit of time to learn right now, and I'm mostly going to my building my own sites, so I don't need to work with other devs. But they will be fairly large projects and I'll be continuing to build upon over the next 10 years. Some sites/pages will have complete pages rendered server-side, and some will be a mix with client-side rendering.I know there's other similar threads asking for advice on which Express templating option to pick, but I'm keen for current opinions, especially on the "can React replace them altogether?" thing.Also if you happen to have any random tips that could come in handy for an immigrant from PHP-land, please feel free to chuck them in! It feels like there's so many different frameworks etc I need to learn to just get started in this new JS/Node world.

Submitted November 16, 2017 at 05:08AM by r0ck0

No comments:

Post a Comment