Support Pug directly


#1

I’ve always thought that standards should be discovered in a distributed process rather than handed down by an authority, at least first. This is why I’m always for Brave developing features for developers even if it goes beyond the standard.

I would love it if a browser supported Pug (html templating) directly. I’d love to be able to edit a pug file on my computer and then just run it. I’d love to serve really concise pug to users that takes advantage of the each directive.

Being able to run pug files directly saves a dev from running a watch process on each file he thinks to edit or view, and saves them from managing multiple files.

Being able to serve users pug directly can help serve a meaty portion of content with less repeditive html while keeping the javascript clean of things to do that. Having javascript generate the dom, though not entirely untypical, requires a dev to then worry about which order the code is executing. With html preprocessed from pug more typical javascript can run ondomready because the result of the pug would be part of the initial dom, leaving javascript to perform only its initial function of tweaking a web page… less code to manage and more uniform purpose.

The actual suggestion is very simple.
I suggest a mime-type of text/pug to go through a preprocessor which provides html into the standard pipe, and file urls with a .pug extention to be interpreted as having that mime-type.

No more companion processes
No more build files for things that should be too simple to bother
No more writing irk-some and repeditive html
No more hooking your javascript into exactly the right timing
No more serving spegetti code
No more wait on react or angular js to come through a cdn to make content “client side rendered”

People will dev for Brave first if it has those features and saves them those headaches.

Thank you as always, to the bravest dev
J