socketless icon indicating copy to clipboard operation
socketless copied to clipboard

Update the documentation prior to publishing v5

Open Pomax opened this issue 1 year ago • 0 comments

We need to make sure that the following documents:

  • API.md
  • ARCHITECTURE.md
  • DEV.md
  • HOWTO.md

Are updated to incoporate the changes from:

v5.0.0 (pending)

Reimplemented state locking on the browser side, as the diff code breaks really hard when users are allowed to modify the state directly. To work with a mutable state, a special this.getStateCopy() function has been introduced that creates a mutable deep copy of the current state using the JS structuredClone() function.

The code for calling client functions from the browser by using this.server.functionName was also improved to make sure that functionality works even when the client is not connected to a server (which should not be necessary for a pure browser<->client call).

v4.3.0 (13 December 2024)

Fixed this.quit() and this.disconnect() not working in the browser.

Added the ability to call client functions directly from the browser, for logic that does not involve the server, such as toggling client-side flags from the browser.

v4.2.0 (5 December 2024)

Added the error stack trace for remote throws, so that the caller can actually see where things errored on the receiving side.

v4.1.0 (30 November 2024)

Changed the init sequence for browser clients. The code now waits to call init() on the web client until a socket connection has been established, and the current state has been obtained from the client and locally bound.

This gives code inside the init() function access to an up-to-date this.state variable, and allows web clients to immediately build the correct UI, rather than needing to first generate a "default" UI that cannot be updated to the correct view until updateState happens.

Related, the attempt at preventing modification of this.state was incomplete, and a rigorous protection mechanism proved to be too much code, slowing things down, for no real payoff, so instead the partial protection mechanism was removed. If your code tries to modify it, it will modify it. This is not considered a backward compatibility breaking change, as no real code could have relied on overwriting, or manually changing, the browser state value.

Additionally, the linkClasses shorthand function is no longer deprecated, because it was convenient enough for enough people to keep using.

Consistency-wise, the spelling of webserver has been changed to webServer, while also keeping the old spelling to prevent existing code from breaking. This is not a breaking change, but note that the old spelling will be removed in the next major release.

Pomax avatar Dec 16 '24 19:12 Pomax