Repository navigation
This release comes four months after v2.9.0. Under semantic versioning, it is a major version bump reflecting significant host API and space lifecycle refactorings. Most of these changes include automated deprecation rewrites to ensure a smooth migration (detailed below).
Functionally, the most significant addition is a new concurrency and space synchronization model (settle, deferAndSettle:, defer:). Two new guides accompany these changes, covering concurrency, synchronization, and responsive UI patterns: Concurrency And Synchronization and Building Non-Blocking UIs. The README has been restructured to guide readers through these topics in a cohesive narrative.
The primary target for this release is the recently released Pharo 14.
Brief Migration Guide:
The table below outlines common migration patterns. Note that automated deprecation rewrite rules are provided for most of them:
| Old Pattern | New v3.0 Pattern | Rationale |
|---|---|---|
space pulse |
space settle |
#pulse is deprecated; senders cannot force pulses, only wait for the host pulse process to settle. |
space show |
space open |
Preferred idiomatic space opening method (matching #close). #show is retained as a compatibility alias. |
element forceLayout (when attached) |
space settle or space deferAndSettle: |
Prevents layout races against the active host pulse loop. |
space useSDL2Host / useSDL3Host |
space useSDLHost |
Unified SDL host selection across versions and platforms. |
space host: BlOSWindowSDL2Host new |
space host: BlSDLHost default |
Automatically selects SDL2 or SDL3 according to current OSWindowDriver. Sending #new is deprecated in favor of #default. |
space host: BlMorphicWindowHost new |
space host: BlMorphicWindowHost default |
Standalone hosts are now singletons. Sending #new is deprecated in favor of #default. |
space host: BlHeadlessHost new |
space host: BlHeadlessHost default |
Standalone hosts are now singletons. Sending #new is deprecated in favor of #default. |
space host: BlMockedHost new |
space host: BlHeadlessHost default |
Mocked hosts removed; use headless host on real pulse loop. |
space host: aNewHost (while open) |
space close; host: aNewHost; open |
Host immutability: spaces must be closed before switching hosts. |
element focused |
element isFocused or element isFocusOwner |
Distinguishes focus delegation (isFocused) from direct leaf ownership (isFocusOwner). |
element focusHolder |
element focusDelegate |
#focusHolder is retained as a compatibility alias. |
BlTransparentPaint new |
BlColorPaint transparent |
Centralized paint caching. |
Key Changes
Concurrency & Synchronization Primitives
BlSpaceSynchronization APIs:space settle: Blocks the active process until all queued tasks, skin phases, and layout computations reach equilibrium. Guarded against execution from within the host pulse process.space deferAndSettle: aBlock: EnqueuesaBlockonto the pulse process and blocks the active process until subsequent frame phases settle. Canonical pattern for tests and interactive scripts.space defer: aBlock: Non-blocking asynchronous dispatch to the space's pulse loop (for background worker processes).space deferOrValue: aBlock: Executes inline if already running on the space's pulse process; otherwise enqueues to the pulse loop.space isSettled: Non-blocking query answering whether all frame phases are currently idle.
- Deadlock Guard (
#denyPulseProcess):- Raises an explicit error if blocking synchronization (
#settle,#deferAndSettle:,waitUntil:) is sent from within the host pulse loop itself, preventing self-deadlocks.
- Raises an explicit error if blocking synchronization (
- Guarded Attached Layout:
- Guarded
BlElement >> #forceLayoutagainst attached elements; attempting to force layout on an attached element raises an error directing senders tospace settleorspace deferAndSettle:. Detached elements retain synchronous#forceLayout.
- Guarded
Hosts and Universes
- Singleton Hosts (
#default) &BlHostRegistry:- Standalone hosts (
BlHeadlessHost,BlOSWindowSDL2Host,BlOSSDL3Host,BlMorphicWindowHost) useTBlSingletonHostand are accessed via#default. Sending#newis deprecated with an automated rewrite rule delegating to#default. - Dynamic host lifecycle registered in
SessionManager(startUp:/shutDown:). BlHostserves as an OOP facade encapsulatinguniverse(#spaces,#closeSpaces,#openSpace:,#closeSpace:).
- Standalone hosts (
- BlParallelUniverse:
- Opening and closing spaces are queued as synchronized state transitions (
spacesToOpen,spacesToClose) underlifecycleMutex, evaluated deterministically during pulse, and guarded withifCurtailed:transactional state restoration. - Zero-cost cancellation: Evaluating
space open; close(orspace show; close) in the same frame resolves in memory without touching OS windows or GPU contexts.
- Opening and closing spaces are queued as synchronized state transitions (
- Event-Driven Host Pulse Loop (0ms Wake-on-Demand):
- Replaced unskippable delay sleeps with
pulseRequestedSemaphore waitTimeoutMilliseconds: msToWait. Wakeups on UI interactions happen in 0ms without busy-waiting or process starvation. - Consecutive
#requestPulsemessage sends during event bursts are coalesced into a single pulse pass viaconsumeAllSignals. - Pre-signal natural shutdown: When all spaces close, the host marks itself stopped before signaling waiting processes.
- Replaced unskippable delay sleeps with
- Host Immutability Invariant:
- Mutating
space host:while a space is open or transitioning is disallowed; spaces must be closed first (or migrated viaspace migrateToHost:).
- Mutating
- Removal of
BlMockedHost:- Removed
BlMockedHostand packageBlocHost-Mock. Headless testing runs uniformly on the real pulse architecture viaBlHeadlessHost default.
- Removed
- Zero Dependencies on Beacon:
- Removed
BlParallelUniverseErrorDuringPulseSignal; error handling and semaphore notification are self-contained.
- Removed
Test Architecture Modernization
- Introduced
BlSpaceTestCasefor fast, pulse-synchronized headless unit tests with automated space cleanup. - Extracted event simulation into
BlEventSimulator(Bloc-Simulation) with stateful modifiers, chainable cascades, and#denyPulseProcessguards. - Reorganized test suites by concern:
BlParallelUniverseTest(engine),BlSpaceSettleTest(equilibrium),BlSpaceLifecycleTest(windows),BlStartupShutdownTest(persistence), andBlParameterizedHostTest(host matrix).
Morphic Host Modernization
- Converted Morphic window spaces to run on a dedicated pulse process (matching SDL2 and SDL3 hosts).
- Implemented double-buffering (
backBuffer,frontBuffer) inBlAbstractMorphicHostSpace, preventing tearing and blank frames in Morphic / Spec2 presenters (SpBlSpaceInMorphPresenter,BlDemoPresenter). - Fixed initial
0@0extent issues via synchronousmorphicWindow fullBoundsinBlMorphicWindowHostSpace >> #show.
Focus Management & Delegation
- Focus Query Clarification:
- Added
#isFocusOwnerto query whether an element is the active focus leaf in the space (self space focusOwner == self). - Clarified
#isFocusedto honor focus delegation via#focusDelegateusing identity matching (== self). - Optimized
#hasFocusto walk the space's O(depth) focused element path instead of an O(N) full tree traversal. - Deprecated private
#focusedwith an automated rewrite rule targeting#isFocused.
- Added
- Focus Delegation (
#focusDelegate):- Introduced
#focusDelegate(retaining#focusHolderas a backward-compatible forwarder) to model composite elements where an outer container delegates user focus to an inner editor leaf. - Simplified
BlFocusProcessorto interact directly withspace. - Added unit test coverage for focus delegation across all
BlFocusabilitymodes (after,before,block).
- Introduced
Optional SDL3 Support
Support for SDL3 has been prepared with BlOSSDL3Host and BlOSSDL3GPUHost alongside existing SDL2 hosts. SDL3 is an optional integration requiring PharoSDL3 (v0.4.0+). GPU-accelerated rendering through SDL3 should be treated as experimental until end-to-end driver validation is finalized.
Pull Requests
- Remove Context and BlockClosure extensions by @tinchodias in #867
- Update versions in CI workflow by @tinchodias in #866
- Cleaning up some examples and tests by @tinchodias in #868
- Take care to tolerate some race conditions by @tinchodias in #869
- Concurrency and host architecture refactoring by @tinchodias in #871
- Enhancements in host and spaces lifecycle and reorganize tests by @tinchodias in #874
- Remove instance variable duplication in BlSpaceDragEvent by @Ducasse in #876
- BlHostRegistry: do not talk to the universes, talk to the hosts by @tinchodias in #875
- Little cleanup in BlDevScripter and tests by @tinchodias in #878
- Clean a bit more by @Ducasse in #877
- Improve error handling on pulse loop and space opening/closing by @tinchodias in #881
- Revert some pretty-print automatic format by @tinchodias in #882
- Fixes to Demo presenter by @tinchodias in #883
- Fix available hosts and preferred host by @tinchodias in #886
- Improvements on focus by @tinchodias in #884
- SDL hosts: Fix for Pharo headless and prepare for SDL3 host with a common #useSDLHost by @tinchodias in #888
- Refactor BlSDLHost hierarchy and introduce dedicated BlOSSDL3GPUHost by @tinchodias in #889
- Migrate focusOwner deprecation by @tinchodias in #890
- Replace BlTransparentPaint by a cached instance in BlColorPaint by @tinchodias in #891
- Implement #toFront, deprecate #toBack, and add BlSpace window tests by @tinchodias in #892
- Disable buildTextEmoji as CI fails too often by @tinchodias in #893
- Bugfix/fix for album issue 70 by @koendehondt in #895
- Fix BlSpace>>settleFor: by @tinchodias in #897
New Contributors
- @koendehondt made their first contribution in #895
Full Changelog: v2.9.0...v3.0.0