Live data from Hacker News

Show HN: Build progressively enhanced reactive HTML apps using Go and Alpine.js

livefir.fly.dev

31–40 of 45 posts

Re: Show HN: Build progressively enhanced reactive HTML apps using Go and Alpine.js

#31
I've also used alpineJS, Golang and tailwindCSS to build gocial [1]. The source code is also publicly available [2]. The whole project is hosted at netlify as a big Lambda function.

But I think for future projects I might use HTMX + Tailwind.

[1]: https://gocial.netlify.app/

[2]: https://github.com/dorneanu/gocial

Re: Show HN: Build progressively enhanced reactive HTML apps using Go and Alpine.js

#32

Counter doesn't work properly on Android Chrome FYI just reloads the page.

The first step counter button is supposed to reload the page. The second step buttons update the page w/o reload

The second counter adds and subtracts values other than 1 and therefore seems broken.

Re: Show HN: Build progressively enhanced reactive HTML apps using Go and Alpine.js

#33
post #32

Earlier quoted context omitted.

The first step counter button is supposed to reload the page. The second step buttons update the page w/o reload

The second counter adds and subtracts values other than 1 and therefore seems broken.

That's because there are hundreds of people coming from hacker news clicking the button. if you just refresh the page you can see the number change. The current total seems to be saved server side

Re: Show HN: Build progressively enhanced reactive HTML apps using Go and Alpine.js

#34

I'm currently working with Alpine.js in order to try to build "Universal Components" or "Hypermedia Components". Where you just hit a URL and get your component like /components/infinite-canvas or /components/svg-2-base64 or /components/lib-somelib. [1] ilse.ink/components(It's not ready yet)

Sounds interesting.

ilse.ink/components didn't work. Could you post a link to it?

Re: Show HN: Build progressively enhanced reactive HTML apps using Go and Alpine.js

#35

The second example counter is jumping around instead of incrementing/decrementing by 1. Is state being shared between users or somesuch? Or is it because I first clicked the full reload example several times? iOS

The state is shared between users for the demo. Its possible to separate state in the library per user but I haven't enabled it.

As a sibling said, this is not a bug, but a feature, if explained as such.

Re: Show HN: Build progressively enhanced reactive HTML apps using Go and Alpine.js

#37

The one thing that golang really needs is a templating library that doesn't suck, Html bindings in this language feel more like an after thought and this is coming from a person that really likes this language.

Have you tried this: https://templ.guide/ ?

This is a very simple and clean Go templating library.

Re: Show HN: Build progressively enhanced reactive HTML apps using Go and Alpine.js

#38
This is very cool. I'm working on a side project right now with a go back end and alpine front end. One of the things I've had to overcome is handling cookies and CORS since not everything is served from localhost.

I ended up packaging my frontend in an nginx container and using that same nginx container as a proxy for the backend but the whole time I thought maybe this small project would be easier if everything was served by go.

Will definitely keep an eye on this for future stuff.

Re: Show HN: Build progressively enhanced reactive HTML apps using Go and Alpine.js

#39

The one thing that golang really needs is a templating library that doesn't suck, Html bindings in this language feel more like an after thought and this is coming from a person that really likes this language.

Have you tried this: https://templ.guide/ ? This is a very simple and clean Go templating library.

I’m really looking forward to IntelliJ support

Re: Show HN: Build progressively enhanced reactive HTML apps using Go and Alpine.js

#40

The one thing that golang really needs is a templating library that doesn't suck, Html bindings in this language feel more like an after thought and this is coming from a person that really likes this language.

I spend most of my time in the JavaScript ecosystem, but I've worked with Go and Rails and have been working with Django recently and my take is that this seems to be true for most other languages/frameworks.

There are plenty of valid criticisms of React/etc, but the one thing they got really really right was making "templates" be normal functions that return a data structure representing the HTML. Logic is way less awkward, no global variables spanning partials in different files and it's impossible to write incorrectly nested markup. I really wish backend-only frameworks would steal that idea.

Post reply on HN