Skip to content

Files

Latest commit

4afff43 · Oct 29, 2023

History

History
This branch is 4460 commits behind astral-sh/ruff:main.

playground

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
Aug 11, 2023
Jul 19, 2023
Oct 29, 2023
Dec 27, 2022
Dec 26, 2022
Jul 18, 2023
Dec 30, 2022
Aug 27, 2023
Jul 19, 2023
Aug 11, 2023
Aug 11, 2023
Dec 29, 2022
Jul 19, 2023
Dec 26, 2022
Dec 26, 2022
Dec 26, 2022

playground

In-browser playground for Ruff. Available https://play.ruff.rs/.

Getting started

In order to build the WASM module install wasm-pack.

Next, build the WASM module by running npm run build:wasm (release build) or npm run dev:wasm (debug build) from the ./playground directory.

Finally, install TypeScript dependencies with npm install, and run the development server with npm run dev.

To run the datastore, which is based on Workers KV, install the Wrangler CLI, then run npx wrangler dev --local from the ./playground/db directory. Note that the datastore is only required to generate shareable URLs for code snippets. The development datastore does not require Cloudflare authentication or login, but in turn only persists data locally.

Architecture

The playground is implemented as a single-page React application powered by Vite, with the editor experience itself powered by Monaco.

The playground stores state in localStorage, but supports persisting code snippets to a persistent datastore based on Workers KV and exposed via a Cloudflare Worker.

The playground design is originally based on Tailwind Play, with additional inspiration from the Rome Tools Playground.