Breaking Changes
This release implments a new topic format, so multiple contracts can be used in a single application - e.g. for partial replication, separate "rooms", etc.
- Class contracts now take a
static topic = "..."
parameter, and class contracts now take atopic
field. - For class contracts, the topic now includes the class name by default, e.g.
example.com.Object
, unless the class is an anonymous class. - Topics will include a hash of the snapshot, code, and/or constructor arguments, if any of those three elements are present. For example:
example.Object:e8ae8ec9....
. Topics initialized with constructor() args will now have a unique topic based on the hash of the arguments. - Canvas.initialize now takes
topicOverride
as an argument, instead oftopic
.
Other improvements
- Adds useLiveQuery hook to the @canvas-js/client package.
- Improved types for the @canvas-js/core/synchronous initializer.
- Enabled experimental support for browser-to-browser libp2p. To connect to a WebRTC mesh, call .startLibp2p() on a Canvas instance in the browser.