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)fromperry/uiwas unimplemented in codegen. The generic dispatch path emittedperry/ui warning: method 'ForEach' not in dispatch table (args: 2)and returned 0/undefined. The outerVStack'swidget_add_childthen got an invalid handle, AppKit silently refused to attach the window body, and the process ran withlsappinfo type="BackgroundOnly"— CPU burning, no window. Added a special case incrates/perry-codegen/src/lower_call.rs(next toVStack/HStack) that synthesizes aperry_ui_vstack_create(8.0)container, callsperry_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
UiSigtable entry: same reason asVStack/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 overState<string[]>) launches withtype="Foreground".- The corrected todo app from the
docs/src/ui/state.md"Complete Example" compiles and launches withtype="Foreground".