


In Express, the environmental variable NODE_ENV is designed to inform the web application of the execution environment: whether it is in development or in production. Check out Express’s excellent guide for how to integrate Pug with Express. Key items to note being the start script and pug/pug-vdom dependencies (and you need Node.js version 6.4 or above).Pug fully integrates with Express, a popular Node.js web framework, as a supported view engine. See the Hyperapp pages to get a better understanding of the full range of what it does, or try their new Udemy/ Packt course.Īs project setup, here's the package.json. So what follows is a brief intro to the very simple app I built to demo how Hyperapp can use Pug templates. Maybe I'll come round eventually, but maybe I don't need to.įortunately for me, the project pug-vdom (obviously) brings a virtualDOM to Pug. Combining HTML with the business logic using hyperscript h functions doesn't sit right with me (yet?) and I find it hard to reason about a page when the layout is so abstract. I like the retained ability to see the page structure and the clearer separation of logic and UI. However, previously I've used Pug to define my UI templates.

Centralised state and no stateful components (easy 'undo' option and perfect for quick and reliable development of small to medium scale apps).Clear functional approach to business logic.Now, the Hyperapp framework is wonderful and has a number of features I like: I imagine the new v2 has moved on quite a bit from when Ali checked it out in early 2018. Turns out this is built along very similar lines with an option to use JSX as well as hyperscript. But I don't really get on with it.Īs I was browsing DEV, I noticed a post from mentioned Hyperapp. I find hyperscript to be an interesting approach and it does allow for composable UI components. The app framework he created is nice but uses hyperscript to define HTML as functions. I recently completed an excellent course by James Moore on the basics of functional JavaScript for web apps.
