vugu / vugu

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

Vugu v1.0 ToDo List #260

Open owenwaller opened 6 months ago

owenwaller commented 6 months ago

Background

With reference to Issue #246

This issue serves as the ToDo list for Vugu v1.0.

Please note To goal of the v1.0 release is to get vugu stable, updated to work with the current Go tool chain, to make vugu easier to use from a developer perspective - including both simpler tooling and better documentation.

We don't want to take major new features in this release. We can focus on these after the v1.0 release.

If there is something that you think is missing for the v1.0 release can you please give us your feedback in issue #246. If we keep everything in Issue #246 then the complete discussion thread is available.

We'll update this issue based on that discussion.

Please consider this list a draft. @bradleypeabody and I have been discussing what we want to change via Slack. This list represents our current thoughts.

ToDo

Examples

At the minute we are thinking of reworking the vugu examples as a tutorial series. The topics are likely to be:

If you can think of a topic that is not listed here or a common problem, can you please let us know? We can then add it to the documentation and as a worked example.

Building and Deploying with Go and Nginx

Just so folks are aware of this. There is a new Wiki page that documents how to build vugu applications using only the standard Go tool chain.The resulting Web Assembly is then deployed into a nginx web server running in a container.

This is still a draft document, so feedback from the community would be welcomed.

Moving to a Taskfile based build

@bradleypeabody and myself has been discussing this. We now have a prototype approach that seems to work, and makes building a vugu application a lot simpler.

Taskfile is written in Go so it is portable to Windows and MacOS (unlike a GNU Makefile). The steps in the build are then defined in a YAML file that Taskfile processes. This change will also allow us to depreciate the vgrun tool which is less code for us to maintain. So watch this space as this is likely to be rolled out incrementally starting with the examples.

At the minute we are using nginx as the web server, running inside a docker container to serve the vugu application, rather than the previous approach of an inbuilt web server. This is simpler as it means we do not need to maintain the existing internal web server code.

The approach is also easy to adapt if you needed to use an apache web server for example.

The new vgutil tool

Until now vugu has been generating a simple index.html that is sufficient to load your CSS stylesheet, fetch the Web Assembly file that is your vugu application and start executing it. vugu has also been serving this generated index.html file for you via its own web server.

We want to change this so that the index.html file is generated explicitly and saved on disk. It can then be served by any web server (all via the Taskfile). The new vgutil tool is how we want to do this.

vgutil will take some command line parameters and feed them into an Go template file that is then run though the Go template engine to produce a new index.html file for you. If you customise the Go template file the updates will be reflected in a newly generated index.html file.

Previously to do this you would have had to change the code of the devutil package to achieve the same result. And you'd still be using the internal web server in this case as well.

Thanks

Can we say thank you to @Lord-Y for his PR's that have updated the Go, TinyGo versions, the dependency updates and fixing the golang-ci linter errors. It has really helped @bradleypeabody and myself move things forward.

Updates

23/12/23: The _gen.go file name change and the auto-generation comment are now merges. See PR #261. Moving vugu to a Taskfile build is in progress. See PR #263 for the latest comments.