Skip to content

Releases: canvasxyz/canvas

v0.15.1

05 Jun 17:39
Compare
Choose a tag to compare
  • Allow class contracts to be initialized directly, with await MyClassContract.initialize(topic).
  • In class contracts, topics are now passed to the constructor, making it possible to create namespaced class contracts.
  • SIWESigner must now be initialized with signer, burner, or readOnly: true, e.g. new SIWESigner({ readOnly: true })
  • Show more detailed sync status on apps.
    • Adds useSyncState hook.
    • Adds app.syncStatus field to Canvas class.
  • Fixes an issue with importing @canvas-js/core inside the QuickJS environment.
  • Adds Contract export to @canvas-js/core.

Full Changelog: v0.15.0...v0.15.1

v0.15.0

22 May 05:31
Compare
Choose a tag to compare

Breaking Changes

  • Class contracts have replaced object contracts as the main, recommended way of configuring Canvas applications. Action APIs have not changed. See the docs for more details.
  • ConnectSIWE and ConnectSIWF buttons are now returned from useSIWE() and useSIWF() hooks, respectively.

Other Changes

  • Adds model-only contracts, specified as an object { models } where each model defines $rules for creating, updating, and deleting models.
  • Adds a db.id() call for generating sha256 hash ids.
  • Adds a db.random() call for generating random numbers in JS.
  • Allow db.create() to be called without a primary key.
  • Expose getSigner() and signerKeys on the core Canvas class.
  • Adds row-level editing to the network explorer.

Bug Fixes and Improvements

  • Fixes for useLiveQuery() around includes.
  • Fixes a crash when an action doesn't await database operations inside a transaction.
  • Fixes and issue with db.get() when a null value is returned.
  • The experimental synchronous loader has been moved to @canvas-js/core/sync and can be called with new Canvas({ topic, contract }). It is still not recommended for general public usage.

v0.14.0

18 Apr 19:41
Compare
Choose a tag to compare

The main application API has stabilized now. APIs relating to topics and application upgrades (e.g. migrations, snapshots, contract hashing) are still subject to change.

Breaking Changes

  • Signer package names have changed from e.g. @canvas-js/chain-ethereum to @canvas-js/signer-ethereum.
  • Action signatures have changed from function(db, ...args) {} to function(...args) {}. To access db: ModelAPI, use this.db instead. We expect to release a wrapper for developers who prefer to use arrow functions to define their applications within the next few weeks.
  • SIWESigner classes are now initialized with a random signer if you provide { burner: true } as the configuration. Otherwise, they must be initialized with a { signer: ethers.Wallet } value. If neither burner nor signer is provided, they will initialize in read-only mode.

New Features, Improvements, Other Changes

  • Applications can now be initialized with snapshots of past data. Snapshots are automatically prepended at the start of a log, and applications that use snapshots must include a hash of the snapshot in their topic, e.g. forum-example.canvas.xyz#ffae63ab95cc5483.
  • Added transactions with serializable isolation.
  • Added Sign in with Farcaster, for browser logins and miniapp frame logins.
  • Added support for providing TypeScript contracts to the runtime, which are compiled using esbuild-wasm.
  • Ability to live-edit and live-update applications from the network explorer, to switch in a new running contract.
  • Improved type derivation for useLiveQuery() and useCanvas().
  • Messages and actions are now encoded in CBOR, and performance has been significantly increased for large databases. This is an automatic upgrade (large applications may take a longer time to start while the automatic migration runs).
  • Added internal upgrade functionality to the database. Upgrades run when an application starts, and are resumable if interrupted.
  • Fixes some crashes on application shutdown.
  • Removed branch tracking and custom merge functions, for performance reasons.
  • Removed db.link().

v0.14.0-next.3

18 Apr 18:34
Compare
Choose a tag to compare
v0.14.0-next.3 Pre-release
Pre-release

Release candidate for 0.14.0.

What's Changed

Full Changelog: v0.14.0-next.2...v0.14.0-next.3

v0.14.0-next.2

09 Apr 22:50
Compare
Choose a tag to compare

Release candidate for 0.14.0.

What's Changed

  • Composite primary keys by @joeltg in #440
  • Replace Action | Session | Snapshot with a shared MessageType by @rjwebb in #442
  • make modeldb-sqlite-wasm worker-only, with transient unit tests directly in nodejs by @joeltg in #443
  • migration system by @joeltg in #445
  • Make esbuild async, add browser implementation of buildContract using esbuild-wasm by @raykyri in #446
  • remove branches by @joeltg in #448
  • Live update applications from network explorer by @raykyri in #447
  • Update eslint to ^9.10.0 by @raykyri in #444
  • CBOR Ancestors by @joeltg in #465
  • Support default values when adding properties by @joeltg in #467
  • packages/core: preserve snapshot when updating applications from explorer, fix clock handling by @raykyri in #468
  • CBOR messages by @joeltg in #470
  • packages/hooks: Use remote contracts in hook by @raykyri in #469
  • Rework snapshots on log by @raykyri in #472
  • packages/signatures: remove privkeyseed, creating signers now defaults to a random key by @raykyri in #473

Full Changelog: v0.13.12...v0.14.0-next.2

v0.13.12

23 Jan 06:29
104b940
Compare
Choose a tag to compare

What's changed

  • No longer require top-level await in packages using @canvas-js/core or @canvas-js/vm.

v0.13.11

22 Jan 08:22
Compare
Choose a tag to compare

What's changed

  • Adds SIWFSigner signer, for Sign in With Farcaster support. See here for instructions.

v0.13.10

22 Jan 08:20
Compare
Choose a tag to compare

What's Changed

  • Canvas now targets ES2022, and uses top level await.
  • Add --connect argument to CLI run command for connecting to a WebSocket
  • Network explorer design updates.

v0.13.9

22 Jan 08:18
Compare
Choose a tag to compare
  • Add getType() method for ModelDB users to determine the database backend
  • Show database backend in network explorer
  • Serve the network explorer on the root path if nothing else is being served using canvas run --network-explorer

v0.13.8

22 Jan 08:17
Compare
Choose a tag to compare

What's changed

  • Fix serving of network explorer assets when deploying via the CLI in production.