Commit Graph

2548 Commits

Author SHA1 Message Date
Tyler Cloutier 4026e8380a Updated module_bindings for the rust sdk tests 2025-10-16 09:59:25 -04:00
Noa 6d71f1606b Fix ci 2025-10-16 01:49:21 -05:00
Noa c756f11ccd Merge branch 'master' into noa/ts-module-api 2025-10-15 22:59:39 -05:00
Noa 2e0c9d2378 'Fix' insert_primitives_as_strings 2025-10-15 22:51:15 -05:00
Noa 16609893eb Fix most of sdk-test-ts 2025-10-15 22:43:49 -05:00
Zeke Foppa d4837c37ab Bump versions to 1.6.0 (#3413)
# Description of Changes

Bumping versions to 1.6.0 in preparation for upcoming release.

# API and ABI breaking changes

None

# Expected complexity level and risk

1
# Testing

- [x] Existing CI only

---------

Co-authored-by: Zeke Foppa <bfops@users.noreply.github.com>
2025-10-16 01:26:35 +00:00
= d817c6b94e Fixed import for typescript template index._ts 2025-10-15 20:18:47 -04:00
= ea579dfaa1 Fixed infinite recursion in bsatnBaseSize 2025-10-15 19:47:12 -04:00
Tyler Cloutier e7e47b89f6 Bump version of package._json for spacetime init --lang typescript 2025-10-15 19:42:07 -04:00
Tyler Cloutier 19474c9ec7 Remove v8 feature gate 2025-10-15 19:20:04 -04:00
Tyler Cloutier 781a72c242 Reran pnpm generate and generated markdown docs 2025-10-15 19:00:29 -04:00
Noa d5c439b901 Fix sdk tests assuming wasm 2025-10-15 17:49:34 -05:00
= 5bfc843517 Adds package.json to spacetime init and adds aliases 2025-10-15 18:31:02 -04:00
Zeke Foppa 037e86eb09 [noa/ts-module-api]: add a TODO 2025-10-15 14:45:42 -07:00
Noa 10f10064a9 Add SenderError 2025-10-15 16:18:19 -05:00
Noa 637d481ca9 Skip benchmarks-ts for now 2025-10-15 16:17:54 -05:00
Noa f5b0e3eb3c Check duplicate reducers 2025-10-15 16:17:54 -05:00
Noa 59abf4d1cf Address nits 2025-10-15 16:17:54 -05:00
Noa 695ec1c730 Remove tsup from module-test-ts and fix workspace member 2025-10-15 16:17:53 -05:00
Noa de964043a7 Update crates/bindings-typescript/src/lib/time_duration.ts
Co-authored-by: Tyler Cloutier <cloutiertyler@users.noreply.github.com>
Signed-off-by: Noa <coolreader18@gmail.com>
2025-10-15 16:17:53 -05:00
Noa ecf662326a Update crates/bindings-typescript/src/server/type_builders.ts
Co-authored-by: Tyler Cloutier <cloutiertyler@users.noreply.github.com>
Signed-off-by: Noa <coolreader18@gmail.com>
2025-10-15 16:17:53 -05:00
Noa ae09bb6c49 Remove table.tryInsert 2025-10-15 16:17:51 -05:00
Noa 20434ce1e0 Add register_hooks.ts to moduleSideEffects 2025-10-15 16:14:05 -05:00
Noa ec09e9f56b Undo changes to syscall.rs 2025-10-15 16:14:05 -05:00
Noa 4a38fa88b2 Update typescript bindings to cache AlgebraicTypes 2025-10-15 16:14:01 -05:00
Noa a4c2f429be Fix misaligned pointer error 2025-10-15 14:44:37 -05:00
samuel.engstrom@arvikasoft.se 3075ca4fba Add forgotten variance to table_index::can_merge (#3391)
TableIndex merge logic to was missing  variants.

# Description of Changes

This pull request fixes an issue where the TableIndex::can_merge
function was missing match variants.

# API and ABI breaking changes

None.

# Expected complexity level and risk

1 / 5 (Trivial)
This is a very low-risk change. It simply adds a few lines to a match
statement

# Testing

Manual testing confirm that creating two tables with indices with the
for the missing variants no longer causes a panic.
2025-10-15 17:05:54 +00:00
Phoebe Goldman e77b62f475 Also capture a snapshot every new commitlog segment (#3405)
# Description of Changes

We've run into a problem on Maincloud caused by a database that was
writing a relatively small number of very large transactions. This was
accruing many commitlog segments consuming hundreds of gigabytes of
disk, but had not ever taken a snapshot, or compressed or archived any
data, as the database had not progressed past one million transactions.

With this PR, we take a snapshot every time the commitlog segment
rotates. We still also snapshot every million transactions.

One BitCraft database we looked at had 2.5 million transactions per
commitlog segment, meaning that this change will not meaningfully affect
the frequency of snapshots. The offending Maincloud database, however,
had only 50 transactions per segment!

# API and ABI breaking changes

N/a

# Expected complexity level and risk

3: Hastily made changes to finnicky code across several crates.

# Testing

I am unsure how to test these changes.

- [ ] <!-- maybe a test you want to do -->
- [ ] <!-- maybe a test you want a reviewer to do, so they can check it
off when they're satisfied. -->
2025-10-15 15:18:15 +00:00
Zeke Foppa 92cd2604ad Windows - Set linker = "lld-link" (#3406)
# Description of Changes

See the inline comments for the motivation. This was originally
introduced to our Windows CI in #3351. This PR moves it from CI to
general Windows target builds, since it seems like Windows builds are
now generally having this issue.

# API and ABI breaking changes

None

# Expected complexity level and risk

1

# Testing

- [x] Windows CI still passes

---------

Co-authored-by: Zeke Foppa <bfops@users.noreply.github.com>
2025-10-15 03:09:55 +00:00
Noa 12b6d4c605 Build module sdk before running cargo tests 2025-10-14 16:46:55 -05:00
Noa 9ef19d4f8e [TS] Register describe_module/call_reducer through the sys module (#3404)
# Description of Changes

This exports the following API from `spacetime:sys@1.0`:

```ts
export type ModuleHooks = {
  __describe_module__(): Uint8Array;

  __call_reducer__(
    reducerId: u32,
    sender: u256,
    connId: u128,
    timestamp: bigint,
    argsBuf: Uint8Array
  ): { tag: 'ok' } | { tag: 'err'; value: string };
};

export function register_hooks(hooks: ModuleHooks);
```

This is then called by the `spacetimedb` package. This means that users
no longer need to export `__call_reducer__` and `__describe_module__`
from their own code, and differently from how it was before it doesn't
pollute the global namespace. It also means that the signatures for
`__call_reducer__` can be changed when we change the ABI version - the
bindings would then do `import { register_hooks } from
"spacetime:sys@2.0";` and that version of the function would expect a
different signature..

# Expected complexity level and risk

2 - it's a change, but not all that different from the existing way
we've been doing it.

# Testing, and also , and also 

<!-- Describe any testing you've done, and any testing you'd like your
reviewers to do,
so that you're confident that all the changes work as expected! -->

- [x] Automated testing
- [ ] <!-- maybe a test you want a reviewer to do, so they can check it
off when they're satisfied. -->
2025-10-14 17:40:57 -04:00
= fe5d41eec8 Test for nested option 2025-10-14 17:10:26 -04:00
Noa f4106d6d04 Add quickstart-chat-ts 2025-10-14 14:01:07 -05:00
Noa 9d95af71e9 Add sdk-test-connect-disconnect-ts 2025-10-14 13:53:59 -05:00
Noa 08a2d478d1 Add clientVisibilityFilter 2025-10-14 13:53:59 -05:00
Noa bc8d62ff61 Add sdk test 2025-10-14 13:53:57 -05:00
Jason Larabie b7efd17ac5 Remove use of DDC during CI tests (#3367)
# Description of Changes

Removes the use of the Derived Data Cache during CI, will in

# API and ABI breaking changes

None

# Expected complexity level and risk

1 - Small change for CI

# Testing

- [x] Re-ran tests on both Linux + Windows with the change
2025-10-14 18:27:28 +00:00
Jason Larabie 318049aca9 Fix for Unreal codegen for Optional fields (#3360)
# Description of Changes

- Fixed logic issue around Option<Vec<Option<>>> applying the wrong
types for primitives and dropping Optional
- Fixed an issue with enum vs enum variants wrapped in Option<>
producing the incorrect Unreal type
- Removed unnecessary and incorrect header bindings
- Type fix in the tests around the Optional Int32

# API and ABI breaking changes

No breaking changes 

# Expected complexity level and risk

2 - Reworked incorrect optional lookups which can happen recursively

# Testing

I built out a few simple and complex objects in a Rust module to
triple-check possible cases beyond what the test framework calls out.

- [x] Tested many combinations from a Rust module to an Unreal project
- [x] Ran and updated Unreal test cases as necessary
2025-10-14 17:50:29 +00:00
Tyler Cloutier 4d48ca208d Removed errant console.log/print statements (#3402)
# Description of Changes

`console.log` debugging statements accidentally made it into the
release.

# API and ABI breaking changes

None

# Expected complexity level and risk

1, trivial

# Testing
- [x] Automated testing only
2025-10-14 15:31:19 +00:00
Noa 1cd4f024a2 Setup tests using typescript modules 2025-10-12 14:32:44 -05:00
Noa f6f062192e Remove indexed_option_field/unique_option_field 2025-10-12 11:11:41 -05:00
Noa 4d2899dc6b Update cli docs 2025-10-10 15:47:21 -05:00
Noa 32638b46ce Update snapshot tests 2025-10-10 15:43:43 -05:00
Noa 848040bee5 Potential fix for code scanning alert no. 101: Prototype-polluting assignment
Co-authored-by: Copilot Autofix powered by AI <62310815+github-advanced-security[bot]@users.noreply.github.com>
Signed-off-by: Noa <coolreader18@gmail.com>
2025-10-10 15:24:52 -05:00
Tyler Cloutier d011e2b9d7 tyler/ts-module-api (#3383)
# Description of Changes

Changes into #3327 

# API and ABI breaking changes

None

# Expected complexity level and risk

2

# Testing

- [ ] None yet

---------

Co-authored-by: Noa <coolreader18@gmail.com>
2025-10-10 15:19:36 -05:00
Noa 50cbb1dff5 Namespacing 2025-10-10 14:40:32 -05:00
Noa 6a7b00797c Get working again 2025-10-10 14:40:31 -05:00
Noa 9abd9c4cb7 Remove side-effects 2025-10-10 14:40:31 -05:00
Noa e299a72d51 Return a copy of the object from insert() 2025-10-10 14:40:31 -05:00
Noa 1d50c625eb Fix eslint 2025-10-10 14:40:31 -05:00