feat: improve component support

This commit is contained in:
Joao Goncalves
2025-11-03 00:41:05 -01:00
parent c0e050b0f8
commit 23aebf73f2
3 changed files with 117 additions and 104 deletions

6
via.go
View File

@@ -99,11 +99,6 @@ func (v *via) Page(route string, composeContext func(c *Context)) {
v.logDebug(c, "GET %s", route)
composeContext(c)
v.registerCtx(c.id, c)
// viewFn := c.view
// viewFnWithID := func() h.H {
// return h.Div(h.ID(c.id), viewFn())
// }
// c.view = viewFnWithID
view := v.baseLayout(h.HTML5Props{
Head: []h.H{
h.Meta(h.Data("signals", fmt.Sprintf("{'via-ctx':'%s'}", id))),
@@ -180,7 +175,6 @@ func New() *via {
var sigs map[string]any
_ = datastar.ReadSignals(r, &sigs)
cID, _ := sigs["via-ctx"].(string)
app.logDebug(nil, "GET /_action/%s via-ctx=%s", actionID, cID)
active_ctx_count := 0
inactive_ctx_count := 0
for _, c := range app.contextRegistry {