Skip to content

Releases: maxence-charriere/go-app

Dismounter fix and other

20 Apr 06:29
43815bc
Compare
Choose a tag to compare

Hello,
Here is a minor update that addresses reported issues:

  • OnDismount method is now called when the Dismounter interface is implemented
  • Added the JSValue function that allows getting the underlying syscall/js value from a javascript value
    // JSValue returns the underlying syscall/js value of the given Javascript
    // value.
    func JSValue(v Value) js.Value {
        return jsval(v)
    }
  • HTTP handler can now be set to use a light version of app.css. The light version does not provide default styling for HTML elements. It can be enabled by setting the UseMinimalDefaultStyles to true:
    h := app.Handler{
        UseMinimalDefaultStyles: true,
    }

Thanks to @jwmach1, @voldyman, and @ruanwenfeng for reporting issues and submitting PR.

PWA env

07 Apr 10:21
e32126e
Compare
Choose a tag to compare

Hello there.

This version allows setting environment variables to the HTTP Handler that are passed to the WebAssembly app.

How to use?

Set the environment variables in the app.Handler:

app.Handler{
    Env: app.Environment {
        "CUSTOM_FOO", "foo",
        "CUSTOM_BAR", "bar",
    },
}

Then in the WebAssembly app, retrieve it by calling Getenv:

foo := app.Getenv("CUSTOM_FOO")

Bug fixes/minor changes

  • Child node parent is now properly set when a node is added during an update
  • Browser storage have a memory implementation in non-wasm architecture
  • A Dispatcher type has been added to describe a function that is executed on the UI goroutine
  • Readme has been updated to show contributors

Thanks

thead tag and bug fix

05 Apr 07:32
0206841
Compare
Choose a tag to compare

Hello there.

This release contains the following changes:

  • Support for <thead> tag
  • Javascript files are now included at the end of the body in order to avoid concurrent access to the page loader

Thanks to @jwmach1 for reporting those issues.

Bug fixes

23 Mar 17:46
be5607e
Compare
Choose a tag to compare

This release fixes the following bugs:

  • Anchors: Now uses single-page app navigation when it is clicked and embeds non-text children (eg. H1, Span)
  • Compo.Update: Does not panic when Update is called when the component is not mounted

Thanks to @jwmach1 and @mar1n3r0 for reporting those.

V6.2.0: Customizable Root DIr

19 Mar 14:25
9528bc2
Compare
Choose a tag to compare

Hello there, this is Maxence.

I'm glad to release the v6.2.0 of the go-app package.

Customizable root directory

Previously, the app.wasm file and the web directory had to be located in the same directory as the server binary in order to be served.

This version allows changing this behavior by introducing the root directory.

The root directory is where app.wasm and the web directory are located:

CUSTOM_LOCATION
├── app.wasm
└── web
    └── Static resources...

By default located in the same directory as the server binary, it can be changed to:

  • Another local location.
  • A cloud storage bucket such as Amazon S3 or Google Cloud Storage, which is very useful in a scenario where a PWA is deployed on a cloud function to reduce function counter.
h := app.Handler{
    RootDir: "CUSTOM_LOCATION",
}

syscall/js wrapper

Wrappers for CopyBytesToGo and CopyBytesToJS have been added.

Misc

Some refactoring to improve overall code quality.

Thanks

Thanks to @sg0hsmt, @gabstv, and @ruanwenfeng for their contributions to this release.

v6.1.0: Routing UI with regexp

11 Mar 09:36
1b26aab
Compare
Choose a tag to compare

Hello,
Here come the version 6.1.0.

It introduces the possibility to route UI content from a regex pattern.

It is done by using the RouteWithRegexp() function:

package main

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

func main() {
    app.Route("/", app.Text("hello world"))
    app.RouteWithRegexp("/[0-9]+", app.Text("hello number"))
    app.Run()
}

Thanks to @stevelr for making this happen.

v6: Add demo to readme

09 Mar 10:19
46d2d54
Compare
Choose a tag to compare

This version introduces links to demo working on Google Cloud App Engine and Function.

v6: Update install instructions

08 Mar 02:42
Compare
Choose a tag to compare

Update instructions are updated to reflect the go module requirement.

v6 Fix documentation link

08 Mar 02:24
Compare
Choose a tag to compare
  • Links to go.dev documentation are fixed in README and Wiki

v6

08 Mar 01:44
Compare
Choose a tag to compare
v6

Hello, this is Maxence and I'm glad to release this new version of the go-app package.

It has been a while since the previous major version has been released and after a year using it, despite being happy of the result, I was not satisfied with a couple of things:

  • The use of the goapp program for building
  • Relied on generated static resources to work
  • HTML template was hard to debug since it does not have HTML code check and lint
  • Hack to make HTML communicate with Go was hard to maintain

In order to address those drawbacks, the v1.0.0 brings a couple of changes on the table:

  • No more goapp build tool
  • A declarative syntax that uses only Go
  • Documentation!
  • Support for go modue

This brings a lot of breaking changes. Check the Readme and the Wiki to know more about how to build progressive web apps with this package.

Hope this version helps you build awesome apps,

Maxence.