Comments (4)
I guess you mean it limits your development using Go-App?
Could you give an example what is problematic for you to get right? Are you trying to combine "normal" JavaScript libraries with Go-App?
We generally do not have problems with debugging and bug fixing for our steadily growing applications that are from using WASM / Go-App. Sure, a step debugger that links back to the Go source would be nice, but using our print logging with stack traces works very well for us and writing smaller example applications before using new functionalities in a larger project makes things also more manageable.
P.S.: If you need some private Methods, just check out the Go-App code and use a "go.work" file in the project. Then you can add all the debugging you need. This possibility is one of the reasons why we use Go in the company.
from go-app.
I use the following codes in unit test. The code is mostly effective in logical testing. I think that it will be nice if a go side DOM is supported in go-app nowasm mode.
package tester
import (
"fmt"
"github.com/maxence-charriere/go-app/v9/pkg/app"
)
func CValue(v any) Value {
return value{
Value: app.ValueOf(v),
value: v,
methods: make(map[any]func(args ...any) app.Value),
}
}
type (
Value interface {
app.Value
Methods(map[string]func(args ...any) app.Value) Value
}
value struct {
app.Value
value any
methods map[any]func(args ...any) app.Value
}
)
func (v value) Methods(m map[string]func(args ...any) app.Value) Value {
for k, f := range m {
v.methods[k] = f
}
return v
}
func (v value) Call(m string, args ...any) app.Value {
if f, ok := v.methods[m]; ok {
return f(args...)
}
fmt.Println("unknown function ", m)
return CValue(v.value)
}
func (v value) IsNull() bool {
return v.value == nil
}
This is logic test.
func TestFundamentals(t *testing.T) {
v := Fundamentals(0)
canvas := tester.CValue(map[any]any{
"width": 100,
"height": 100,
}).Methods(map[string]func(args ...any) app.Value{
"getContext": func(args ...any) app.Value {
//name := args[0].(string)
//attrs := args[1]
return tester.CValue(map[any]any{}).
Methods(map[string]func(args ...any) app.Value{
"getParameter": func(args ...any) app.Value {
return tester.CValue(map[any]any{})
},
"getExtension": func(args ...any) app.Value {
return tester.CValue(map[any]any{})
},
"createTexture": func(args ...any) app.Value {
return tester.CValue(map[any]any{})
},
"bindTexture": func(args ...any) app.Value {
return tester.CValue(map[any]any{})
},
"texParameteri": func(args ...any) app.Value {
return tester.CValue(map[any]any{})
},
})
},
"addEventListener": func(args ...any) app.Value {
return tester.CValue(map[any]any{})
},
"removeEventListener": func(args ...any) app.Value {
return tester.CValue(map[any]any{})
},
})
v.Run(canvas)
}
from go-app.
What is 'go-app nowasm mode'? Do you mean using the Go-App declarative HTML generation? Isn't this a totally bloated way to create a standard HTML web server?
from go-app.
Go.work is a good idea.Thank you @oderwat very much.
from go-app.
Related Issues (20)
- goappGetenv is not a function, got undefined HOT 7
- app.ValueOf() panic: ValueOf: invalid value
- Custom HamburgerButton not working in v9
- run in Cloudflare workers HOT 3
- https://go-app.dev updates are lacking latest releases HOT 3
- Unable to run app with a prefix HOT 5
- type app.BrowserWindow has no field or method AddEventListener HOT 11
- TypeError: WebAssembly.instantiate(): Import #0 module="gojs": module is not an object or function HOT 2
- OnPaste Mechanism HOT 4
- How to make app installable HOT 20
- Building a side bar HOT 1
- Login in a go-app HOT 2
- Survey: What UI framework do you use? HOT 5
- Stop chrome from refreshing tabs HOT 4
- Error while trying to compile intro code HOT 3
- Question about dynamic update and the data retrival HOT 2
- Raw can't be updated HOT 3
- TypeError: import gojs:runtime.scheduleTimeoutEvent must be an object HOT 13
- go-app v10 does not work in MacOS Safari HOT 14
- Documentation issue in Getting Started page
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from go-app.