6

ekzhang/rustpad:使用Rust编写的高效代码编辑器

 2 years ago
source link: https://www.jdon.com/58056
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.
neoserver,ios ssh client

ekzhang/rustpad:使用Rust编写的高效代码编辑器

Rustpad是一个高效、最小的开源协作文本编辑器,基于操作转换算法。它允许用户在浏览器中编写代码时实时协作。Rustpad 是完全自托管的,适合一个很小的 ​​Docker 镜像,不需要数据库。

服务器是使用warp web 服务器框架和 操作转换 库用 Rust 编写的 。我们使用wasm-bindgen将文本操作逻辑编译为 WebAssembly 代码,该代码在浏览器中运行。前端使用React和TypeScript 编写,并与Monaco接口,Monaco是支持 VS Code 的文本编辑器。

架构上,客户端代码通过 WebSocket 与存储内存数据结构的中央服务器进行通信。这使得编辑器非常快,允许我们避免配置数据库,并使测试更容易。权衡是文档在服务器重新启动之间或在 24 小时不活动后会丢失。

Github星:1853


About Joyk


Aggregate valuable and interesting links.
Joyk means Joy of geeK