I’ve been using EJS for a while in ComicServer & Daily, and I could never go back to static HTML. I guess that segues into…
EJS – Backend variables into frontend constants.
I use EJS exclusively for passing variables that can only be produced in a Node file to an HTML template using Express.js. It has to be one of the only libraries that I will always use in anything I ever do with HTML. With just one line of code, you can use a Node library to get some content and then pass it through to your webpage. No noticeable speed difference and without other (sometimes more finicky) tools like Browserify. ComicServer and ComicServer Daily use it (perhaps most importantly) to have your favorites on the homepage or email, respectively. Without EJS, ComicServer wouldn’t have made it past when I started using it for the first time to make ComicBrowser and stole the structure from a GitHub repo of a discord bot dashboard. Over the two years since, I have removed all of the original code from that repo other than the four lines of EJS goodness in the index.js.
HTMX – Cheesecake Factory luxury ported into HTML
When I say “Cheesecake Factory luxury” I mean luxury that’s not as nice as a 5-star dinner place, but luxury that is just enough to make you feel like you don’t need 5 stars. Like Cadillac is to Mercedes, or A website builder is to coding with HTML. In HTMX’s case, it’s a super straightforward tool that does some intermediate JavaScript functions so well that you don’t feel like learning more advanced JS. I have not yet made a project that uses HTMX, but when researching and trying it out, I noticed the difference immediately.
I’d have to say that the most stark difference was the AJAX capabilities. All you have to do is add an attribute to a tag. That’s kind of the point of the whole script, this should be easy, so let’s make it easy. Not an anchor tag, but any tag that will request a page on your site (thru POST, GET, or any number of methods) and will swap out a section of your site with the fetched content. With actual working JavaScript. Really impressive considering that I have tried much harder to get these same results with AJAX and am amazed by how straightforward this is (at least when testing with ComicServer). There are a number of quality of life improvements to be made with this script, but you get the point. It doesn’t quite have the prestige of “Pro level” developing, but it is so convenient and easy, it makes you feel like you don’t need to go pro.
I guess I’ll just have to add
- Integrate HTMX
To the list of features to eventually add to ComicServer.