HackerTrans
TopNewTrendsCommentsPastAskShowJobs

jackielii

no profile record

Submissions

Gsx: JSX-Like Template for Go

gsxhq.github.io
3 points·by jackielii·vor 10 Tagen·4 comments

comments

jackielii
·vor 10 Tagen·discuss
This is why I created gsx actually. I made a post: https://jackieli.dev/posts/why-i-built-gsx/
jackielii
·vor 10 Tagen·discuss
Templ tries to stay simple, but it sacrificies ergonomics for simplicity and verbosity.

Over the years, there are many proposals: inline elements, HTML tags, error hoisting. It's hard to retrofit into it.

Beside the above, I also tried solving the all the ergonomics problem I saw when using templ. E.g. auto class merging, easy javascript interpolation within attributes. Auto json interpolation etc

References:

- HTML-style component authoring: https://github.com/a-h/templ/issues/663 and https://github.com/a-h/templ/issues/1181

- Inline/anonymous templ functions: https://github.com/a-h/templ/issues/1150

- Passing Go data to JS: https://github.com/a-h/templ/issues/944 and https://github.com/a-h/templ/issues/838

- JSON helpers for frontend data: https://github.com/a-h/templ/issues/739

- Deprecating script-tag Go interpolation due parser complexity: https://github.com/a-h/templ/issues/1408

- CSS/class ergonomics: https://github.com/a-h/templ/issues/61

- Duplicate class behavior: https://github.com/a-h/templ/issues/902

- Conditional attributes / else-if: https://github.com/a-h/templ/issues/933

- Dev mode/watch ergonomics: https://github.com/a-h/templ/issues/318

- Dynamic HTML element helper: https://github.com/a-h/templ/issues/1113
jackielii
·vor 10 Tagen·discuss
I'm the author, AMA
jackielii
·vor 6 Monaten·discuss
Well said!