livghit / go-htmx

Fusioning HTMX and GO-HTTP like an Oreo 🍪⚪️🍪
6 stars 2 forks source link

Golang #2

Closed gedw99 closed 1 year ago

gedw99 commented 1 year ago

You know how the htmx syntax is used in web pages, I was thinking of making it work with golang gui and cli also.

This requires a markup language in xml for the gui and cli and they do exist.

Charme bracelet lipgloss for cli Decksh for gui.

So then you can use htmx for web but also gui and cli.

grab me on my profile page if your interested :)

livghit commented 1 year ago

Interesting idea definitely worth thinking about when the project is working like I want it to work . At the moment this is a prototype and I still try to figure out how the end product will look . When I have a stabel working version the Idea on moving it to the gui / cli would be great ! Thank you very much !

gedw99 commented 1 year ago

Hyperview is doing the same with react.

I think matching the js event and custom event is the way to do it. This is the underlying mechanism that Hyperview , alpine.js use to do the htmx trick.

https://developer.mozilla.org/en-US/docs/Web/API/CustomEvent

So I started to match the browser api but in pure golang with gioui. It’s just xml.

gedw99 commented 1 year ago

https://github.com/livefir/fir is what I am using .

I like how it’s a little less concrete than htmx. See what you think

livghit commented 1 year ago

Very interesting approach. I will look at all the provided info . At first glace I think it could be a great thing to implement !

gedw99 commented 1 year ago

better to just use theirs if yours if not adding anything.

I am interested on being able to do htmx for web and non web from the same api using golang.

the only thing the non web runner would need is to imitate the event system of the browser.

This is the golang Renderer for web and non web.

https://github.com/ajstarks/giocanvas/blob/master/gcdeck/main.go

https://github.com/ajstarks/giocanvas/blob/master/gcdeck/test.xml

It’s like what Hyperview are doing for react: https://hyperview.org/docs/guide_html

livghit commented 1 year ago

I am very engaged by this idea . Wouldnt it be worth opening another project about this ? This way I can let this project be only a template on working with htmx and go on the web and the other project we could transform into a package and use it via the gui / cli ?

livghit commented 1 year ago

@gedw99 i have opened another repo for this idea so we can model the project and have a better view on all the future and things that need to be implemented. You can find the project here https://github.com/livghit/go-gui-htmx In this repo I have added a README that should include all the goals and the features that need to be implemented . I would start filling the readme and if you have something to add or wish some special feats please just fork it and make a pull request . At the moment I am stil on vacation so I wont be able to to very much but after that I will take a deeper look for sure ! :) Cheers !

gedw99 commented 1 year ago

Cool

let’s work on it