makepad-2.0-migration

Migrates Makepad 1.x live_design code to Makepad 2.0 script_mod syntax.

747|87|Updated Jan 10, 2026
One-click install
npx skills add https://github.com/ZhangHanDong/makepad-skills --skill makepad-2-0-migration
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: makepad-2.0-migration
Source: https://github.com/ZhangHanDong/makepad-skills/tree/main/skills/makepad-2.0-migration
Command: npx skills add https://github.com/ZhangHanDong/makepad-skills --skill makepad-2-0-migration

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

Makepad 2.0 replaced the compile-time live_design! macro system with the runtime script_mod! macro and Splash scripting language, breaking every existing 1.x codebase. This Skill provides the complete syntax mapping, struct migration patterns, and pitfall checklist needed to port legacy Makepad applications without guesswork.

Core Features & Use Cases

  • Complete Syntax Mapping: Tables covering every change from live_design! to script_mod!, including angle brackets to curly braces, equals to colons, theme constants to theme.* namespace, and shader function rewrites.
  • Struct and Derive Migration: Step-by-step conversion of #[derive(Live, LiveHook)] to #[derive(Script, ScriptHook)], the required #[source] ScriptObjectRef field, and #[repr(C)] draw shader field ordering rules.
  • Pitfall Checklist: A 20+ item migration checklist covering common failures like missing height: Fit, hex colors needing #x prefix, and widget registration ordering in App::run.
  • Use Case: You have a Makepad 1.x app using live_design! with <Button> widgets and apply_over calls. This Skill walks you through converting each file to script_mod! syntax, updating derives, and fixing runtime property updates with script_apply_eval!.

Quick Start

Ask the AI to migrate your Makepad 1.x widget file using live_design syntax to the Makepad 2.0 script_mod format.

Frequently Asked Questions about makepad-2.0-migration

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I migrate from Makepad 1.x live_design to Makepad 2.0?

Replace live_design! with script_mod!, change <Widget> to Widget{}, use colons instead of equals for properties, and update derives from Live/LiveHook to Script/ScriptHook. Registration moves from live_register to App::run using App::from_script_mod.

What are the breaking changes in Makepad 2.0?

Key breaking changes include the script_mod! macro replacing live_design!, no angle brackets or commas in DSL syntax, theme.* namespace replacing (THEME_*) constants, := for named children, the +: merge operator, and mandatory height: Fit on containers since default height is zero.

Why is my Makepad 2.0 container invisible after migration?

Containers default to zero height in Makepad 2.0, unlike 1.x auto-sizing behavior. Add height: Fit or a fixed height to every container View to make it visible.

How do I update widget properties at runtime in Makepad 2.0?

Replace apply_over with the script_apply_eval! macro, passing the context, widget, and a Splash block. Use #(expr) for Rust expression interpolation instead of the old (expr) syntax from live! macros.

Why does my Makepad 2.0 Script struct fail to compile?

Every struct deriving Script must include a #[source] source: ScriptObjectRef field. For #[repr(C)] draw shaders, non-instance fields like #[rust] and resource handles must appear before the #[deref] field, with #[live] instance fields after it.