clockworklabs / SpacetimeDB

Multiplayer at the speed of light
https://spacetimedb.com
Other
4.41k stars 110 forks source link

Typescript codegen issue with csharp module. #1977

Open bfops opened 1 week ago

bfops commented 1 week ago

Generating TypeScript bindings for a module which uses a timer table fails with error: not yet implemented, apparently here, apparently while generating the bindings for the ScheduleAt enum. Fix this so that it's possible to generate TypeScript bindings for a module which defines at least one timer table.

Update: Csharp module with timer fails to generate bindings for ScheduleAt enum. Binding generated for timer struct looks like -

#[derive(Serialize, Deserialize, Clone, PartialEq, Debug)]
pub struct SendMessageTimer {
    pub text: String,
    pub scheduled_id: u64,
    pub scheduled_at: enum { Time: u64, Interval: u64 },
}

May be related to Typespace not using AlgebraicTypeRef for ScheduledAt enum

Typespace { types: [Product(ProductType { elements: [ProductTypeElement { name: Some("Text"), algebraic_type: Builtin(String) }, ProductTypeElement { name: Some("ScheduledId"), algebraic_type: Builtin(U64) }, ProductTypeElement { name: Some("ScheduledAt"), algebraic_type: Sum(SumType { variants: [SumTypeVariant { name: Some("Time"), algebraic_type: Builtin(U64) }, SumTypeVariant { name: Some("Interval"), algebraic_type: Builtin(U64) }}] },
bfops commented 1 week ago

Did we fix this?