All Versions
82
Latest Version
Avg Release Cycle
8 days
Latest Release
57 days ago

Changelog History
Page 1

  • v7.0.5

    August 25, 2020

    Hello,

    This version provides the following changes:

    • ๐Ÿ›  Fixed a bug where boolean attributes were not updated
    • Min() and Max() HTML element functions now take an interface{} argument rather than string
  • v7.0.4

    August 12, 2020

    Hello,

    ๐Ÿš€ Here is a small release that brings the following:

    • The handler now proxy an ads.txt file that is located at the root of the static files directory. This allows complying with AdSense requirements.
    • app.Input().Step(v int) has been changed to app.Input().Step(v float64) since step can be a decimal value.
  • v7.0.3

    July 11, 2020

    Hello,

    Here is v7.0.3 which introduces the following changes:

    • ๐Ÿ›  Fixed bug that did not remove event handlers when components were dismounted
    • โ™ป๏ธ Refactored how scripts are loaded in the Handler by using defer attribute
    • โž• Added Iframe missing attributes
    • Generated GitHub pages are now installable with Chrome

      How to update:go get -u github.com/maxence-charriere/go-app/v7

  • v7.0.2

    June 28, 2020

    Hello there,
    I'm thrilled to release version 7 of go-app.

    This version is focused on internal improvements that improve code quality and maintainability. Unfortunately, those improvements bring a few small changes in the API, which is why there is a version bump.

    What is new?

    ๐Ÿ’ป Context that is bound to a UI element lifecycle. The context can be used with functions that accept context.Context. Contexts are canceled when the UI element they are bound with is dismounted. It is passed in Mounter and Navigator interfaces, and event handlers.

    โœ… TestMatch: testing api to unit test specific UI element:

    tree := app.Div().Body( app.H2().Body( app.Text("foo"), ), app.P().Body( app.Text("bar"), ), )// Testing root:err := app.TestMatch(tree, app.TestUIDescriptor{ Path: TestPath(), Expected: app.Div(), })// OK =\> err == nil// Testing h2:err := app.TestMatch(tree, app.TestUIDescriptor{ Path: TestPath(0), Expected: app.H3(), })// KO =\> err != nil because we ask h2 to match with h3// Testing text from p:err = app.TestMatch(tree, app.TestUIDescriptor{ Path: TestPath(1, 0), Expected: app.Text("bar"), })// OK =\> err == nil
    

    ๐Ÿ‘Œ Support for aria HTML element property: Fix #419

    app.Div(). Aria("foo", "bar"). Text("foobar")
    

    0๏ธโƒฃ A default logger can be set

    ๐Ÿš€ go-app PWA can now be deployed a GitHub Page with the help of GenerateStaticWebsite function:

    package mainimport ( "fmt""github.com/maxence-charriere/go-app/v7/pkg/app")func main() { err := app.GenerateStaticWebsite("DST\_DIR", &app.Handler{ Name: "Github Pages Hello", Title: "Github Pages Hello", Resources: app.GitHubPages("goapp-github-pages"), }) if err != nil { fmt.Println(err) return } fmt.Println("static website generated") }
    

    It generates files that can directly be dropped into a GitHub repository to serve the PWA.
    ๐Ÿ‘€ See live example: https://maxence-charriere.github.io/goapp-github-pages/

    ๐Ÿ‘Œ Support for robots.txt: A robots file is now served by the Handler when /web/robots.txt exists

    โ™ป๏ธ Internal code refactored to be more maintainable

    Serving static resources can now be customized by implementing the ResourceProvider interface

    How to migrate from v6 to v7

    go-app v7 mainly introduced internal improvements. Despite trying to keep the API the same as v6, those changes resulted in API minor modifications that break compatibility.

    Here is a guide on how to adapt v6 code to make it work with v7.

    Imports

    Go import instructions using v6:

    import ( "github.com/maxence-charriere/go-app/v6/pkg/app")
    

    must be changed to v7:

    import ( "github.com/maxence-charriere/go-app/v7/pkg/app")
    

    http.Handler

    ๐Ÿšš RootDir field has been removed.
    0๏ธโƒฃ Handler now uses the Resources field to define where app resources and static resources are located. This has a default value that is retro compatible with local static resources. If static resources are located on a remote bucket, use the following:

    app.Handler{ Resources: app.RemoteBucket("BUCKET\_URL"), }
    

    ๐Ÿ’… UseMinimalDefaultStyles field has been removed.
    go-app now use CSS styles that only apply to the loading screen and context menus. The former default styles have been removed since they could conflict with some CSS frameworks.

    Component interfaces

    โšก๏ธ Some interfaces to deals with the lifecycle of components have been modified to take a context as the first argument. Component with methods that satisfies the following interfaces must be updated:

    • Mounter : OnMount() become OnMount(ctx app.Context)
    • Navigator : OnNav(u *url.URL) become OnNav(ctx app.Context u *url.URL)

    Event handlers

    EventHandler function signature has been also modified to take a context as the first argument:

    func(src app.Value, e app.Event) become func(ctx app.Context, e app.Event)

    Source is now accessed from the context:

    // Event handler that retrieve input value when onchange is fired:func (c \*myCompo) OnChange(ctx app.Context, e app.Event) { v := ctx.JSSrc().Get("value") }
    
  • v7.0.1

    June 28, 2020
  • v7.0.0

    June 23, 2020
  • v6.6.2

    June 23, 2020

    Summary

    • Navigate does not trigger a page reload anymore when called manually.

    Thanks to @jwmach1 and @walgenbach for reporting this.

  • v6.6.1

    June 10, 2020

    Summary

    • ๐Ÿ›  Fixes a bug that always triggered a component replacement when its root was another component
  • v6.6.0

    June 10, 2020

    Summary

    • ๐Ÿ›  Fixes a crash that occurred when a component was the root of another component
    • Indirect is now exported
    • โšก๏ธ The Updatable interface has been removed: code will compile but OnUpdate functions are not called anymore. This is removed because I felt it complicate components life cycle and was buggy.
  • v6.5.0

    May 15, 2020

    Hello,
    ๐Ÿš€ I'm glad to release the version 6.5.0.

    Clean body

    go-app now provides the function CleanBody. This is to remove extra elements in the body that might be added by third-party libraries.

    ๐Ÿ— While building an app, I ran into a problem where Amazon advertisements where popping into the screen when navigating fast to other pages. The problem was that Amazon is loading a script to display their ads. When the loaded code does not find the ad container (when a component is dismounted), it inserts the ads directly in the body.

    This is to prevent this kind of behavior from third-party libraries.

    ๐Ÿ› Bug Fixes

    โ™ป๏ธ Some code has been refactored and hash navigation (eg. http://my.domain/hello#Input) now works properly.