.vscode | ||
public | ||
src | ||
src-tauri | ||
.editorconfig | ||
.gitignore | ||
index.html | ||
LICENSE | ||
package.json | ||
pnpm-lock.yaml | ||
README.md | ||
tsconfig.json | ||
tsconfig.node.json | ||
vite.config.ts |
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
Recommended IDE Setup
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.
- VM and runtime features similar to
- 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.