github PerryTS/perry v0.5.110
v0.5.110 — perry/ui ForEach codegen

latest releases: v0.5.1220, v0.5.1219, v0.5.1206...
3 months ago

Followup to #103. v0.5.109 fixed the type stubs + docs; this release fixes the actual codegen so the todo app visibly shows a window.

Bug Fixes

  • ForEach(state, render) from perry/ui was unimplemented in codegen. The generic dispatch path emitted perry/ui warning: method 'ForEach' not in dispatch table (args: 2) and returned 0/undefined. The outer VStack's widget_add_child then got an invalid handle, AppKit silently refused to attach the window body, and the process ran with lsappinfo type="BackgroundOnly" — CPU burning, no window. Added a special case in crates/perry-codegen/src/lower_call.rs (next to VStack/HStack) that synthesizes a perry_ui_vstack_create(8.0) container, calls perry_ui_for_each_init(container, state_handle, render_closure), and returns the NaN-boxed container pointer.

    Why it's a special case and not a UiSig table entry: same reason as VStack/HStack — variadic-in-shape (needs side-effectful container synthesis + separate for_each_init call + handle return), which doesn't fit the uniform args→runtime_fn table.

Verified

  • test_min4.ts (VStack containing ForEach over State<string[]>) launches with type="Foreground".
  • The corrected todo app from the docs/src/ui/state.md "Complete Example" compiles and launches with type="Foreground".

Don't miss a new perry release

NewReleases is sending notifications on new releases.