
TypeScript Modules (Beta)
TypeScript/JavaScript modules are finally here! We're extremely excited to announce v1.6. For the first time in several years we've added a new server module language, and it required a whole new runtime! SpacetimeDB now ships with v8.
In order to get started with TypeScript modules, follow our quickstart guide or read the module API reference. Publishing a TypeScript module is almost exactly the same as publishing a Rust or C# module. In order to get started simply run:
spacetime init --lang typescript # in the appropriate directory
spacetime publish <your-module-name> # in the directory with your package.json
The spacetime
CLI tool will look for src/index.ts
and automatically bundle your application and upload it to SpacetimeDB.
⚠️ BETA NOTICE: TypeScript modules are currently in beta. As a result performance is not representative of the final product. If you encounter bugs or other issues, please file a new issue here with the
typescript-modules
label.
Other Features
In v1.6 we are now also adding additional schema migration support, including adding columns to tables! In order to add a column, just add a column to the end of your table definition, specify a default value, and push the new module. The CLI will warn you if your new schema is compatible with existing clients, and will disconnect the appropriate clients if required by the migration. This is one more step in our journey to provide a world class schema migration experience for your apps and games.
Other improvements
- Added a
Default
attribute to fields in C# modules - Database snapshot improvements:
- The database snapshots at a more intelligent interval
- Improve snapshot compression + metrics (#3296)
- Unreal Engine
- allow access to inherited properties from all contexts in Blueprint
- Fixed some Unreal code generation bugs when using optional types.
- Adding wss:// support for the Unreal SDK (#3328)
- TypeScript SDK
- Fixed an issue where we use table_name_camelcase instead of table_name for
useTable
in TypeScript - Fix bug where TypeScript SDK crashes when I32 is the primary key
- Fixed an issue where we use table_name_camelcase instead of table_name for
- Misc bugfixes:
- Fixed an issue where Rust dependencies would automatically be rolled forward beyond the specified version
- Fix some errors when using indexes on floating-point types
- Reduced some spammy logs on the server side
- Other miscellaneous performance improvements
What's Changed
- Expand scope of
DurabilityProvider
to include snapshotting by @kim in #3295 - Improve snapshot compression + metrics by @kim in #3296
- core: disconnect clients by @Shubham8287 in #3275
- Document PG wire format by @mamcx in #3302
- Add SpacetimeAuth docs by @JulienLavocat in #3317
- Fix UPROPERTY initialization and new Blueprint Library for FContextBase by @JasonAtClockwork in #3287
- docs: fix closing code section and some grammar improvements by @gianpaj in #3322
- cli: pre-publish endpoint call. by @Shubham8287 in #3278
- Smoketest : Hotswap should not disconnect subscribers. by @Shubham8287 in #3301
- Fix link to sql page by @mamcx in #3326
- Fixes #3299 by @cloutiertyler in #3330
- Small change to auth docs by @cloutiertyler in #3329
- README - Fix root directory for generating CLI docs by @bfops in #3303
- Fix
tools/publish-crates.sh
by @bfops in #3268 - Jlvc/fix spacetimeauth docs by @JulienLavocat in #3333
- core: Allow snapshot worker to be reused by @kim in #3331
- v8: add and use
log_traceback
by @Centril in #3338 - V8: measurements, todos, and docs by @Centril in #3339
- Extract
InstanceEnv::console_timer_end
by @Centril in #3340 - Fix bindgen tests (due to crate
timezone_provider
) by @Centril in #3341 - extract
InstanceCommon::new
+run_describer
by @Centril in #3342 - add
InstanceEnv::{database_identity, fill_buffer_from_iter}
+epoch_ticker
by @Centril in #3345 - Extract from wasm_instance_env + console_timer_end: use Noop backtrace by @Centril in #3346
- split create snapshot method by @Shubham8287 in #3344
- V8: add syscalls, flesh out call_reducer, etc. by @Centril in #3348
- CI - Multi-line runs fail properly on Windows by @bfops in #3337
- Updated the size scripts for the TypeScript package by @cloutiertyler in #3269
- Adding wss:// support for the Unreal SDK by @thediymaker in #3328
- v8: use fast static strings for known strings by @Centril in #3351
- Rekhoff/csharp default field values by @rekhoff in #3235
- V8: Enable as unstable, add syscalls, flesh out call_reducer, etc. by @Centril in #3276
- Fixes an issue where we use table_name_camelcase instead of table_name for
useTable
in TypeScript by @cloutiertyler in #3354 - Fix Rust dep versions by @bfops in #3369
- Generate read-only table handles for
#[table]
by @joshua-spacetime in #3364 async
-ify Wasmtime (and v8) execution by @gefjon in #3263- Pin
temporal_rs
version by @bfops in #3385 - Remove staging from spacetimeauth docs and update react integration by @JulienLavocat in #3347
- CI - Tweak caching in
typescript/build-and-test
by @bfops in #3396 - V8: use ES modules instead of global by @Centril in #3361
- Bump Rust to 1.90 by @coolreader18 in #3397
- CI - Clean up several scripts and call sites related to codegen by @bfops in #3363
- CI - Check that C# bindings are up to date by @bfops in #3362
- Misc cleanups in
tools/upgrade-version
by @bfops in #3370 - Noa/ts module host changes by @coolreader18 in #3388
- Fix python example to not advise to use ~/token.py by @mamcx in #3393
- Removed errant console.log/print statements by @cloutiertyler in #3402
- Fix for Unreal codegen for Optional fields by @JasonAtClockwork in #3360
- Remove use of DDC during CI tests by @JasonAtClockwork in #3367
- Windows - Set
linker = "lld-link"
by @bfops in #3406 - Also capture a snapshot every new commitlog segment by @gefjon in #3405
- Add forgotten variance to table_index::can_merge by @SamuelE-Arvika in #3391
- Bump versions to 1.6.0 by @bfops in #3413
- Typescript module API by @coolreader18 in #3327
New Contributors
- @gianpaj made their first contribution in #3322
- @thediymaker made their first contribution in #3328
- @SamuelE-Arvika made their first contribution in #3391
Full Changelog: v1.5.0...v1.6.0