clockworklabs / clockworklabs/SpacetimeDB

Typescript SDK Import file for tables

Open
#3,037 0 comments 0 reactions 2 assignees View on GitHub

@cloutiertyler is already working on this.

Since Sep 30, 2024.

Dominant language
Rust
Stars
25.2k
Forks
1.1k
Avg merge
2d 7h
Merged PRs (30d)
46

Description

Currently, you have to import every table in the typescript file where you use the spacetimedb client. You also need to use it somehow to stop typescript from compiling it out.

Currently in my react client for the multi-user dungeon I have this ugly mess:

import Player from "./types/player";
import Mobile from "./types/mobile";
import Location from "./types/location";
import World from "./types/world";
import Zone from "./types/zone";
import Room from "./types/room";
import RoomChat from "./types/room_chat";
import DirectMessage from './types/direct_message';
console.log(Player, Mobile, Location, World, Zone, Room, RoomChat, DirectMessage);

I’m not sure what the correct solution for this would be but we could possibly autogen a file that takes care of this for you so you only need to have a single import and it takes care of all of this for you.

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.