Skip to content

v0.7.0

Choose a tag to compare

@panyam panyam released this 06 Oct 03:38
· 170 commits to main since this release
d990ff5

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)

  • Loader is now Load(r, w, app any) (error, bool), not generic. BasePage, WithPagination, WithFiltering, WithAuth and WithHtmx already had that method, so goapplib.LoadAll(r, w, app, &p.BasePage, &p.WithPagination, …) compiles as written. LoadAll takes the page's app as any and ...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)
  • AuthLoader needs its app type written out, AuthLoader[*Site](&p.WithAuth, provider), since Go can no longer infer it from LoadAll. (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 the LoadAll problem. 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.