vugu-examples / taco-store

Example shopping cart
MIT License
4 stars 2 forks source link

Vugu Pages #2

Closed mertnacakgedigi closed 3 years ago

mertnacakgedigi commented 3 years ago
bradleypeabody commented 3 years ago

Overall this is great.

I'm worried about build-frontend.go and it still being build-tag ignored. That needs some review. You can see some of the build pain here: https://github.com/vugu/vugu/issues/186

Maybe this code can live in a cmd/build folder and be it's own executable. I think go run cmd/build could still work - but at least it would be a regular executable and covered by the same go.mod. Basically this approach of using single files that are build tag ignored I think is causing more pain than helping us at this point with the latest updates in Go 1.16.

Also maybe it's worth looking at how bad would it be if we told people to just run the exact comments needed manually. If we forget about stuff like hot reloading, the total commands needed is not that many.

Once:

Each build:

  1. go generate (runs vugugen)
  2. GOARCH=wasm GOOS=js go build [path/to/wasm/main] dist/main.wasm
  3. go build -o bin/server cmd/server
  4. run the executable, e.g. ./bin/server

And we could just tell people to put this stuff in a .sh file for mac/linux or .bat for Windows and be done with it.

The original goal was to make this as simple and automatic as possible, but that ain't what's happening at this point.

bradleypeabody commented 3 years ago

Great and thanks! I'm going to go ahead and merge this since it's definitely better. We'll need to get some testing done on Windows and then document this approach, but this is a great start.