My current focus is creating tools that make a difference for people. From creating software useful to clients to creating software for developers.
Be kind, be useful, and be happy. That is all that matters.
โก Live views for GoLang with reactive HTML over WebSockets ๐
License: MIT License
My current focus is creating tools that make a difference for people. From creating software useful to clients to creating software for developers.
Be kind, be useful, and be happy. That is all that matters.
@brendonmatos Is it possible to embed components?
Hello! I'm new to GoLive but I'm really excited about this project! I've ran the examples and I've tried to create my own from the start to get familiar but I'm struggling to get a simple button click event to fire on the server side.
I have the following HTML:
<button go-live-click="HandleUp">+</button>
And on the server I have this but the Println()
doesn't seem to fire.
func (t *Thermostat) HandleUp() {
fmt.Println("UP")
t.Temperature = 50
}
I would really appreciate any help!
Lavavel Livewire uses the https://github.com/patrick-steele-idem/morphdom library to diff the dom updates.
Does this package do the same thing?
Line 115 in 27cf35b
GL 21:44:35 ERR handle html request error=template execute: template: Books_UVRUV:13:99: executing "Books_UVRUV" at <$Book.name>: can't evaluate field name in type main.Book
Hi there, just a quick typo bug report on the above line.
Should be
<textarea>{{.Value}}</textarea>
Steps taken:
Expected:
The same thing happens in both windows at the same time.
Actual:
Only the window where the user is interacting gets updated.
I also saw this with the todo example. It happened both on Chrome and Safari on Mac.
step to reproduce:
WRN handle ws request: unexpected connection close
Error logs below
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
โ Fiber v2.2.3 โ
โ http://127.0.0.1:9000 โ
โ โ
โ Handlers ............. 4 Processes ........... 1 โ
โ Prefork ....... Disabled PID ........... 2042802 โ
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
GL 16:10:42 WRN handle ws request: unexpected connection close
GL 16:10:42 ERR call to commit on unmounted Component name=Root_bHk6G
GL 16:10:42 ERR call to commit on unmounted Component name=Root_ksoMy
GL 16:10:43 ERR call to commit on unmounted Component name=Root_bHk6G
GL 16:10:43 ERR call to commit on unmounted Component name=Root_ksoMy
GL 16:10:44 ERR call to commit on unmounted Component name=Root_bHk6G
GL 16:10:44 ERR call to commit on unmounted Component name=Root_ksoMy
GL 16:10:45 ERR call to commit on unmounted Component name=Root_ksoMy
GL 16:10:45 ERR call to commit on unmounted Component name=Root_bHk6G
GL 16:10:46 ERR call to commit on unmounted Component name=Root_bHk6G
GL 16:10:46 ERR call to commit on unmounted Component name=Root_ksoMy
GL 16:10:47 ERR call to commit on unmounted Component name=Root_bHk6G
GL 16:10:47 ERR call to commit on unmounted Component name=Root_ksoMy
GL 16:10:48 ERR call to commit on unmounted Component name=Root_ksoMy
GL 16:10:48 ERR call to commit on unmounted Component name=Root_bHk6G
GL 16:10:49 WRN handle ws request: unexpected connection close
GL 16:10:49 ERR call to commit on unmounted Component name=Root_gf946
GL 16:10:49 ERR call to commit on unmounted Component name=Root_i4d5f
GL 16:10:49 ERR call to commit on unmounted Component name=Root_bHk6G
GL 16:10:49 ERR call to commit on unmounted Component name=Root_ksoMy
GL 16:10:50 ERR call to commit on unmounted Component name=Root_i4d5f
GL 16:10:50 ERR call to commit on unmounted Component name=Root_gf946
GL 16:10:50 ERR call to commit on unmounted Component name=Root_bHk6G
GL 16:10:50 ERR call to commit on unmounted Component name=Root_ksoMy
GL 16:10:51 ERR call to commit on unmounted Component name=Root_i4d5f
GL 16:10:51 ERR call to commit on unmounted Component name=Root_gf946
GL 16:10:51 ERR call to commit on unmounted Component name=Root_ksoMy
GL 16:10:51 ERR call to commit on unmounted Component name=Root_bHk6G
GL 16:10:52 ERR call to commit on unmounted Component name=Root_gf946
GL 16:10:52 ERR call to commit on unmounted Component name=Root_i4d5f
Steps taken:
Expected:
The server keeps running.
Actual:
The server crashes like this:
GL 21:20:52 WRN handle ws request: unexpected connection close
panic: runtime error: invalid memory address or nil pointer dereference
[signal SIGSEGV: segmentation violation code=0x1 addr=0x0 pc=0x13eabf1]
goroutine 52 [running]:
github.com/fasthttp/websocket.(*Conn).Close(...)
/Users/issactrotts/pkg/mod/github.com/fasthttp/[email protected]/conn.go:344
github.com/brendonmatos/golive.(*LiveServer).HandleWSRequest.func2()
/Users/issactrotts/src/github.com/brendonmatos/golive/server.go:196 +0x471
created by github.com/brendonmatos/golive.(*LiveServer).HandleWSRequest
/Users/issactrotts/src/github.com/brendonmatos/golive/server.go:182 +0x305
This project is retty interesting.
You might want to look into adding NATS to this system:
Web sockets for NATS and soon Nats Jetstream is happening. See:
https://github.com/nats-io/nats.ws
It would make it easier to have 100's of distributed golang servers in sync with browser clients.
Not sure if you know NATS ?
The CLI now has Jetstream included ..
Let me know what you think...
Thanks so much for this project! I'm finding it really fun to work with.
I'm new to gofiber and I was wondering how would I use golive with gofiber and a template engine instead of returning static HTML like in your examples in the TemplateHandler
function. I tried using a template engine but it looks like none of the data or interaction is correctly working in an interactive way.
Something like
app.Get("/", func(c *fiber.Ctx) error {
// Render index template
return c.Render("view", fiber.Map{
"Title": "Hello, World!",
})
})
I do see one mistake I have here which is there's no creation of the model object, but I'm not really sure how this flows with golive so I'm a little confused. I would really appreciate the help! Thanks so much for putting your time into this project I tried a bunch of similar ones and this one has been by far the funnest one to work with.
https://github.com/maxence-charriere/go-app
I love your idea but I think this package need to method how to write template on golang.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.