Skip to content

GPUI-RSX 0.13.0

Latest

Choose a tag to compare

@wsafight wsafight released this 21 Nov 02:14
· 3 commits to main since this release
7333ce5

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-component 0.10.0, and gpui-pre 0.3.12 (GPUI_SOURCE_REV / GPUI_COMPONENT_REV).
  • gpui_rsx_core::syntax::RsxElement adds pub args: Option<Vec<syn::Expr>> to represent parenthesized constructor arguments (<Tag(a, b)>). Downstream AST callers constructing RsxElement literals should add args: None (or .. when destructuring).
  • Generated runtime dynamic class helpers now mutate a gpui::StyleRefinement in place and call .refine_style(&__rsx_style) instead of rebuilding elements through boxed closures. Custom types using runtime class={expr} must implement gpui::Styled.

Added

  • Parenthesized constructor shorthand <Tag(args...)>: uppercase type paths expand <Button("save") ... /> to Button::new("save") and <Tab() ... /> to Tab::new(), while lowercase paths call helper(args...). Conflicting combinations with base={...} 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, and yFlipped / sizingBehavior / horizontal attributes.
  • SVG animation attributes: animation (.with_animation(...)) and timedTransformation (.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, and RenderOnce implementations for caller-accurate GPUI auto-IDs and panic traces.
    • #[children] support for Option<AnyElement> (single-child mode without Vec heap allocation).
    • #[style] style: StyleRefinement to implement gpui::Styled on generated builders, forwarding static and dynamic class attributes.
    • #[slot] for optional single (Option<AnyElement>) and multi (Vec<AnyElement>) named slots via props or <div slot="header"> children.
  • cargo rsx dev subcommand in cargo-rsx to run hot-reload preflight checks, auto-detect hotreload / hot-reload features, inspect invocations via --check [--json], and launch dx serve --hot-patch.
  • Static rsx.toml theme token support ([colors] hex, [radius], [spacing], [text-size], [line-height], [opacity]) in generated runtime dynamic class helpers.

Performance

  • Replace per-macro-call fs::canonicalize syscalls in rsx.toml discovery with a two-tier raw-directory → canonical-path cache validated by mtime.
  • Eliminate Box<dyn FnMut(T) -> T> heap allocations and repeated element moves in runtime dynamic class matching via length-prefixed StyleRefinement mutation.

Changed

  • Upgrade the primary generated API target, demo, and standalone fixtures to GPUI Kit 0.10.0, gpui-component 0.10.0, and gpui-pre 0.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 --locked

The 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.

Changelog · Migration guide


中文说明

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 --release passed 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 7333ce5995be0ed2d6f9f6fdd515cfb0a092cc31 has the identical Git tree (7c93a3f34b94e5f6884e69df70b6d943e47af9ce) as tested release-branch commit 3bdf2bcd191499e77ff4a69dfe83a63485b545ed.
  • gpui-rsx-core, gpui-rsx-tools, gpui-rsx, and cargo-rsx were 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 SHA256SUMS checksums were verified before upload.

Feature PR #118 · Release PR #119