by replwoacause · 2y ago · 0 comments
I just can't get behind the complexity of build steps and compiling, all just to get a website online. It's crazy. The simplicity that PowerShell (and PHP) bring to this process can't be overlooked... so I like to beat on this drum whenever I get the chance.
Choose the tool that is right for the job, and PHP can be that tool in a surprising number of cases.
I really loved PHP, but now with go+templ (https://templ.guide) I personally don't have a use-case for PHP anymore, but that doesn't mean it's irrelevant for the world.
This is the first time I've heard of Templ. It looks cool and it was really easy to set up. Apparently there are IDE extensions to enable syntax highlighting and HTML auto-completion, but is there a way to type check the templates? One of the things I love about JSX as a templating language is that errors in your markup get reported as type errors [1]. If I write `<a herf="/foo">` instead of `<a href="/foo">` and run `tsc --noEmit --watch`, TypeScript will complain until I fix the issue. You can even extend the types to support your own HTML custom elements. JSX is a first class citizen in TS (and by extension any editor or IDE with support for TS).
[1] https://github.com/DefinitelyTyped/DefinitelyTyped/blob/mast...