vugu / vugu

Vugu: A modern UI library for Go+WebAssembly (experimental)
https://www.vugu.org
MIT License
4.8k stars 175 forks source link

How I start your vugu-site with wasm #211

Closed Fruchtgummi closed 7 months ago

Fruchtgummi commented 2 years ago

How i start your vugu-site with wasm?

I start, after little adjustments, the main_wasm.go with vgrun main_wasm.go and I get follow output:

main_wasm.go
Entering main(), -mount-point="#vugu_mount_point"
Exiting main()
panic: js not implemented

goroutine 1 [running]:
github.com/vugu/vugu/js.Value.Call(...)
        C:/goworkspace/pkg/mod/github.com/vugu/vugu@v0.3.4/js/impl-nonjs.go:154
github.com/vugu/vugu/domrender.New(0x10541a4, 0x11, 0x105b115, 0x21, 0xc00008ff08)
        C:/goworkspace/pkg/mod/github.com/vugu/vugu@v0.3.4/domrender/renderer-js.go:42 +0xf5
main.main()``

It's this place under construction or I understand this wrong?

Nv7-GitHub commented 2 years ago

You are supposed to run the dev server with vgrun

Fruchtgummi commented 2 years ago

Yes, i call in parent vgrun -watch-dir=app server -dev this works, but the project run as server. The files main.wasm or wasm_exec.js are not generated.

How I start vugu-site as Client? The file client/main_wasm.go is for client-mode or?

I understand static as generate project to html files, with assets directory, the env -dev start the project with go-server. How I start this project as wasm, as client?

Dadido3 commented 2 years ago

What do you mean with "start vugu-site as Client"?

If you want to serve your application with another webserver you can let vugu create html and wasm files for you. See Making dist.go in vugu.org/doc/build-and-dist.

This will put all needed files into a dist folder that you only need to copy over to your webserver of choice. Then you can serve your application without the need of having a go server running.

(Just as a sidenote, this has nothing to do with static rendering because the page content is still being created/rendered inside the browser)

owenwaller commented 7 months ago

Closed, as this seems to be solved and not an issue we need to fix for the v1.0 release.