- app: port of GPUI's App effect cycle (update / flush_effects with
deferred subscription activation and notification dedup), EntityMap
(typed cells, leasing, explicit release), Context<T> (notify, emit,
observe, subscribe, observe_self/subscribe_self, on_release,
observe_release, observe_global, defer_call), SubscriberSet and
Subscription.
- TypeId-keyed maps become EventKey[E] / GlobalKey[G]: values cross the
app's untyped maps as closures writing into the key's typed slot.
- No Drop: App::release replaces the last-handle drop; subscriptions end
with unsubscribe() or when their entity is released.
- Fail loudly on re-entrant updates, reads during updates, use after
release, cross-app use, missing globals, global_mut outside an update.
- Tests: GPUI's subscription tests ported, plus app-model and panic tests.
- examples/counter; PORTING.md M3 status, deviations, toolchain notes.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- layout: port of GPUI's TaffyLayoutEngine (request_layout,
request_measured_layout, compute_layout, layout_bounds,
stretch_auto_size_to_fill) and LayoutStyle::to_taffy, with rem resolution
and device-pixel snapping (round_half_toward_zero, stroke snapping, ceiled
measured sizes). No cross-frame node cache yet (needs element ids, M6).
- Depend on Milky2018/chicle 0.6.3, the maintained successor of
moon_taffy (which no longer compiles), instead of vendoring.
- conformance/chicle: standalone module running moon_taffy's 1,038 taffy
fixtures against chicle; all pass on wasm, wasm-gc, js and native.
- card example now lays out its content with the engine.
- Docs: PORTING.md M2 status, revised decision 3, M2 deviations; README;
NOTICE attribution for the conformance fixtures.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
docs/PORTING.md maps GPUI's architecture onto MoonBit packages, separates
pure logic from platform code, surveys mooncakes packages and their backends,
recommends a js + Canvas2D first backend behind a small Platform trait, lists
the Rust idioms that need a different design, and gives an ordered roadmap.
First slice (pure, tested on wasm, wasm-gc, js and native):
- geometry: Pixels/ScaledPixels/DevicePixels/Rems, Absolute/Definite/Length
with parsing, Point/Size/Bounds/Edges/Corners, Anchor, Axis, ContentMask
- color: Rgba/Hsla with conversions, hex parsing, blending, Background
(solid, linear gradient, patterns)
- scene: primitives (Quad, Shadow, Path, Underline, sprites), transformation
matrix, BoundsTree draw ordering, layers, finish/batches, replay
Derived from Zed's GPUI (Apache-2.0); see LICENSE and NOTICE.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>