Rust 和 TypeScript 集成
A Rust-TypeScript integration

原始链接: https://github.com/beeeeep54/rust-typescript

前端和后端端口配置在环境变量中。 ├── backend/ │ ├── build.rs │ ├── Cargo.lock │ ├── Cargo.toml │ ├── openapi │ │ └── schema.yaml │ └── src │ └── main.rs ├── frontend/ │ ├── bun.lock │ ├── package.json │ ├── src │ ├── static │ ├── svelte.config.js │ ├── tsconfig.json │ └── vite.config.ts

This Hacker News thread discusses integrating Rust and TypeScript, primarily for backend development. The original post highlights a specific Rust-TypeScript integration project. Commenters share various tools and approaches for type sharing between the two languages, including `ts-rs`, `aeson-typescript`, and `typeshare`. A significant portion of the discussion revolves around generating TypeScript types from Rust definitions (often via OpenAPI) to ensure consistency between frontend and backend. Some users prefer defining types in Python and generating TypeScript from there. The conversation also touches on using Rust for backend logic (potentially compiled to WebAssembly) and the pros and cons of using Next.js with React Server Components versus a separate Rust backend. Performance, maintainability, and developer experience are all considered. Some users mentioned poem crate, utoipa and also mentioned Specta. Others questioned the necessity of complex state management solutions in modern frontend frameworks like SolidJS and Angular, compared to React.
相关文章

原文

The frontend and backend ports are configured in the env.

├── backend/               
│   ├── build.rs
│   ├── Cargo.lock
│   ├── Cargo.toml
│   ├── openapi
│   │   └── schema.yaml
│   └── src
│       └── main.rs
├── frontend/               
│   ├── bun.lock
│   ├── package.json
│   ├── src
│   ├── static
│   ├── svelte.config.js
│   ├── tsconfig.json
│   └── vite.config.ts
联系我们 contact @ memedata.com