Repository navigation
GPUI-RSX 0.13.0 upgrades the generated API target to GPUI Kit 0.10.0 (gpui-component 0.10.0 / gpui-pre 0.3.12), adds constructor shorthand <Tag(args...)>, first-class <uniform_list>, clsx-style conditional class arrays, #[component] slots/style/caller tracking, cargo rsx dev, and zero-allocation runtime dynamic class refinement.
Compatibility & Breaking Changes
- Macro/core retains MSRV Rust 1.88; CLI/tooling retains Rust 1.98.
- The primary generated API target advances to GPUI Kit 0.10.0,
gpui-component0.10.0, andgpui-pre0.3.12 (GPUI_SOURCE_REV/GPUI_COMPONENT_REV). gpui_rsx_core::syntax::RsxElementaddspub args: Option<Vec<syn::Expr>>to represent parenthesized constructor arguments (<Tag(a, b)>). Downstream AST callers constructingRsxElementliterals should addargs: None(or..when destructuring).- Generated runtime dynamic
classhelpers now mutate agpui::StyleRefinementin place and call.refine_style(&__rsx_style)instead of rebuilding elements through boxed closures. Custom types using runtimeclass={expr}must implementgpui::Styled.
Added
- Parenthesized constructor shorthand
<Tag(args...)>: uppercase type paths expand<Button("save") ... />toButton::new("save")and<Tab() ... />toTab::new(), while lowercase paths callhelper(args...). Conflicting combinations withbase={...}or native HTML/SVG tags fail with targeted diagnostics. - First-class
<uniform_list count={...} render={...} />support with automatic or explicit element IDs, loop-key diagnostics, andyFlipped/sizingBehavior/horizontalattributes. - SVG animation attributes:
animation(.with_animation(...)) andtimedTransformation(.with_timed_transformation(...)). - Compile-time
clsx-style conditional class arrays (class={["flex", active.then_some("bg-blue-500"), disabled && "opacity-50", (selected, "border-1"), if open { "p-4" }]}). #[component]enhancements:#[track_caller]on generated constructors, builders, andRenderOnceimplementations for caller-accurate GPUI auto-IDs and panic traces.#[children]support forOption<AnyElement>(single-child mode withoutVecheap allocation).#[style] style: StyleRefinementto implementgpui::Styledon generated builders, forwarding static and dynamicclassattributes.#[slot]for optional single (Option<AnyElement>) and multi (Vec<AnyElement>) named slots via props or<div slot="header">children.
cargo rsx devsubcommand incargo-rsxto run hot-reload preflight checks, auto-detecthotreload/hot-reloadfeatures, inspect invocations via--check [--json], and launchdx serve --hot-patch.- Static
rsx.tomltheme token support ([colors]hex,[radius],[spacing],[text-size],[line-height],[opacity]) in generated runtime dynamic class helpers.
Performance
- Replace per-macro-call
fs::canonicalizesyscalls inrsx.tomldiscovery with a two-tier raw-directory → canonical-path cache validated bymtime. - Eliminate
Box<dyn FnMut(T) -> T>heap allocations and repeated element moves in runtime dynamicclassmatching via length-prefixedStyleRefinementmutation.
Changed
- Upgrade the primary generated API target, demo, and standalone fixtures to GPUI Kit 0.10.0,
gpui-component0.10.0, andgpui-pre0.3.12. - Refine README, Getting Started, Syntax Reference, Best Practices, and Migration documentation in English and Chinese for clearer structure and scannability.
Install
Published together: gpui-rsx-core, gpui-rsx-tools, gpui-rsx, and cargo-rsx.
gpui-rsx = "0.13.0"cargo install cargo-rsx --version 0.13.0 --lockedThe attached VS Code VSIX and Zed development extension archive were built by the release PR CI. SHA256SUMS covers both files. VS Code Marketplace publication and Zed registry review are separate from this release.
中文说明
0.13.0 将主生成 API 目标升级至 GPUI Kit 0.10.0(gpui-component 0.10.0 / gpui-pre 0.3.12),新增括号构造简写 <Tag(args...)>、原生 <uniform_list>、clsx 风格条件 class 数组、SVG 动画属性、#[component] 插槽 / 样式透传 / 调用栈追踪、cargo rsx dev 热重载命令,以及零装箱分配的运行时动态 class 样式合并。
两个需要注意的兼容性调整:gpui_rsx_core::syntax::RsxElement 新增 args: Option<Vec<syn::Expr>> 字段;运行时动态 class={expr} 现通过 gpui::StyleRefinement 原地修改并调用 .refine_style(&__rsx_style),自定义元素类型需实现 gpui::Styled。
四个 crate 已统一发布为 0.13.0。宏 / core 的 Rust MSRV 仍为 1.88,CLI / 工具库仍为 1.98。
Validation
- Local
scripts/check.sh --proxy --releasepassed without skip flags, covering default/all-feature workspace tests, strict Clippy, real GPUI demo targets, WASM playground build, Astro documentation build + 1,508 link checks, and all four publication dry-runs. - All checks in the release PR CI and post-merge main CI passed, including Required Checks and GitHub Pages deployment.
- Merge commit
7333ce5995be0ed2d6f9f6fdd515cfb0a092cc31has the identical Git tree (7c93a3f34b94e5f6884e69df70b6d943e47af9ce) as tested release-branch commit3bdf2bcd191499e77ff4a69dfe83a63485b545ed. gpui-rsx-core,gpui-rsx-tools,gpui-rsx, andcargo-rsxwere published in dependency order; crates.io search reports version 0.13.0 for all four packages.- Editor artifact versions, VSIX metadata/readme/license, Zed WASM header, and
SHA256SUMSchecksums were verified before upload.