This version brings new functionality to the Event subsystem.
A huge thank you to everyone that was involved in this release!
We’ve been busy on the Linux front and now have support for:
Plus better support for existing distributions:
The Javascript part of the runtime has been refactored to bring in some improvements. It has been assembled as a standard node module that may now be imported by frontend code to get access to the runtime methods.
import Wails from '@wailsapp/runtime';
Wails.Events.On('myevent', () => {
// etc
})
This is going to allow us to improve the runtime with minimal impact on application code.
The original, lower cased methods for the JS runtime have been deprecated. The driver for this has been to unify the Go and JS runtime signatures. The new methods are the same as the old ones, just capitalised.
This release sees a huge refactor of the runtime to improve maintainability and testability. With it come a number of new methods which are designed to simplify coordination between the frontend and backend. For the time being, these are only available in the JS runtime.
Events.OnMultiple(eventName, callback, maxCallbacks)
Registers a listener that will call callback
a maximum of maxCallbacks
times. After this time, the listener will be removed.
Events.Once(eventName, callback)
Registers a listener that will be destroyed after being notified once. Shorthand for Events.OnMultiple(eventName, callback, 1)
.
Events.Heartbeat(eventName, timeInMilliseconds, callback)
Heartbeat will emit eventName
every timeInMilliseconds
until it is acknowledged by Event.Acknowledged
. When that happens, callback
is invoked.
Events.Acknowledge(eventName)
Acknowledge will acknowledge the heartbeat event eventName
.
It’s now possible to bind Go methods with zero return types correctly. This will return an undefined
in the promise callback.
wails issue
now includes npm, gcc and node versions. Thanks Byron!wails issue
now also relies on /etc/os-release
in Linux for system information, replacing the requirement for lsb
. Thanks Nikolai Zimmermann!We will be spending the next month improving documentation and bug fixing. Please let us know what bugs you find in v0.18.2 and we will look at them with the highest priority!
We hope you enjoy the final v0.* release! See you at v1.0.0!