On Javascript Frameworks

If you’re writing some javascript and then suddenly discover that you need to add some nodes / HTML to your webpage, need not be taken from the server, what are you meant to do? Basically, you need to render some HTML from your javascript code. Where will this HTML come from?

(i) It can come directly from the client. (This is where client side frameworks like Elm, React, Ember) really shine. The code you want to display is mostly done on the client side of things.

(a) If you're doing client side rendering, you can render the HTML inline based on a quick string you have whipped up. 

(b) [hyperHtml](https://github.com/WebReflection/hyperHTML)

(c) [EJS](https://github.com/tj/ejs)

(ii) It can come from the server. This is where ideas like: Stimulus JS and pjax come in. Or there is a murky middle ground:

(a) [Element Templates](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/template)

(b) [Stimulus JS](https://stimulusjs.org/)
Written on August 25, 2020