Skip to content

Release docs changes #265

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 47 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
47 commits
Select commit Hold shift + click to select a range
4e82fa0
Changed subscript to SubscribeToAllTables (#155)
rekhoff Jan 27, 2025
e93c330
Updated the TypeScript quickstart guide to use the new 1.0 API (#141)
cloutiertyler Jan 28, 2025
4811e38
Update Rust client SDK docs for SpacetimeDB#2118 (#130)
gefjon Jan 28, 2025
1d64af2
docs(70): The 1.0 SQL spec
joshua-spacetime Jul 16, 2024
f171fe2
Small TS SDK Quickstart Fixes (#157)
cloutiertyler Feb 8, 2025
72f4251
Style guide: add formatting advice for GUI elements and menu paths (#…
gefjon Feb 8, 2025
36cb01e
Remove WebSocket api docs and all references to them (#165)
joshua-spacetime Feb 12, 2025
6f59ad7
CLI docs (#168)
bfops Feb 19, 2025
29e5990
Add link to the `cli` (#171)
mamcx Feb 20, 2025
1dbc7b0
Rename satn.md -> sats-json.md (#158)
coolreader18 Feb 21, 2025
7e46931
Fix auto_inc attribute name (#175)
mamcx Feb 21, 2025
fba0007
Document LIMIT and COUNT (#178)
joshua-spacetime Feb 24, 2025
675882c
Add best practices for Spacetime SQL (#180)
joshua-spacetime Feb 25, 2025
b555ffb
API for mutable subscriptions (#166)
joshua-spacetime Feb 25, 2025
a896a36
Remove references to SpacetimeDB 0.6
joshua-spacetime Feb 25, 2025
3477b1c
Remove reference to set energy-balance in http api
joshua-spacetime Feb 25, 2025
dfef2a7
Remove references to testnet
joshua-spacetime Feb 25, 2025
c9ab802
Remove 0.12 migration guide
joshua-spacetime Feb 26, 2025
7319933
Update to C# Quickstart-Chat Server Module and Client SDK tutorial do…
rekhoff Feb 26, 2025
34138e4
Move Rust Module SDK reference to docs.rs (#114)
kazimuth Feb 26, 2025
656b9ba
Document reducer semantics wrt. transactionality (#185)
Centril Feb 27, 2025
1b74784
Document behaviour of SEQUENCES (#174)
mamcx Feb 27, 2025
7d64b77
Update Rust client SDK quickstart for 1.0 API (#162)
gefjon Feb 28, 2025
469c355
Add docs for standalone config.toml (#190)
coolreader18 Feb 28, 2025
2d6130a
Update docs for http api (#188)
coolreader18 Feb 28, 2025
0a71acb
Update Rust SDK ref, and also a few small fixes (#172)
gefjon Mar 3, 2025
11f50c2
How-to: Incremental Migrations (#127)
gefjon Mar 3, 2025
e5e885c
Updates to blackhol.io tutorials (#194)
rekhoff Mar 3, 2025
15b4241
Updated with corrected table names to lower case, for compatibility w…
rekhoff Mar 3, 2025
6b44934
Small doc fixes potpourri (#198)
gefjon Mar 3, 2025
9e7bce3
Fixes the typescript quickstart for the new subscription API (#161)
cloutiertyler Mar 3, 2025
4835551
Multiplayer bug fix in tutorial (#169)
jdetter Mar 3, 2025
a4bc4c4
Add instructions for deploying to maincloud (#167)
bfops Mar 4, 2025
8917a26
C# Module Library docs (#193)
kazimuth Mar 4, 2025
0d97f84
C# sdk reference (#191)
joshua-spacetime Mar 4, 2025
5f894e6
Describe how a JWT's sub/iss are translated into an Identity (#204)
coolreader18 Mar 4, 2025
8338e72
Rekhoff/blackholio fixes (#205)
rekhoff Mar 4, 2025
3c00af3
Bump Typescript SDK Version in Quickstart (#208)
jdetter Mar 4, 2025
06d65c5
Fix code error and wrong code block (#210)
hardliner66 Mar 4, 2025
b6b5229
Self-Hosted guide (#206)
jdetter Mar 4, 2025
eaa8ecd
Bump typescript version to 1.0.2 (#213)
jdetter Mar 4, 2025
d8522de
Update CLI docs for #2349 (#215)
bfops Mar 5, 2025
1008f53
Remove stale references to removed CLI functions (#218)
bfops Mar 6, 2025
13f1d23
Updated to correct old timestamp format. (#221)
rekhoff Mar 7, 2025
6b5fc5b
Clarify what is a valid module name (#252)
coolreader18 Mar 7, 2025
9354ba6
Removed double semi-colon (#254)
cloutiertyler Mar 10, 2025
edaa76f
Explain `spacetime login` (#217)
bfops Mar 11, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,16 @@ git push -u origin a-branch-name-that-describes-my-change

> NOTE! If you make a change to `nav.ts` you will have to run `npm run build` to generate a new `docs/nav.js` file.

#### CLI Reference Section
1. Make sure that https://github.com/clockworklabs/SpacetimeDB/pull/2276 is included in your `spacetimedb-cli` binary
1. Run `cargo run --features markdown-docs -p spacetimedb-cli > cli-reference.md`

We currently don't properly render markdown backticks and bolding that are inside of headers, so do these two manual replacements to make them look okay (these have only been tested on Linux):
```bash
sed -i'' -E 's!^(##) `(.*)`$!\1 \2!' docs/cli-reference.md
sed -i'' -E 's!^(######) \*\*(.*)\*\*$!\1 <b>\2</b>!' docs/cli-reference.md
```

### Checking Links

We have a CI job which validates internal links. You can run it locally with `npm run check-links`. This will print any internal links (i.e. links to other docs pages) whose targets do not exist, including fragment links (i.e. `#`-ey links to anchors).
Expand Down
12 changes: 10 additions & 2 deletions STYLE.md
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,14 @@ Don't make promises, even weak ones, about what we plan to do in the future, wit

If your document needs to describe a feature that isn't implemented yet, either rewrite to not depend on that feature, or just say that it's a "current limitation" without elaborating further. Include a workaround if there is one.

### Menu items and paths

When describing GUI elements and menu items, like the **Unity Registry** tab, use bolded text to draw attention to any phrases that will appear in the actual UI. Readers will see this bolded text in the documentation and look for it on their screen. Where applicable, include a short description of the type or category of element, like "tab" above, or the **File** menu. This category should not be bolded, since it is not a word the reader can expect to find on their screen.

When describing a chain of accesses through menus and submenus, use the **->** thin arrow (that's `->`, a hyphen followed by a greater-than sign) as a separator, like **File -> Quit** or **Window -> Package Manager**. List the top-level menu first, and proceed left-to-right until you reach the option you want the user to interact with. Include all nested submenus, like **Foo -> Bar -> Baz -> Quux**. Bold the whole sequence, including the arrows.

It's generally not necessary or desirable to tell users where to look for the top-level menu. You may be tempted to write something like, "Open the **File** menu in the upper left, and navigate **File -> Export as -> Export as PDF**." Do not include "in the upper left" unless you are absolutely confident that the menu will be located there on any combination of OS, version, desktop environment, window manager, theming configuration &c. Even within a single system, UI designers are known to move graphical elements around during updates, making statements like "upper left" obsolete and stale. We can generally trust our readers to be familiar with their own systems and the software they use, and none of our documents involve introducing readers to new GUI software. (E.g. the Unity tutorial is targeted at introducing SpacetimeDB to people who already know Unity.) "Open the **File** menu and navigate **File -> Export as -> Export as PDF**" is sufficient.

## Key vocabulary

There are a small number of key terms that we need to use consistently throughout the documentation.
Expand Down Expand Up @@ -367,7 +375,7 @@ Start the conclusion with a sentence or paragraph that reminds the reader what t

If this tutorial is part of a series, link to the next entry:

> You can use any of SpacetimDB's supported client languages to do this. Take a look at the quickstart guide for your client language of choice: [Rust](/docs/sdks/rust/quickstart), [C#](/docs/sdks/c-sharp/quickstart), or [TypeScript](/docs/sdks/typescript/quickstart). If you are planning to use SpacetimeDB with the Unity game engine, you can skip right to the [Unity Comprehensive Tutorial](/docs/unity/part-1) or check out our example game, [BitcraftMini](/docs/unity/part-3).
> You can use any of SpacetimDB's supported client languages to do this. Take a look at the quickstart guide for your client language of choice: [Rust](/docs/sdks/rust/quickstart), [C#](/docs/sdks/c-sharp/quickstart), or [TypeScript](/docs/sdks/typescript/quickstart). If you are planning to use SpacetimeDB with the Unity game engine, you can skip right to the [Unity Comprehensive Tutorial](/docs/unity/part-1).

If this tutorial is about a specific component, link to its reference page:

Expand All @@ -391,7 +399,7 @@ If this tutorial is the end of a series, or ends with a reasonably complete app,
If the tutorial involved writing code, add a link to the complete code. This should be somewhere on GitHub, either as its own repo, or as an example project within an existing repo. Ensure the linked folder has a README.md file which includes:

- The name of the tutorial project.
- How to run or interact with the tutorial project, whatever that means (e.g. publish to testnet and then `spacetime call`).
- How to run or interact with the tutorial project, whatever that means (e.g. publish to maincloud and then `spacetime call`).
- Links to external dependencies (e.g. for client projects, the module which it runs against).
- A back-link to the tutorial that builds this project.

Expand Down
61 changes: 61 additions & 0 deletions docs/appendix.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
# Appendix

## SEQUENCE

For each table containing an `#[auto_inc]` column, SpacetimeDB creates a sequence number generator behind the scenes, which functions similarly to `postgres`'s `SEQUENCE`.

### How It Works

* Sequences in SpacetimeDB use Rust’s `i128` integer type.
* The field type marked with `#[auto_inc]` is cast to `i128` and increments by `1` for each new row.
* Sequences are pre-allocated in chunks of `4096` to speed up number generation, and then are only persisted to disk when the pre-allocated chunk is exhausted.

> **⚠ Warning:** Sequence number generation is not transactional.

* Numbers are incremented even if a transaction is later rolled back.
* Unused numbers are not reclaimed, meaning sequences may have *gaps*.
* If the server restarts or a transaction rolls back, the sequence continues from the next pre-allocated chunk + `1`:

**Example:**

```rust
#[spacetimedb::table(name = users, public)]
struct Users {
#[auto_inc]
user_id: u64,
name: String,
}

#[spacetimedb::reducer]
pub fn insert_user(ctx: &ReducerContext, count: u8) {
for i in 0..count {
let name = format!("User {}", i);
ctx.db.users().insert(Users { user_id: 0, name });
}
// Query the table to see the effect of the `[auto_inc]` attribute:
for user in ctx.db.users().iter() {
log::info!("User: {:?}", user);
}
}
```

Then:

```bash
❯ cargo run --bin spacetimedb-cli call sample insert_user 3

❯ spacetimedb-cli logs sample
...
.. User: Users { user_id: 1, name: "User 0" }
.. User: Users { user_id: 2, name: "User 1" }
.. User: Users { user_id: 3, name: "User 2" }

# Database restart, then

❯ cargo run --bin spacetimedb-cli call sample insert_user 1

❯ spacetimedb-cli logs sample
...
.. User: Users { user_id: 3, name: "User 2" }
.. User: Users { user_id: 4098, name: "User 0" }
```
2 changes: 1 addition & 1 deletion docs/bsatn.md
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,6 @@ Where
All SATS types are BSATN-encoded by converting them to an `AlgebraicValue`,
then BSATN-encoding that meta-value.

See [the SATN JSON Format](/docs/satn)
See [the SATN JSON Format](/docs/sats-json)
for more details of the conversion to meta values.
Note that these meta values are converted to BSATN and _not JSON_.
Loading