Commit Graph

3186 Commits

Author SHA1 Message Date
Phoebe Goldman 3c15d8a06c Update Rust client SDK docs for SpacetimeDB#2118 (#130) 2025-01-28 13:18:13 -05:00
Tyler Cloutier 2ab7e5e8ed Updated the TypeScript quickstart guide to use the new 1.0 API (#141)
* Updated the quickstart guide to use the new 1.0 API

* Completed quickstart rewrite

* Update docs/sdks/typescript/quickstart.md

Co-authored-by: Phoebe Goldman <phoebe@goldman-tribe.org>

* Update docs/sdks/typescript/quickstart.md

Co-authored-by: Phoebe Goldman <phoebe@goldman-tribe.org>

* Update docs/sdks/typescript/quickstart.md

Co-authored-by: Phoebe Goldman <phoebe@goldman-tribe.org>

* Update docs/sdks/typescript/quickstart.md

Co-authored-by: Phoebe Goldman <phoebe@goldman-tribe.org>

* Update docs/sdks/typescript/quickstart.md

Co-authored-by: Phoebe Goldman <phoebe@goldman-tribe.org>

* Clarification

* Update docs/sdks/typescript/quickstart.md

Co-authored-by: Phoebe Goldman <phoebe@goldman-tribe.org>

* Update docs/sdks/typescript/quickstart.md

Co-authored-by: Phoebe Goldman <phoebe@goldman-tribe.org>

* Wrong type of quotes

* Update docs/sdks/typescript/quickstart.md

Co-authored-by: Phoebe Goldman <phoebe@goldman-tribe.org>

* Update docs/sdks/typescript/quickstart.md

Co-authored-by: Phoebe Goldman <phoebe@goldman-tribe.org>

* Apply suggestions from code review

Co-authored-by: Phoebe Goldman <phoebe@goldman-tribe.org>
Co-authored-by: rekhoff <r.ekhoff@clockworklabs.io>

* Address review comments

---------

Co-authored-by: Phoebe Goldman <phoebe@goldman-tribe.org>
Co-authored-by: rekhoff <r.ekhoff@clockworklabs.io>
2025-01-27 19:41:07 -05:00
rekhoff 011187d730 Changed subscript to SubscribeToAllTables (#155)
Missed updating the HandleConnect from `Subscribe("SELECT * FROM *"` to `SubscribeToAllTables()` in the updated code block on page 3.
2025-01-27 15:45:45 -08:00
Zeke Foppa 20ab595b29 Bump version to 1.0.0-rc4 (#2177)
Co-authored-by: Zeke Foppa <bfops@users.noreply.github.com>
2025-01-27 22:54:36 +00:00
Tyler Cloutier a81b6c2cd5 Adds improvements & new crates to publish-crates.sh (#2173)
Signed-off-by: Zeke Foppa <196249+bfops@users.noreply.github.com>
Co-authored-by: Zeke Foppa <bfops@users.noreply.github.com>
Co-authored-by: Zeke Foppa <196249+bfops@users.noreply.github.com>
2025-01-27 22:54:14 +00:00
Zeke Foppa aa6cb5b5cf Revert DLLs to 1.0.0-rc3 (#224)
## Description of Changes
Revert DLLs, which I should have done in
https://github.com/clockworklabs/com.clockworklabs.spacetimedbsdk/pull/223.

See that PR for background on why it was necessary.

## API

 - [ ] This is an API breaking change to the SDK

Kinda, but it's a revert.

## Requires SpacetimeDB PRs
*List any PRs here that are required for this SDK change to work*

## Testsuite
SpacetimeDB branch name: master

## Testing
I would have liked to say that the current CI is sufficient as I did in
the last PR, but now I no longer feel confident.. Currently the repo is
in a somewhat inconsistent state, though, so I think we should merge
this right now as it will not make it _less_ consistent.

I'm very open to suggestions about how to test this properly.

Co-authored-by: Zeke Foppa <bfops@users.noreply.github.com>
2025-01-27 21:14:55 +00:00
Mazdak Farrokhzad afdc0d67dd Add the update ABI (#2137)
Co-authored-by: Zeke Foppa <bfops@users.noreply.github.com>
2025-01-27 19:38:18 +00:00
Zeke Foppa 76194c2849 Revert trunk branch versions to 1.0.0-rc3 (no hotfix) (#223)
## Description of Changes
Remove the `-hotfix*` part of the version in our trunk branch.

It was a (my) mistake to merge a `-hotfix*` version change. Hotfixes
are, by definition, cherry-picked changes that are going to be released
directly to users without merging.

The consequence of merging this change was that the `SDK Tests` CI job
started failing on SpacetimeDB PRs (e.g. see failures on
https://github.com/clockworklabs/SpacetimeDB/pull/2137), because it
checks out this repo, which then tried to use the `-hotifx3` version of
SpacetimeDB. But the `master` branch of SpacetimeDB is at `1.0.0-rc3`
(no hotfix), because the hotfix was correctly released from a branch
without merging in that repo.

Although this PR reverts the version change, we do still have a tag
`v1.0.0-rc3-hotfix3` that we can use to release the hotfix version (by
`git push -f origin v1.0.0-rc3-hotfix3:master`) if/when desired.

## API

 - [ ] This is an API breaking change to the SDK

No

## Requires SpacetimeDB PRs
Should work with `master`.

## Testsuite
*If you would like to run the your SDK changes in this PR against a
specific SpacetimeDB branch, specify that here. This can be a branch
name or a link to a PR.*

SpacetimeDB branch name: master

## Testing
I claim that the CI tests passing with `master` show that this is
correct. The original version change itself passed CI because it was
pointing at a non-`master` branch for testing. I claim it would have
failed if it were tested against SpacetimeDB `master`.

Generally, this might point to a bug in how we've done this CI: We
should probably only allow a PR to merge in this repo if it tests
successfully against SpacetimeDB `master`, even if we want to point it
at other branches to test in the meantime.

Co-authored-by: Zeke Foppa <bfops@users.noreply.github.com>
2025-01-27 10:22:51 -08:00
rekhoff 80e886a85d Rekhoff/unity blackhol.io tutorial switcher (#140)
* Unified Rust and C# documentation for Blackhol.io

Creates a single markdown file for each page, containing both Rust and C# server implementations, using the following format:
:::rust
# A rust section
:::
:::csharp
# A csharp section
:::
The visibility of each section should then be controlled by a dropdown on the website itself, leveraging tooling not contained in this branch.

* Updated language code blocks to clarify the block refers to the server's language

Prepped the combined documents to specifically tag for the server side code such that:
:::server-rust
A rust server implementation section.
:::
:::server-csharp
A csharp server implementation section.
:::
And in a future additionally update the documentation to differentiate the client portion too, like:
:::client-unity
A Unity client implementation section.
:::

* Update part-4.md

Added additional clarification that the linked repo contained content beyond the scope of the tutorial.

* Updated subscriptions to match new API format

* Small fixes to unity tutorial index page

* Added a note about column names to the C# tutorial

* Merged a section which was now abutting another section

* Clarified where you are supposed to put C# reducers

* Small, mostly whitespace fixes

---------

Co-authored-by: Tyler Cloutier <cloutiertyler@aol.com>
2025-01-24 14:59:10 -08:00
Jeffrey Dallatezza 729dbb1495 Remove the client from subscription manager on a disconnect (#2170) 2025-01-24 22:04:15 +00:00
Zeke Foppa 27be3019bb Bump version to 1.0.0-rc3-hotfix3 (#222)
## Description of Changes
Bump the version and include the DLLs from the corresponding NuGet
packages / SpacetimeDB version.

## API

 - [ ] This is an API breaking change to the SDK

I believe not?

## Requires SpacetimeDB PRs
I believe this requires tag `v1.0.0-rc3-hotfix3`

## Testsuite
*If you would like to run the your SDK changes in this PR against a
specific SpacetimeDB branch, specify that here. This can be a branch
name or a link to a PR.*

SpacetimeDB branch name: v1.0.0-rc3-hotfix3

## Testing
Only automated testing, since this itself is just a version bump.

---------

Co-authored-by: Zeke Foppa <bfops@users.noreply.github.com>
2025-01-24 21:27:04 +00:00
Tyler Cloutier 85ffb2838c Fixed issues with the Rust module quickstart-chat README.md (#2154)
Signed-off-by: Tyler Cloutier <cloutiertyler@users.noreply.github.com>
Co-authored-by: Zeke Foppa <196249+bfops@users.noreply.github.com>
2025-01-24 18:24:14 +00:00
rekhoff abbf0430ae Merged the player and logged_out_player tables (#16)
Merged the player and logged_out_player tables into only a player table, to match the way it is used in the tutorial documentation. Slight changes to how logged_out_player was being referenced was required due to the tables having different architecture.
2025-01-24 08:04:16 -08:00
rekhoff 30852e70c6 Renamed client directory to client-unity (#15) 2025-01-24 08:03:21 -08:00
Phoebe Goldman d6147b06a5 Add subscribeToAllTables method (#129) 2025-01-23 21:38:09 -05:00
james gilles 6578f0563b Implement new subscription API (#219)
## Description of Changes

As proposed. No upstream codegen changes needed :)

## API

 - [x] This is an API breaking change to the SDK

*If the API is breaking, please state below what will break*
The subscription API is slightly different.

## Requires SpacetimeDB PRs
https://github.com/clockworklabs/SpacetimeDB/pull/2111

## Testsuite

SpacetimeDB branch name: jsdt/subscribe-sdk-3

## Testing
So far I have performed manual testing with the chat example. Working on
updating the unity and unit tests.

- [ ] Describe a test for this PR that you have completed
2025-01-23 16:22:29 -05:00
james gilles 30629f6b9d Test with upstream subscription API + fix respawns + add suicide for testing (#13)
* Test with upstream subscription API + fix respawns + add suicide for testing

* Add comment on not loading Auth Token for testing.

* Remove dangling meta file?

* Switch server-csharp to local build temporarily & fix all issues

* Remove needless comment

* Add comment to csproj

* Remove debug logs
2025-01-23 16:09:34 -05:00
james gilles 988ec0cdd4 Fix ScheduleAt in C# (#2163) 2025-01-23 19:59:38 +00:00
Phoebe Goldman d171b44a89 Don't create indexes during bootstrapping; wait until after replay (#2161) 2025-01-23 19:41:39 +00:00
Jeffrey Dallatezza b85c3b5ab6 Fix sending of subscription errors. (#2166) 2025-01-23 19:33:27 +00:00
Noa 179993c4ef Fix autocomplete issues in bindings crate (#2157) 2025-01-23 18:31:40 +00:00
Ingvar Stepanyan 62e16c6333 Unify CI handling of SpacetimeDB branch (#215)
## Description of Changes

This unifies various CI task into a single config that checks out the
referenced SpacetimeDB branch only once and using the same PR parsing
code (previously used only in Unity), and then runs all the builds and
tests against it. That is, .NET test, server module and Unity tests are
now all consistently overridden to point to the same SpacetimeDB.

## API

 - [ ] This is an API breaking change to the SDK

*If the API is breaking, please state below what will break*

## Requires SpacetimeDB PRs
*List any PRs here that are required for this SDK change to work*

## Testsuite
*If you would like to run the your SDK changes in this PR against a
specific SpacetimeDB branch, specify that here. This can be a branch
name or a link to a PR.*

SpacetimeDB branch name: master

## Testing

- [x] Lots of CI testing and tweaking until all of existing CI tests
started working again; ensured .NET tests are executed as expected
against the specified branch name.
2025-01-23 10:40:38 -05:00
Ingvar Stepanyan 972d775840 Fix & test row deletion API (#2146)
Co-authored-by: Zeke Foppa <196249+bfops@users.noreply.github.com>
2025-01-23 00:53:15 +00:00
joshua-spacetime 149ff9760c Query execution updates for cpu metrics (#2130) 2025-01-22 23:29:53 +00:00
Phoebe Goldman 5195a243a6 Amend withCredentials to withToken (#128)
* Amend `withCredentials` to `withToken`

`withCredentials` was designed for our old auth model,
where tokens were always issued by the SpacetimeDB host alongside an `Identity`,
and therefore the bearer always knew their `Identity`.

In our new auth model,
a client may have a valid auth-able JWT but not know what `Identity` it will result in,
as the `Identity` is computed based on the hash of some of the token's contents,
and this hashing algorithm is not included in our client SDKs.
As such, this PR revises `withCredentials` to `withToken`, which just accepts the token.

* TypeScript puts ? on variables, not types

* Prettier
2025-01-22 17:31:40 -05:00
Kim Altintop ea05e108d7 snapshot: Invalidate newer snapshots on creation (#2143) 2025-01-22 20:36:05 +00:00
Kim Altintop 73fe4ef2f7 Set tracing static level for binaries only (#2144) 2025-01-22 20:13:52 +00:00
Mazdak Farrokhzad a1573af5a1 Fix unique index + MutTxId::insert not un-deleteting (#2156) 2025-01-22 09:51:34 +00:00
Noa 7c6af12b84 Use actual types for api responses, not ad-hoc json!() objects (#1931) 2025-01-21 03:13:22 +00:00
Kim Altintop 43d870d24c core: Make SNAPSHOT_FREQUENCY pub (#2135) 2025-01-20 07:27:36 +00:00
Tyler Cloutier 0db1dc0a6f Update quickstart.md 2025-01-18 01:15:13 -05:00
SteveGibson 0f5e0b6a30 Blackholio Rebrand and Polish (#11)
* Circle splitting and recombining;
Client re-coloring

* Renamed Entity.id into Entity.entity_id

* Client refactor; Polish; Bugfixes

* Store username between game runs

* Renamed EntityActor.OnUpdate to OnEntityUpdate

* [WIP] C# server

* [WIP] C# server

* Changed `DateTimeOffset` to `long` in C# module

* Parallax background

* Animate entities when they get consumed

* Fixed respawn button

* Draft into Steve's branch (#12)

* Small changes

* Changes to align with the tutorial.

* Fixed rebase issue

* Merged ConnectionManager and EntityManager into GameManager for tutorial simplicity

* Renaming Actor -> Controller for simplicity's sake, although Actor is a good name

* actor -> entityController

* Merged ArenaController into GameManager for simplicity and cleaned up a few things

* Small cleanup to keep it in line with the tutorial

* Small changes to how overlapping works

* Rebrand to Blackholio

* Rebrand to Blackholio (missed one)

* Added a README.md

* fixed readme

---------

Co-authored-by: Steve Gibson <steve@clockwokrlabs.io>
Co-authored-by: Tyler Cloutier <cloutiertyler@users.noreply.github.com>
Co-authored-by: Tyler Cloutier <cloutiertyler@aol.com>
2025-01-18 01:10:32 -05:00
Tyler Cloutier 9a33bfc8a9 Addresses feedback that John provided (#137)
* Addresses feedback that John provided

* Fixed broken link
2025-01-17 21:08:09 -05:00
Noa cf6ac18eaf Lookup lifecycle reducers by lifecycle flag, not by name (#2132) 2025-01-17 23:21:52 +00:00
Mazdak Farrokhzad 6f428f3afb Make the key of Table.indexes be IndexId (#2124) 2025-01-17 18:42:54 +00:00
Zeke Foppa a54ea3a391 CLI - Replace clippy with a manual check (#1928)
Co-authored-by: Zeke Foppa <bfops@users.noreply.github.com>
2025-01-17 00:03:11 +00:00
Noa e47a8d796f Run smoketests on windows in ci (#2129) 2025-01-16 21:43:38 +00:00
Ingvar Stepanyan 3d530ee248 Upgrade to new regenerated client-api bindings (#218)
## Description of Changes

Looks like client API bindings haven't been regenerated in a while, and
this is a necessary precursor to the new subscription work. This PR
fixes the generation script, regenerates the bindings and updates
affected code.

## API

 - [ ] This is an API breaking change to the SDK

*If the API is breaking, please state below what will break*

## Requires SpacetimeDB PRs
*List any PRs here that are required for this SDK change to work*

## Testsuite
*If you would like to run the your SDK changes in this PR against a
specific SpacetimeDB branch, specify that here. This can be a branch
name or a link to a PR.*

SpacetimeDB branch name: v1.0.0-rc3

## Testing
*Write instructions for a test that you performed for this PR*

- [x] Ran regular `dotnet test`.
- [x] Checked Unity tests via CI.
2025-01-16 17:29:27 +00:00
james gilles 20a8ce2a74 Add remark to style guide inspired by SpacetimeDB#2050 (#133) 2025-01-16 10:48:41 -05:00
Tyler Cloutier c2e4314bcc Made fixes to the tutorial for changes that were introduced to the C# in RC3 (#135) 2025-01-15 22:59:34 -05:00
Tyler Cloutier 96710dab99 Blackholio Tutorial Update (#128)
* First commit to test images

* Progress on the unity tutorial

* moar docs

* Part 3 incoming

* Part 3 and almost part 4!

* Finalized part 4 and deleted unused files

* Small fixes and clarifications

* Review typos and fixes

* Fixed link validation for images

* Removed the reference to an image which is going to be moving

* Fixed the tsconfig issue (it was not actually using the tsconfig)

* Shortened titles

* Just testing something

* Undo change

* Consistent headers

* Commenting out images for now

* Missed an image
2025-01-15 21:12:20 -05:00
Noa c24042609e Split binaries (#2011) 2025-01-15 18:45:14 +00:00
Phoebe Goldman 537faa4a95 Rust SDK: with_credentials -> with_token (#2118) 2025-01-14 23:53:55 +00:00
Phoebe Goldman 749825aa2f SubscribeToAllTables, which hides "SELECT * FROM *" (#211)
## Description of Changes

Per out-of-band discussion, add
`SubscriptionBuilder.SubscribeToAllTables`, which abstracts over
`SubscriptionBuilder.Subscribe(["SELECT * FROM *"])`.

In the future, we will change the implementation of this method, so that
it uses "legacy subscriptions" while `SubscriptionBuilder.Subscribe`
moves to using "mutable subscriptions." At that time, no other interface
will be provided for using "legacy subscriptions."
`SubscribeToAllTables` may also at some point be rewritten in terms of
"mutable subscriptions" somehow.

## API

 - [ ] This is an API breaking change to the SDK

*If the API is breaking, please state below what will break*

## Requires SpacetimeDB PRs

N/a

## Testsuite
*If you would like to run the your SDK changes in this PR against a
specific SpacetimeDB branch, specify that here. This can be a branch
name or a link to a PR.*

SpacetimeDB branch name: master

## Testing
*Write instructions for a test that you performed for this PR*

- [x] @cloutiertyler will use this in the new tutorial and report back.

---------

Co-authored-by: Ingvar Stepanyan <ingvar@clockworklabs.io>
Co-authored-by: Zeke Foppa <196249+bfops@users.noreply.github.com>
Co-authored-by: Zeke Foppa <bfops@users.noreply.github.com>
Co-authored-by: Tyler Cloutier <cloutiertyler@users.noreply.github.com>
2025-01-14 23:43:10 +00:00
Phoebe Goldman dc0bdce324 Rework RLS macro for amended syntax (#2105)
Signed-off-by: Phoebe Goldman <phoebe@goldman-tribe.org>
Co-authored-by: joshua-spacetime <josh@clockworklabs.io>
2025-01-14 21:21:35 +00:00
Zeke Foppa b398cda24b Add new crates to publish-crates.sh script (#2125)
Co-authored-by: Zeke Foppa <bfops@users.noreply.github.com>
2025-01-14 20:58:12 +00:00
Ingvar Stepanyan 0017af7991 Disable PR comment for meta file check if not a PR (#216)
## Description of Changes

Looks like the .meta check hard-fails on push events if
`enable_pr_comment` is `true`, instead of just ignoring it...

I hope this fix works, but hard to tell without merging first.

## API

 - [ ] This is an API breaking change to the SDK

*If the API is breaking, please state below what will break*

## Requires SpacetimeDB PRs
*List any PRs here that are required for this SDK change to work*

## Testsuite
*If you would like to run the your SDK changes in this PR against a
specific SpacetimeDB branch, specify that here. This can be a branch
name or a link to a PR.*

SpacetimeDB branch name: master

## Testing
*Write instructions for a test that you performed for this PR*

- [x] This is a PR that changes CI configuration, so see CI
2025-01-14 19:48:20 +00:00
Ingvar Stepanyan 2487c94967 Add CI check for Unity meta files (#209)
## Description of Changes

Adds CI check to prevent issues like #208.

## API

 - [ ] This is an API breaking change to the SDK

*If the API is breaking, please state below what will break*

## Requires SpacetimeDB PRs
*List any PRs here that are required for this SDK change to work*

## Testsuite
*If you would like to run the your SDK changes in this PR against a
specific SpacetimeDB branch, specify that here. This can be a branch
name or a link to a PR.*

SpacetimeDB branch name: master

## Testing
*Write instructions for a test that you performed for this PR*

- [ ] Describe a test for this PR that you have completed
2025-01-14 19:25:45 +00:00
Kim Altintop c5f4c8bc5c commitlog: Make offset index usable externally (#2108) 2025-01-14 18:56:08 +00:00
Phoebe Goldman 39e7ebbb9a Revise WithCredentials to WithToken (#212)
## Description of Changes

`WithCredentials` was designed for our old auth model, where tokens were
always issued by the SpacetimeDB host alongside an `Identity`, and
therefore the bearer always knew their `Identity`.

In our new auth model, a client may have a valid auth-able JWT but not
know what `Identity` it will result in,
as the `Identity` is computed based on the hash of some of the token's
contents, and this hashing algorithm is not included in our client SDKs.
As such, this PR revises `WithCredentials` to `WithToken`, which just
accepts the token.

## API

 - [x] This is an API breaking change to the SDK

*If the API is breaking, please state below what will break*

`WithCredentials` is renamed and its signature changes.

## Requires SpacetimeDB PRs
*List any PRs here that are required for this SDK change to work*

## Testsuite
*If you would like to run the your SDK changes in this PR against a
specific SpacetimeDB branch, specify that here. This can be a branch
name or a link to a PR.*

SpacetimeDB branch name: master

## Testing
*Write instructions for a test that you performed for this PR*

- [ ] @cloutiertyler should test this with the Unity tutorial, if
possible.

---------

Co-authored-by: Zeke Foppa <196249+bfops@users.noreply.github.com>
2025-01-14 18:43:34 +00:00