Skip to content

Typescript client should use strict type imports. #2661

@AsocPro

Description

@AsocPro

When generating the bindings for use with vite the bindings will cause errors due to the type imports not specifying that they are type imports due to vite how vite handles imports. It appears that other typescript build tools are not as picky about this but these changes should work universally even with other tools that are less picky.

The following types should be removed from the main import list and imported as types in a separate import.

import type {
  CallReducerFlags,
  DbContext,
  ErrorContextInterface,
  Event,
  EventContextInterface,
  ReducerEventContextInterface,
  SubscriptionEventContextInterface,
} from "@clockworklabs/spacetimedb-sdk";

Also in tables files the following import should also be type imports.

import type { EventContext, Reducer, RemoteReducers, RemoteTables } from ".";

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions