ruff/playground
2025-03-04 09:36:35 -05:00
..
api Update NPM Development dependencies (#16466) 2025-03-03 08:04:59 +00:00
public Pull in fonts from a CDN (#16498) 2025-03-04 09:36:35 -05:00
src Pull in fonts from a CDN (#16498) 2025-03-04 09:36:35 -05:00
.gitignore Remove all useEffect usages (#12659) 2024-08-08 13:16:38 +02:00
.prettierignore Upgrade playground dependencies (#5830) 2023-07-18 08:00:54 +02:00
.prettierrc.json Use trailingComma: 'all' (#1457) 2022-12-29 19:36:51 -05:00
eslint.config.mjs Upgrade to ESlint 9 (#16470) 2025-03-03 09:59:57 +01:00
index.html playground: Add left panel and use brand colors (#5838) 2023-07-19 16:33:32 +02:00
package-lock.json Upgrade to Tailwind4 (#16471) 2025-03-03 10:09:09 +01:00
package.json Upgrade to Tailwind4 (#16471) 2025-03-03 10:09:09 +01:00
postcss.config.cjs Upgrade to Tailwind4 (#16471) 2025-03-03 10:09:09 +01:00
README.md Replace dead link for rome tools playground (#16153) 2025-02-14 12:27:14 +05:30
tsconfig.json Web playground with WASM (#1279) 2022-12-26 12:09:17 -05:00
tsconfig.node.json Web playground with WASM (#1279) 2022-12-26 12:09:17 -05:00
vite.config.ts Web playground with WASM (#1279) 2022-12-26 12:09:17 -05:00

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/api 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 Biome Playground.