Giter VIP home page Giter VIP logo

edit-text's Introduction

edit-text

Preview Image

edit-text is a collaborative rich text editor, written in Rust with a frontend in WebAssembly.

๐Ÿ‘ถ This is very early software.

๐Ÿ“š Read more in the Book on edit-text Internals.

โœ๏ธ Or try out the edit-text sandbox.

Getting Started

You'll need cargo-script to run the build script and a few other build tools:

cargo install cargo-script
cargo install wasm-bindgen-cli
cargo install diesel_cli --no-default-features --features sqlite

Install the WebAssembly target:

rustup target add wasm32-unknown-unknown

To test out the text editor live, run the server using this command. On first startup, this will first compile the database and wasm bundle. After that, this command launches the HTTP and WebSocket servers:

./x.rs wasm-build
./x.rs frontend-build
./x.rs server

Navigate to localhost:8000 and start editing!

You can run the server in release mode easily with the --release flag:

./x.rs server --release

For more commands, run ./x.rs help.

Local client proxy in Rust (no WASM)

Start the sync server in one terminal with this switch:

./x.rs server --client-proxy --release

In another terminal, run the client proxy:

./x.rs client-proxy --release

You will see any failures appear in the client-proxy code that would appear in the browser console when in WASM mode.

Compiling the frontend

The bundled frontend code (written in TypeScript) is tracked in git, but you can also compile it yourself. Make sure you have Node installed first, then:

npm i --prefix ./edit-frontend
./x.rs frontend-watch

This command watches the edit-frontend directory and continuously builds all frontend code. Note that the .wasm bundle isn't inlined into the bundle with webpack, but loaded asynchronously.

License

Apache-2.0

edit-text's People

Contributors

bors[bot] avatar briankabiro avatar tcr avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.