Using rust to generate typescript client

This page summarizes the projects mentioned and recommended in the original post on /r/rust

InfluxDB - Power Real-Time Data Analytics at Scale
Get real-time insights from all types of time series data with InfluxDB. Ingest, query, and analyze billions of data points in real-time with unbounded cardinality.
www.influxdata.com
featured
SaaSHub - Software Alternatives and Reviews
SaaSHub helps you find the best software and product alternatives
www.saashub.com
featured
  • typeshare

    Discontinued Generate code in different languages from Rust type definitions for FFI interop.

  • It doesn’t generate a complete client but 1Password’s Typeshare can generate TypeScript from Rust data structures https://github.com/1password/typeshare

  • specta

    Easily export your Rust types to other languages (by oscartbeaumont)

  • I assume you're using Axum or Actix as your router & web server, in which case I think using OpenAPI specs is your best option. I see that rspc has already been mentioned in this thread, which I would definitely recommend (disclaimer - I work at the company that builds it) if continuing to use REST wasn't a priority, since it can auto-generate all the TS bindings you need and has a React Query integration so you'd feel right at home. It's able to do so much since it's able to sit between your backend and frontend code, but REST is a lot less opinionated, hence the recommendation to continue using OpenAPI. However, if you're willing to lose some type-safety there's the option of using a Rust -> TS generator specifically for your data types, and then manually use React Query. You'd lose the type-level enforcement of your routes, but at least you'd have your structs and enums available in TS. If you were to take this route I'd personally recommend using Specta, since it's the Rust -> TS generator that powers rspc, but there's also ts-rs and Typeshare which could probably do the job (though I don't think they're as good).

  • InfluxDB

    Power Real-Time Data Analytics at Scale. Get real-time insights from all types of time series data with InfluxDB. Ingest, query, and analyze billions of data points in real-time with unbounded cardinality.

    InfluxDB logo
NOTE: The number of mentions on this list indicates mentions on common posts plus user suggested alternatives. Hence, a higher number means a more popular project.

Suggest a related project

Related posts

  • Adding search to static websites

    1 project | dev.to | 4 May 2024
  • Bytecode VMs in Surprising Places

    9 projects | news.ycombinator.com | 30 Apr 2024
  • Verified Rust for low-level systems code

    5 projects | news.ycombinator.com | 4 May 2024
  • Show HN: CLI tool for using Timeular tracker with other time-tracking software

    1 project | news.ycombinator.com | 4 May 2024
  • Show HN: Cvtek: Craft Your Resume/CV Using TOML

    1 project | news.ycombinator.com | 4 May 2024