Releases: canvasxyz/canvas
Releases · canvasxyz/canvas
v0.15.1
- 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
, orreadOnly: true
, e.g.new SIWESigner({ readOnly: true })
- Show more detailed sync status on apps.
- Adds
useSyncState
hook. - Adds
app.syncStatus
field to Canvas class.
- Adds
- 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
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()
andsignerKeys
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 withnew Canvas({ topic, contract })
. It is still not recommended for general public usage.
v0.14.0
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) {}
tofunction(...args) {}
. To accessdb: ModelAPI
, usethis.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
v0.14.0-next.2
Release candidate for 0.14.0.
What's Changed
- Composite primary keys by @joeltg in #440
- Replace
Action | Session | Snapshot
with a sharedMessageType
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