v10.0.0
maxence-charriere
released this
20 May 06:50
·
32 commits
to master
since this release
Go-app v10.0.0 is out!
Install
go get -u github.com/maxence-charriere/go-app/v10
Changelog
General
- The engine has been rewritten to be more maintainable and efficient.
.wasm
updates are now better handled, addressing cases where the service worker is updated before the .wasm file is loaded.
Route
Route
functions now take afunc() app.Composer
parameter:app.Route("/hello", func() app.Composer{ return &helloCompnent{} })
RouteFunc
functions have been removed.- The previous
Route
behavior can be reproduced byusing app.NewZeroComponentFactory
as the Route parameter:app.Route("/hello", app.NewZeroComponentFactory(&helloCompnent{}))
Conditions
app.If
,app.ElseIf
andapp.Else
now take functions:app.If(true, func() app.UI{ return app.Text("true") })
- Added
app.IfSlice
,app.ElseIfSlice
andapp.ElseSlice
to handle cases where a function needs to return[]app.UI
.app.IfSlice(true, func() []app.UI{ return []app.UI{app.Text("true")} })
States
Context.SetState
now uses function chaining to specify options:ctx.SetState("ageState", 42). Persist(). ExpiresIn(time.Hour)