add WASM blazor-like thing
This commit is contained in:
35
.vscode/launch.json
vendored
Normal file
35
.vscode/launch.json
vendored
Normal file
@@ -0,0 +1,35 @@
|
||||
{
|
||||
// Debug configs for the gowasm example. cwd is the example dir because the
|
||||
// dev server resolves ./wwwroot, ./app, ./wasm and the watched engine dir
|
||||
// relative to it.
|
||||
"version": "0.2.0",
|
||||
"configurations": [
|
||||
{
|
||||
"name": "gowasm: dev server",
|
||||
"type": "go",
|
||||
"request": "launch",
|
||||
"mode": "auto",
|
||||
"program": "${workspaceFolder}/go/cmd/examples/go-wasm-web/server",
|
||||
"cwd": "${workspaceFolder}/go/cmd/examples/go-wasm-web",
|
||||
"args": ["-addr", ":8085"]
|
||||
},
|
||||
{
|
||||
"name": "gowasm: dev server (no watch)",
|
||||
"type": "go",
|
||||
"request": "launch",
|
||||
"mode": "auto",
|
||||
"program": "${workspaceFolder}/go/cmd/examples/go-wasm-web/server",
|
||||
"cwd": "${workspaceFolder}/go/cmd/examples/go-wasm-web",
|
||||
"args": ["-watch=false"]
|
||||
},
|
||||
{
|
||||
"name": "gowasm: codegen (gowasmgen)",
|
||||
"type": "go",
|
||||
"request": "launch",
|
||||
"mode": "auto",
|
||||
"program": "${workspaceFolder}/go/cmd/gowasmgen",
|
||||
"cwd": "${workspaceFolder}/go/cmd/examples/go-wasm-web",
|
||||
"args": ["./app"]
|
||||
}
|
||||
]
|
||||
}
|
||||
73
.vscode/tasks.json
vendored
Normal file
73
.vscode/tasks.json
vendored
Normal file
@@ -0,0 +1,73 @@
|
||||
{
|
||||
// Tasks for the kjol repo. The gowasm example is a nested module at
|
||||
// go/cmd/examples/go-wasm-web, so its tasks set cwd there; the module-wide
|
||||
// Go tasks run in go/.
|
||||
"version": "2.0.0",
|
||||
"tasks": [
|
||||
{
|
||||
"label": "gowasm: dev server (hot reload)",
|
||||
"detail": "Run the go-wasm-web example: codegen + SSR + hot reload on :8085",
|
||||
"type": "shell",
|
||||
"command": "go run ./server",
|
||||
"options": { "cwd": "${workspaceFolder}/go/cmd/examples/go-wasm-web" },
|
||||
"isBackground": true,
|
||||
"problemMatcher": {
|
||||
"owner": "go",
|
||||
"pattern": {
|
||||
"regexp": "^(.*):(\\d+):(\\d+):\\s+(.*)$",
|
||||
"file": 1, "line": 2, "column": 3, "message": 4
|
||||
},
|
||||
"background": {
|
||||
"activeOnStart": true,
|
||||
"beginsPattern": "rebuilding",
|
||||
"endsPattern": "serving|reloading clients"
|
||||
}
|
||||
},
|
||||
"presentation": { "reveal": "always", "panel": "dedicated", "clear": true },
|
||||
"group": { "kind": "build", "isDefault": true }
|
||||
},
|
||||
{
|
||||
"label": "gowasm: build (build.sh)",
|
||||
"detail": "One-off build of the example: codegen + wasm + stage wasm_exec.js",
|
||||
"type": "shell",
|
||||
"command": "./build.sh",
|
||||
"options": { "cwd": "${workspaceFolder}/go/cmd/examples/go-wasm-web" },
|
||||
"problemMatcher": ["$go"],
|
||||
"group": "build"
|
||||
},
|
||||
{
|
||||
"label": "gowasm: codegen",
|
||||
"detail": "Regenerate app/*.gen.go from //gowasm: directives",
|
||||
"type": "shell",
|
||||
"command": "go run kjol/cmd/gowasmgen ./app",
|
||||
"options": { "cwd": "${workspaceFolder}/go/cmd/examples/go-wasm-web" },
|
||||
"problemMatcher": ["$go"],
|
||||
"group": "build"
|
||||
},
|
||||
{
|
||||
"label": "kjol: build ./...",
|
||||
"detail": "Build the whole kjol module (excludes the nested example)",
|
||||
"type": "shell",
|
||||
"command": "go build ./...",
|
||||
"options": { "cwd": "${workspaceFolder}/go" },
|
||||
"problemMatcher": ["$go"],
|
||||
"group": "build"
|
||||
},
|
||||
{
|
||||
"label": "kjol: vet ./...",
|
||||
"type": "shell",
|
||||
"command": "go vet ./...",
|
||||
"options": { "cwd": "${workspaceFolder}/go" },
|
||||
"problemMatcher": ["$go"],
|
||||
"group": "test"
|
||||
},
|
||||
{
|
||||
"label": "kjol: test ./...",
|
||||
"type": "shell",
|
||||
"command": "go test ./...",
|
||||
"options": { "cwd": "${workspaceFolder}/go" },
|
||||
"problemMatcher": ["$go"],
|
||||
"group": { "kind": "test", "isDefault": true }
|
||||
}
|
||||
]
|
||||
}
|
||||
Reference in New Issue
Block a user