makepad-2.0-splash
splash language, makepad script, script_mod!, makepad scripting, splash 脚本, makepad 2.0 script, mod.state, on_render, script_eval, streaming evaluation, splash syntax, splash vm, let binding, splash functions, hot reload, live reload, ScriptModKey, script_mod_overrides, checkpoint, incremental parsing, canvas splash, POST splash, fn tick, on_audio, set_text, tab switching, 音乐播放器, token monitor, driver script, audio API, 热重载, 脚本引擎, 增量解析
npx skills add ZhangHanDong/makepad-skills --skill makepad-2.0-splash --agent claude-code
Same command for any agent — swap --agent for codex, cursor, copilot.
Weekly change comes from our own snapshots, not the repository page — it measures attention, not adoption.
What it does
Guides an AI agent to work with Makepad 2.0 Splash scripts using the script_mod! macro and runtime tooling. It covers the core concepts, syntax rules, state management, event handling, functions, control flow, HTTP requests, HTML parsing, and streaming evaluation. It also explains hot reload and ScriptModKey tracking, ScriptSource variants, and critical layout rules for UI containers. It provides guidance on Canvas rendering via the Claude Code workflow, including HTTP/WS usage, and outlines the two creation paths: Compiled path (script_mod!) and Eval path (POST /splash, Splash.set_text). It highlights pitfalls specific to Splash eval and how to address them, such as lazy initialization and fallback initializations when certain hooks or type-default inheritance behaviors differ between paths.
The skill enumerates examples and patterns for building Splash UI, including properties with dot-path inline syntax for Canvas rendering, how to structure named children, how to specify state and event handlers, and how to perform streaming evaluation token-by-token.
How it works
The skill instructs the agent to:
- Use the script_mod! macro structure with a Rust import and an app_main!(App);
- Define state via mod.state and render reactions via on_render callbacks.
- Implement event handling inline in Splash and from Rust via script_eval! to mutate state and trigger re-render.
- Write functions and control flow (if/else, for loops, while) in Splash syntax as demonstrated.
- Perform HTTP requests with net.HttpRequest, net.HttpMethod, and net.http_request, handling on_response and on_error, plus streaming with is_streaming and on_stream callbacks.
- Parse and query HTML with the provided methods, and handle streaming evaluation using vm.eval_with_append_source for real-time UI updates.
- Enable hot reload with the --hot flag and track ScriptModKey for script_mod! blocks, applying overrides via ScriptCode::script_mod_overrides and maintaining source maps for error reporting.
- Distinguish between Compiled path and Eval path, noting differences in widget creation, on_after_apply behavior, type-default inheritance, and template registration, and apply fixes like lazy initialization in draw_walk when needed.
- Use the Canvas HTTP API for sending Splash to the renderer, including both full and streaming render modes, and manage WS-based event listening for click events.
- Follow the Canvas Syntax rules for properties, radius, padding, alignment, and the specific patterns that differ from script_mod! usage.
- Be aware of Eval Pitfalls, particularly ScrollYView, on_after_apply callbacks, type-default inheritance in eval, and named-child copies, and implement the recommended workarounds.
When to use it
Use when implementing or maintaining Splash scripts that rely on hot-reload capable, streaming-evaluable runtime, and when integrating with the Makepad Canvas for visual output via Claude Code. Activate when working with canvas-based dashboards, UI widgets, and real-time updates through streaming code generation.
What it can touch
- ScriptModKey, ScriptCode, and script_mod! blocks for hot reload tracking
- VM for streaming evaluation and token-by-token UI updates
- HTTP/WS endpoints for Canvas rendering and event streaming
- Splash code blocks, including dot-path inline properties and padding/alignment types for Canvas rendering
Caveats
- Hot reload workflow relies on file watcher and correct ScriptModKey tracking; placeholder counts may require full rebuild when changed
- Eval path (POST /splash) differs from compiled path in widget creation and template/inheritance behavior; certain hooks like on_after_apply may not trigger in eval-created widgets
- Type-default properties and named children may not fully inherit in eval path; workarounds include lazy initialization in draw_walk and querying type defaults via vm.bx.heap.type_default_for_object()
- Some components and patterns are Canvas-specific (Canvas syntax) and require explicit patterns for padding, border radius, and alignment
# Makepad 2.0 Splash Scripting Language Splash is Makepad 2.0's core runtime UI scripting language, released February 12, 2026. It replaces the old compile-time `live_design!` macro system with a runtime `script_mod!` macro that enables hot reload, streaming evaluation, and AI-first code generation. ## Core Concepts ### Script Structure Every Splash script starts with a `use` import and is embedded in Rust via the `script_mod!{}` macro: ```rust use makepad_widgets::*; app_main!(App); script_mod! { use mod.prelude.widgets.* // let bindings, functions, state, and UI definitions go here startup() do #(App::script_component(vm)){ ui: Root{ main_window := Window{ window.inner_size: vec2(800, 600) body +: { // UI content } } } } } ``` ### Syntax Rules - **No commas** between properties -- whitespace-delimited - **No semicolons** -- cleaner syntax optimized for LLM generation - **Property assignment**: `key: value` - **Dot-path shorthand**: `draw_bg.color: #f00` (equivalent to `draw_bg +: { color: #f00 }`) - **Merge operator**: `key +: { ... }` extends parent without replacing - **Named children**: `name := Widget{...}` (addressable, overridable per-instance) - **Let bindings**: `let MyTe
- Core Concepts
- Script Structure
- Syntax Rules
- State Management
- Event Handling
- Functions
- Control Flow
- HTTP Requests
- HTML Parsing
- Streaming Evaluation
- Hot Reload & Script Mod Tracking
- Critical Layout Rules
- Widget Reference
- Canvas: Rendering Splash from Claude Code
Full render
curl -s -X POST "http://127.0.0.1:$PORT/splash" -d 'View{width:Fill height:Fit Label{text:"Hello"}}'
Streaming render
curl -s -X POST "http://127.0.0.1:$PORT/splash/stream" # begin
curl -s -X POST "http://127.0.0.1:$PORT/splash/stream" -d 'View{...' # append
curl -s -X POST "http://127.0.0.1:$PORT/splash/end" # end
Clear
curl -s -X POST "http://127.0.0.1:$PORT/clear"
Long-lived WS connection receives button click events as JSON
mkfifo /tmp/ws_fifo; (sleep 99999 > /tmp/ws_fifo &)What does the makepad-2.0-splash skill do?
splash language, makepad script, script_mod!, makepad scripting, splash 脚本, makepad 2.0 script, mod.state, on_render, script_eval, streaming evaluation, splash syntax, splash vm, let binding, splash functions, hot reload, live reload, ScriptModKey, script_mod_overrides, checkpoint, incremental parsing, canvas splash, POST splash, fn tick, on_audio, set_text, tab switching, 音乐播放器, token monitor, driver script, audio API, 热重载, 脚本引擎, 增量解析
How do I install it?
Run `npx skills add ZhangHanDong/makepad-skills --skill makepad-2.0-splash --agent claude-code` — it drops the skill into your project so the agent can pick it up. Swap the --agent value for codex, cursor or copilot if you use one of those.
Where does this skill come from?
From ZhangHanDong/makepad-skills, a repository with 745 stars. We read it straight from the repository tree rather than a submitted listing, so what you see here is what is actually published.
Is a popular skill a good skill?
Not necessarily. Stars measure attention, not adoption — a repository can trend for a week and be abandoned. That is why we show the weekly change from our own snapshots next to the total, instead of a single flattering number.
