Closed MDobak closed 4 years ago
Thanks, this is fixed now. https://www.vugu.org/doc/build-and-dist
@bradleypeabody Thanks! I also want to ask you, what do you think about replacing devserver.go
in sample projects to server.go
from the documentation? For me it was (and still is) quite confusing why there are two servers provided.
Also, maybe the dist.go
from the doc should be merged with the server.go
and run when the --dev
flag is not specified? I think that would be very convenient to have one app to manage the whole project, especially for beginners like me ;)
@MDobak Yes, I agree. I'm working on putting together more examples of this with the various pieces integrated together. The vugu site itself https://github.com/vugu/vugu-site does some of this and server/main.go combines both the server functionality and distribution stuff.
The overall idea is that there are probably maybe half a dozen common patterns (simple one-folder SPA for prototyping, larger SPA app with different sections, static site renderer server-side, combo server-rendering plus SPA, and some other cases) and the plan is to put together examples for each and point to those in the documentation.
Ok, thanks for the explanation! :)
The documentation in section "Getting Started" encourages the user to download a
simple
project usingvgrun -new-from-example=simple .
command. This example project contains a filegenerate.go
with this instruction//go:generate vugugen -s
.Next in section "Building and Distribution" the documentation shows the example server code with this instruction:
go:generate vugugen .
.If the user follows above steps from the documentation, the
go generate
command will produce two conflicting files:root_vgen.go
and0_components_vgen.go
.BTW: Wouldn't it be better to replace
devserver.go
withserver.go
from the doc If both servers can work as dev servers anyway?