swarpc - v0.14.0
    Preparing search index...

    Changelog

    All notable changes to this project will be documented in this file.

    The format is based on Keep a Changelog and this project adheres to Semantic Versioning.

    • BREAKING: Client#(method name).broadcast:onProgress now receives a map of nodeId to progress values, which makes aggregating individual nodes' progress data into a single coherent progress value easier:

      import { sum } from "./utils";

      await client.thing.broadcast(67, (ps) =>
      console.log((sum(ps.values()) / ps.size) * 100 + "% done"),
      );
    • Procedure implementations now have access to nodeId, the ID of the node executing the request, in the tools argument.
    • A new option, Client:option.nodes, to control the number of nodes (worker instances) to spin up
    • A way to broadcast requests to multiple (or all) nodes at once with Client#(method name).broadcast
    • BREAKING: Client:options.worker is now either a string (path to the worker's source code) or a class, not an instance
    • BREAKING: When Client:options.worker is set, the Client now launches by default navigator.hardwareConcurrency nodes (worker instances) and dispatches requests to them in a balanced way.
    • Client:options.localStorage to define a Server-accessible polyfilled localStorage with data (See #32)
    • BREAKING: Server#start is now asynchronous, but does not take an argument anymore.
    • sw&rpc now handles Shared Workers correctly
    • Server:options.worker is correctly typed
    • A undefined-valued result message was sent after a thrown implementation error, resulting in a internal 'No pending request handlers' error
    • "Invalid entry point" error when trying to import Swarpc
    • Type of Server#start's self parameter now correctly accepts both Window and Worker contexts.
    • build problems when using Vite
    • client-side hooks
    • messages not intended for swarpc are ignored by the server