![]() The docs were out of date, and the new version incorporates some feedback. I tried to keep the language concise and the information ordered by how early you need it, so people can get the relevant information quickly before jumping into the code. I did some minor format_dev changes for consistency in the docs. --------- Co-authored-by: Micha Reiser <micha@reiser.io> |
||
---|---|---|
.. | ||
api | ||
public | ||
src | ||
.eslintrc | ||
.gitignore | ||
.prettierignore | ||
.prettierrc.json | ||
index.html | ||
package-lock.json | ||
package.json | ||
postcss.config.cjs | ||
README.md | ||
tailwind.config.cjs | ||
tsconfig.json | ||
tsconfig.node.json | ||
vite.config.ts |
playground
In-browser playground for Ruff. Available https://play.ruff.rs/.
Getting started
First, build the WASM module by running npm run build:wasm
(release build) or
npm run build:wasm
(debug build) from the ./playground
directory.
Then, 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.