json.Unmarshal parses all numbers to float64, which breaks any integer
settings values. This PR changes MetaSettingsType.UnmarshalJSON to use
json.Decoder, which is capable of parsing into a meta-type json.Number,
which can be interpreted as a float or an integer. It also properly
handles pointer types.
This migrates all remaining eventbus events sent over the websocket to
use the wps interface. WPS is more flexible for registering events and
callbacks and provides support for more reliable unsubscribes and
resubscribes.
The frontend wshserver.ts had a weird circuitous dependency on wos.ts,
which was unnecessary. This moves the misplaced functions into wshrpc.ts
and updates the generation logic.
Fixes an infinite loop in the layoutModel atom synchronization that
would cause the atom to update indefinitely when the root node is
deleted.
Also adds a dedicated `disabled` flag for the IconButton decl so we can
disable the onClick handler when the button is disabled.
Also updates the Magnify toggle button to use this new flag, so that
when there's only one leaf in a layout, the magnify button is disabed.
With this PR, Electron will generate a new authorization key that the Go
backend will look for in any incoming requests. The Electron backend
will inject this header with all requests to the backend to ensure no
additional work is required on the frontend.
This also adds a `fetchutil` abstraction that will use the Electron
`net` module when calls are made from the Electron backend to the Go
backend. When using the `node:fetch` module, Electron can't inject
headers to requests. The Electron `net` module is also faster than the
Node module.
This also breaks out platform functions in emain into their own file so
other emain modules can import them.
This makes it possible to send wsh commands from wsh on a remote session
to wavesrv running locally. The exact behavior of running those commands
isn't implemented, but the underlying interface is added here.