Skip to content

Release v2.17.0

Latest

Choose a tag to compare

@rekhoff rekhoff released this 02 Dec 22:00
· 7 commits to master since this release
303c7dd

Features

Asynchronous inter-database communication for C# and C++

Async IDC is now available in C# and C++ modules, following the earlier Rust and TypeScript implementations.

For C#: spacetime generate emits C# module bindings for spacetime.json dependencies, outbox tables are declared with [Table(Outbox = typeof(Gw.Reducers.X))] or [Outbox(typeof(...))], parameters can be remapped with [Param], and [OnResult(typeof(Row))] marks the reducer that receives each call's result.

For C++: spacetime generate --bindings module --lang cpp emits receiver bindings, outbox tables are declared with SPACETIMEDB_OUTBOX_TABLE or the one-line SPACETIMEDB_OUTBOX_FOR, and SPACETIMEDB_REDUCER_ON_RESULT handles each call's result.

(#6588, #6620)

Unit testing for C# modules

C# modules can now be unit tested in-process against the real datastore. Tests call reducers, procedures, views and typed queries directly through a ModuleTestContext, with a controllable clock and test identities.

The new SpacetimeDB.Testing NuGet package (.NET 10) is published alongside SpacetimeDB.Runtime, and spacetime init sets up the test package for .NET 10 modules. The chat-console-cs template includes an example.

using var test = ModuleTestContext.Create(typeof(Module).Assembly);
test.Clock.Set(new Timestamp(1_000_000));
test.WithReducerTx(TestAuth.Internal(), ctx => Module.SendMessage(ctx, "Hello!"));
Assert.Equal("Hello!", Assert.Single(test.Db.Message.Iter()).Text);

(#6501)

Breaking Changes

C# modules: a B-tree index on a unique column becomes that column's unique index

Declaring [Index.BTree] on a [Unique] or [PrimaryKey] column no longer produces two accessors. The one declared accessor remains, and it is the unique index, with Find/Update/Delete and no Filter — matching Rust's behavior.

(#6620)

Bug Fixes

TypeScript SDK: fix ctx.from in a submodule view for explicitly named tables

A submodule view returning ctx.from.<table> failed with Error executing raw SQL returned by view when the table had an explicit name. The query builder now uses the accessor name.

(#6661)

TypeScript SDK: keep the URI path when connecting

The TypeScript SDK now keeps the path of the connection URI, so ws://host/stdb connects to /stdb/v1/..., matching the Rust SDK.

(#6642)

V8: ArrayBuffers now count toward the module heap limit

--enforce-global-heap-limit is now passed to V8, so ArrayBuffer allocations are tracked and count toward a module's memory limit.

(#6571)

Fix Stripe, PostHog and Auth package types on SDK 2.12

The @spacetimedb/auth and @spacetimedb/posthog packages no longer emit type arguments that SDK 2.12 doesn't accept, fixing .d.ts errors for apps on 2.12 with skipLibCheck: false. The unpublished Stripe package got the same fix.

(#6681)

Improvements

Faster inter-database communication with pipelining

IDC deliveries are now pipelined: a sender keeps up to 16 messages per stream in flight instead of one, so a stream is no longer limited to one round trip per message. Callbacks and acknowledgements still follow sender order.

(#6674)

Wasmtime upgraded from 39 to 48.0.7

This upgrade clears 18 open Dependabot alerts (four critical) and moves to a long-term-supported Wasmtime release line. Each module is recompiled once after deploy, since Wasmtime's compiled-module cache is keyed by version.

(#6693)

Migrations added to ModuleDef

Migrations are now a section of ModuleDef, laying the groundwork for module migrations.

(#5953)

Client SDK crates now licensed under Apache 2.0

(#6664)

What's Changed

  • Added async inter-database communication for C++ modules in #6588
  • Added async inter-database communication for C# modules in #6620
  • Pipelined IDC deliveries, up to 16 in-flight messages per stream, in #6674
  • Added unit testing for C# modules in #6501
  • Upgraded Wasmtime from 39 to 48.0.7 in #6693
  • Added migrations to ModuleDef in #5953
  • Fixed ctx.from in a submodule view for explicitly named tables in #6661
  • Kept the URI path when the TypeScript SDK connects in #6642
  • Counted ArrayBuffers toward the V8 module heap limit in #6571
  • Fixed Stripe, PostHog and Auth package types on SDK 2.12 in #6681
  • Updated client SDK crate licenses to Apache 2.0 in #6664

Full public changelog: v2.16.3...v2.17.0