Re:Show HN: Use Go's HTML/template to write React-like code
by impune on Monday May 27, 2024 @10:45AM
(#40491216)
In Jet Brains family IDEs (not sure how they call the go one) you can use Inject language or reference option to get most of editor support (inspections,highlighting,intellisense etc.) for snippets of one language embedd in files of another language.
I've been using it with JS scripts inside custom xml for a while and it works pretty well.
[ Parent
| on HN ]
Re:Show HN: Use Go's HTML/template to write React-like code
by lucideer on Monday May 27, 2024 @12:05PM
(#40492047)
JetBrains "Inject" is fine for contiguous embeds like JS in XML, but doesn't cut it for inline intertwined string-templating.
E.g. (from the article):
<a class="button {{if .IsPrimary}}primary{{end}}" {{if eq .IsSubmit true}}type="submit"{{else}} href="{{.Link}}"{{end}}>
Re:Show HN: Use Go's HTML/template to write React-like code
by michaelcampbell on Monday May 27, 2024 @10:51AM
(#40491264)
Thanks for this; JetBrains stuff continues to amaze me. Its blessing and curse is the incredible breadth of functionality I keep learning about.