Repository navigation
v0.7.0
goapplib.LoadAll can now chain goapplib's own mixins, which the guides always showed it doing but which never compiled. To get there, Loader and LoadAll lost their type parameter, which breaks code that implemented Loader[AC] or called LoadAll with type arguments, hence 0.7.0 rather than a patch. goapplib, @panyam/tsappkit and @panyam/tsappkit-solid are all at 0.7.0. The npm packages don't change apart from the version.
Changed (breaking)
Loaderis nowLoad(r, w, app any) (error, bool), not generic.BasePage,WithPagination,WithFiltering,WithAuthandWithHtmxalready had that method, sogoapplib.LoadAll(r, w, app, &p.BasePage, &p.WithPagination, …)compiles as written.LoadAlltakes the page's app asanyand...Loader. (PR 110, issue 107)LoaderFunc[AC]stays typed for an app's own steps and gets the app as*App[AC]. Handed an app of another type, it doesn't run and returns an error naming both types, so the page renders a 500 rather than panicking. (PR 110)AuthLoaderneeds its app type written out,AuthLoader[*Site](&p.WithAuth, provider), since Go can no longer infer it fromLoadAll. (PR 110)
Unchanged: the mixins and how they're embedded, View[AC], Register, and a page's own Load(r, w, app *App[AC]).
Docs
- Getting started and Concepts pages on the docs site, built around
docsite/examples/hello, a small app whose files the pages include and whose tests render it on every PR. Writing them against compiled code is what found theLoadAllproblem. INTEGRATION_GUIDE.md and the matching USAGE_GUIDE sections now point there. (PR 109, issue 94)
Upgrading
Bump goapplib to v0.7.0 and the npm packages to ^0.7.0. If you implemented Loader[AC], change its Load to take app any (or wrap it as goapplib.LoaderFunc[*YourApp](fn)), drop any explicit type arguments from LoadAll, and write AuthLoader[*YourApp](…). A page that doesn't use these compiles unchanged.