tech explorations related to Scratch
Find a file
2022-12-03 22:09:51 -08:00
.vscode chore: add generic Tauri content 2022-11-18 22:29:19 -08:00
public build: pnpm create tauri-app -m pnpm -t react-ts 2022-12-02 13:50:02 -08:00
src feat: build VERY rough overall layout 2022-12-03 22:09:51 -08:00
src-tauri build: pnpm create tauri-app -m pnpm -t react-ts 2022-12-02 13:50:02 -08:00
.editorconfig feat: build VERY rough overall layout 2022-12-03 22:09:51 -08:00
.gitignore chore: add generic Tauri content 2022-11-18 22:29:19 -08:00
index.html build: pnpm create tauri-app -m pnpm -t react-ts 2022-12-02 13:50:02 -08:00
LICENSE docs: add README.md and a few helper files 2023-08-16 16:44:16 -07:00
package.json feat: build VERY rough overall layout 2022-12-03 22:09:51 -08:00
pnpm-lock.yaml build: pnpm create tauri-app -m pnpm -t react-ts 2022-12-02 13:50:02 -08:00
README.md build: pnpm create tauri-app -m pnpm -t react-ts 2022-12-02 13:50:02 -08:00
tsconfig.json build: pnpm create tauri-app -m pnpm -t react-ts 2022-12-02 13:50:02 -08:00
tsconfig.node.json build: pnpm create tauri-app -m pnpm -t react-ts 2022-12-02 13:50:02 -08:00
vite.config.ts build: pnpm create tauri-app -m pnpm -t react-ts 2022-12-02 13:50:02 -08:00

Scratch using Tauri+Bevy

This branch is for exploring the idea of building a Scratch editor using Tauri and Bevy. The specific proposed architecture:

It was created with this command:

pnpm create tauri-app -m pnpm -t react-ts scratch-tauri-bevy

Quick start

Install system prerequisites if necessary: https://tauri.app/v1/guides/getting-started/prerequisites

Then run:

pnpm install
pnpm tauri dev

Recommendation from Tauri:

VS Code + Tauri + rust-analyzer

App architecture

  • Tauri will display the Scratch UI, analogous to scratch-gui, in a web view
    • This will also wrap Blockly, the paint editor, and other interactive editor elements
  • The web view will include an HTML canvas for the Scratch stage, similar to the current Scratch 3.0 layout
  • The stage will be rendered by a small Bevy module compiled to WASM, analogous to scratch-render
  • Another Bevy module, compiled to native code, will run everything that doesn't interact directly with the stage:
    • VM and runtime features similar to scratch-vm
    • Audio support similar to scratch-audio
    • Hardware communication for extensions
    • etc.
  • Communication between the render/web side and native side will be handled through Tauri's IPC-like features

If Tauri adds support for externally rendering to a canvas (see here), then the renderer can move to the native side. That should be even better for performance and should simplify communication as well.

Web architecture

On the web, all modules will be compiled to WASM and the communication between the rendering module and the rest of the editor will be more direct. If possible, the rendering and other features should still run in separate threads.