Releases: maxence-charriere/go-app
Dismounter fix and other
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 theUseMinimalDefaultStyles
totrue
:h := app.Handler{ UseMinimalDefaultStyles: true, }
Thanks to @jwmach1, @voldyman, and @ruanwenfeng for reporting issues and submitting PR.
PWA env
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
- @monkeywithacupcake for the Open collective integration
thead tag and bug fix
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
V6.2.0: Customizable Root DIr
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
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
This version introduces links to demo working on Google Cloud App Engine and Function.
v6: Update install instructions
Update instructions are updated to reflect the go module requirement.
v6 Fix documentation link
- Links to go.dev documentation are fixed in README and Wiki
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.