raquo/Airstream
63.9
Adequate · 6 November 2026
15.4k
lines of production code
Scala
primary language
4
measurements over time
What this system is
Features
Add dynamic import operations for Signals and EventStreams
Users can now create ECMAScript 6 dynamic import boundaries for progressive module loading on both Signal and EventStream types. New inline methods (Signal.dynamicImport, Signal\[A\].dynamicImport, EventStream.dynamicImport, EventStream\[A\].dynamicImport) wrap Scala.js's js.dynamicImport, ensuring that code for a specified resource is loaded asynchronously only when actually executed, with an optional transformation function applied once the module is available.
src/main/scala-3/com/raquo/airstream/dynamicImport · high confidence
Introduce EventBus, WriteBus, and EventBusStream with batch emit support
This change introduces the core event bus components for the Airstream library. EventBus now combines a WriteBus and an EventStream, allowing users to separate write permissions from read access via its \writer\ and \events\ properties. WriteBus provides methods to add source streams and transform writers using \contracomposeWriter\, \contramapWriter\, and \filterWriter\. A key behavioral addition is the support for batch emitting events into multiple buses within a single transaction via the new \emit\ and \emitTry\ methods on both EventBus and WriteBus, which also include duplicate-key validation to ensure integrity. The underlying EventBusStream handles source management and transaction propagation, with specific logic to address issue \#155 regarding the \isStarted\ check during event processing.
src/main/scala/com/raquo/airstream/eventbus · high confidence
Introduce dynamic ownership model with reusable subscriptions
The ownership system now supports subscriptions that can be activated and deactivated repeatedly via the new DynamicOwner and DynamicSubscription classes, allowing resources to be cleanly managed during component mount/unmount cycles without permanent disposal. A new OneTimeOwner class prevents usage after being killed, and TransferableSubscription enables efficient ownership transfers between active owners without triggering unnecessary activation or deactivation callbacks.
src/main/scala/com/raquo/airstream/ownership · high confidence
Introduce sbt source generators for N-ary combine and tuple operations
The build now uses sbt source generators to automatically produce Scala code for combining multiple Signals and EventStreams (up to N arity) and for handling tuple-based operations like mapN, filterN, and splitOptions. This eliminates the need for manually written boilerplate for each arity, ensuring consistent API coverage for combine, sample, and tuple transformation methods across the library.
project · high confidence
Introduce strict and lazy derived state variables
The state management API now supports derived state via two new variable types: \DerivedVar\ (strict) and \LazyDerivedVar\ (lazy). \DerivedVar\ provides a read-write lens into a parent \Var\ that is strictly evaluated and requires an \Owner\ to manage its subscription lifecycle, ensuring its current value is always up-to-date. \LazyDerivedVar\ offers a similar lens but evaluates its value only on demand (e.g., when accessed via \.now()\ or when it has subscribers), allowing updates even without active subscribers. Both types maintain bidirectional linkage with their parent, propagating changes through \zoom\ and \bimap\ operations while handling errors via standard unhandled error channels.
src/main/scala/com/raquo/airstream/state · high confidence
Introduce structured error handling and unhandled error reporting
Airstream now provides a dedicated error handling system via the new \AirstreamError\ class and its subclasses (such as \VarError\, \ObserverError\, and \TransactionDepthExceeded\). This change introduces a global unhandled error reporting mechanism that allows users to register custom callbacks to catch errors that would otherwise be silently dropped, with built-in defaults for console logging and debugging. Additionally, the \RecoverOps\ trait adds operators like \recover\, \recoverIgnoreErrors\, and \tapEachError\ to observables, enabling developers to handle or inspect errors directly within the reactive stream.
src/main/scala/com/raquo/airstream/core · high confidence
New Status API to track input/output lifecycle of operators
Airstream introduces a new \Status\ type (with \Pending\ and \Resolved\ states) and companion observables (\AsyncStatusObservable\, \FlatMapStatusObservable\) that allow users to observe the intermediate state of asynchronous operators. This enables tracking when an input is waiting for output versus when a result is available, and provides helper methods like \toPendingOption\ and \toResolvedOption\ to inspect these states directly.
src/main/scala/com/raquo/airstream/status · high confidence
New custom source APIs for creating custom signals and streams
Users can now easily create custom observables from external sources using the new \CustomSignalSource\ and \CustomStreamSource\ classes, along with the \CustomSource.Config\ builder. These classes provide a structured way to define start, stop, and value/error firing logic, with \CustomStreamSource\ specifically handling transaction ordering for events emitted during the start phase to ensure deterministic behavior in merge/combine operations. Deprecated factory methods on \Signal\ and \EventStream\ are now marked for removal in favor of the new \fromCustomSource\ extension methods.
src/main/scala/com/raquo/airstream/custom · high confidence
New distinct operators for filtering consecutive duplicate events
Added DistinctOps trait and DistinctSignal/DistinctStream implementations that allow filtering out consecutive duplicate values from streams and signals. Users can now use distinct, distinctBy, distinctByRef, distinctNoneOnly, distinctErrors, and distinctTry methods to control which events are emitted based on equality comparisons, with options to reset the distinct state on stream stop.
src/main/scala/com/raquo/airstream/distinct · high confidence
New extension operators for Boolean, Option, Either, Try, Status, and Tuple types
The \airstream/extensions\ package now provides a comprehensive set of extension methods for common Scala types, allowing you to transform and split observables and streams more expressively. Boolean observables gain \invert\ (with a \not\ alias), \mapTrueToSome\, \mapFalseToSome\, \mapTrueToSeq\, \mapFalseToSeq\, \foldBoolean\, and \splitBoolean\. Option observables and streams now include \mapSome\, \mapSomeToOption\, \mapSomeToSeq\, \mapFilterSome\, \foldOption\, \mapToRight\, \mapToLeft\, \someOrElse\, \collectSome\, and \splitOption\ (with a deprecated two-argument version). Either types are supported via \mapRight\, \mapLeft\, \foldEither\, \swap\, \mapToOption\, \mapLeftToOption\, \rightOrElse\, \leftOrElse\, \collectLeft\, \collectRight\, and \splitEither\. Try observables and streams offer \mapSuccess\, \mapFailure\, \foldTry\, \mapToEither\, \successOrElse\, \throwFailure\, \collectSuccess\, and \collectFailure\. Status observables and streams provide \mapOutput\, \mapInput\, \mapResolved\, \mapPending\, \foldStatus\, \collectOutput\, \collectResolved\, \collectPending\, \collectPendingInput\, and \splitStatus\. Additionally, new helpers for tuples of options (\mapSomes\, \tupledSomes\, \splitOptions\) and generated \mapN\/\filterN\ helpers for tuple signals and streams up to arity 16 are available.
src/main/scala/com/raquo/airstream/extensions · high confidence
New macro-based splitMatchOne and splitMatchSeq APIs with StrictSignal callbacks
A new \ObservableMacroImplicits\ trait introduces \splitMatchOne\ and \splitMatchSeq\ extension methods that use macros to fuse pattern-matching clauses into a single match expression, providing compiler warnings for non-exhaustive or unreachable cases. The API allows splitting observables by value or by key (for collection-valued observables) using clause builders like \handleCase\, \handleType\, \handleValue\, and \handleRest\. A key behavioral change is that the signals passed to these clause handlers are now \StrictSignal\ instances, allowing users to read their current value synchronously via \.now()\, aligning with other split API changes.
src/main/scala-3/com/raquo/airstream/core · high confidence
New split operators and configuration for keyed observables
The \split\ package now provides a comprehensive set of operators for splitting collections of observables by key. Users can use \splitSeq\ and \splitSeqByIndex\ on Observables and Vars to create keyed child signals or derived variables, with \splitSeqMutate\ available for efficient in-place updates of mutable collections. A new \splitOne\ operator allows splitting single-item observables, while \splitSomeSeq\ handles optional collections. To manage performance and debugging, a \DuplicateKeysConfig\ allows users to enable or disable warnings for duplicate keys, which are reported as unhandled errors when enabled.
src/main/scala/com/raquo/airstream/split · high confidence
New splitMatchOne and splitMatchSeq macros with ergonomic Scala 3 syntax
This change introduces new macro-based \splitMatchOne\ and \splitMatchSeq\ capabilities for Airstream observables, allowing users to split streams using pattern matching, type checks, or value equality via \handleCase\, \handleType\, \handleValue\, and \handleRest\ clauses. The implementation uses Scala 3 macros to generate efficient match blocks at compile time, preserving exhaustiveness checking. Additionally, new \withKey\ and \varWithKey\ extractors are provided to simplify accessing keys in split sequences, supporting both standard and infix notation for better ergonomics in Scala 3.
src/main/scala-3/com/raquo/airstream/split · high confidence
New stream operators and signal-stream conversion utilities
The \airstream.misc\ package now includes several new stream transformation classes: \CollectStream\ for mapping and filtering events via a function returning \Option\, \DropStream\ and \TakeStream\ which conditionally pass or block events based on a predicate with optional reset-on-stop behavior, and \FilterStream\ for simple event filtering. Additionally, \SignalFromStream\ and \StreamFromSignal\ provide bidirectional conversion between signals and streams, with \StreamFromSignal\ supporting both update-only and initial-value-emitting modes to keep streams synchronized with signal state across restarts.
src/main/scala/com/raquo/airstream/misc · high confidence
New timing operators and async stream implementations
Added new timing operators including \AnimationFrameStream\ (throttling events to the next browser animation frame), \DebounceStream\, \DelayStream\, \ThrottleStream\, and \SyncDelayStream\. Introduced \JsPromiseStream\ and \JsPromiseSignal\ to handle JavaScript promises with lazy evaluation, and \PeriodicStream\ for recurring tasks. These components provide new ways to control event timing and handle asynchronous data sources within the library.
src/main/scala/com/raquo/airstream/timing · high confidence
New web primitives: AjaxStream, FetchStream, DomEventStream, and WebStorageVar
This release introduces four new reactive web components to the \airstream/web\ package. \AjaxStream\ replaces the legacy \AjaxEventStream\ (now deprecated) to handle HTTP requests via XMLHttpRequest, emitting responses or specific error types (status, network, timeout, abort). \FetchStream\ provides a modern alternative using the Fetch API, supporting GET, POST, PUT, PATCH, DELETE, and QUERY methods with configurable request/response codecs and automatic abort signal management. \DomEventStream\ allows binding to DOM events (e.g., click, input) on any event target, automatically managing listener registration and removal. Finally, \WebStorageVar\ offers a persistent variable backed by LocalStorage or SessionStorage, with built-in support for cross-tab synchronization via \syncOwner\ and helpers for common types like text, bool, and int.
src/main/scala/com/raquo/airstream/web · high confidence
Removals
Removal of experimental Airstream state propagation library
The experimental \airstream\ package, which provided a reactive state propagation system including signals, computed values, and batch updates, has been removed from the codebase. This change eliminates the ability to use the previously available \Signal\, \Var\, and \CombineSignal\ APIs for managing reactive state within Laminar applications.
src/main/scala/com/raquo/laminar · high confidence
Behavioural changes
N-ary combine and sample-combine operators with consistent transaction ordering
The \combine\ package introduces N-ary combinators (\CombineStreamN\, \CombineSignalN\, \SampleCombineStreamN\, \SampleCombineSignalN\) that allow combining or sampling multiple streams and signals using a single combinator function, replacing the need for nested binary operations. Additionally, \MergeStream\ now enforces a deterministic emission order for events fired during \onStart\ by prioritizing sources based on their topological rank and argument index, ensuring that simultaneous start emissions are processed in a predictable sequence rather than arrival order.
src/main/scala/com/raquo/airstream/combine · high confidence
New flatten strategies and make-before-break switching semantics
The library introduces a new \flatten\ package containing explicit strategies for flattening observables: \SwitchStream\, \ConcurrentStream\, \SwitchSignal\, and \SwitchSignalStream\, along with their corresponding \FlattenStrategy\ objects. This replaces the previous implicit \flatMap\/\flatten\ approach with explicit \flatMapSwitch\, \flatMapMerge\, \flattenSwitch\, and \flattenMerge\ methods to clarify intent. A key behavioral change is the implementation of 'make-before-break' semantics in \SwitchSignal\ and \SwitchSignalStream\: when switching between inner signals, the previous signal is kept active until the new one is fully started, preventing common ancestor signals from being briefly stopped during transitions.
src/main/scala/com/raquo/airstream/flatten · high confidence
New utility classes and feature flags for migration safety
This release introduces new internal utilities to support the V18 migration and improve robustness. A new \FeatureFlags\ object provides temporary boolean switches (e.g., \V18\_EVENTBUS\_ISSTARTED\_FIX\_155\, \V18\_TRX\_ONSTART\_FIX\_144\) that allow users to revert to pre-V18 behavior if they encounter issues during migration; these flags are deprecated and will be removed in a future version. Additionally, new utility classes \JsPriorityQueue\ and \JsResilientIterator\ are added to handle priority-based ordering and safe iteration over mutable JavaScript arrays respectively, while the \util\ package exposes helper methods like \hasDuplicateKeys\ and \tryOrFailure\ for internal use.
src/main/scala/com/raquo/airstream/util · high confidence
Refactored internal observer and parent-tracking architecture
The internal implementation of signal and stream parent-child relationships has been restructured to improve reliability and reduce overhead. New base traits (InternalNextErrorObserver, InternalTryObserver, InternalParentObserver) standardize how internal observers handle values and errors, while SingleParentSignal and MultiParentSignal now use lazy evaluation and explicit update-ID tracking to prevent synchronization bugs during restarts. This change ensures that child signals correctly sync with their parents and eliminates redundant initial value evaluations, resulting in more predictable reactive behavior.
src/main/scala/com/raquo/airstream/common · high confidence
Refactored map operations into dedicated MapOps trait and MapSignal/MapStream classes
The map-related functionality for EventStreams and Signals has been reorganized into a new \MapOps\ trait and specific implementation classes (\MapSignal\, \MapStream\). This change introduces explicit error recovery logic for mapped observables: if the mapping function or the parent observable throws an error, the system can now optionally handle it via a \recover\ partial function, allowing users to substitute a fallback value, swallow the error, or let it propagate. The \MapOps\ trait defines the standard \map\, \mapTo\, \mapToStrict\, \mapToUnit\, and \tapEach\ methods, while the new classes encapsulate the underlying signal/stream logic and error handling behavior.
src/main/scala/com/raquo/airstream/map · high confidence
Regenerated combine and sample operations for Signals and EventStreams
The generated API files for combining and sampling Signals and EventStreams have been updated to use the Tuplez 0.5.0 library (specifically the Composition type) for handling tuple composition in methods like combineWith, withCurrentValueOf, and sample. This change replaces the previous implicit lookup mechanism with inheritance-based composition, which resolves compile-time regressions associated with N-arity overloads while maintaining the same user-facing combinators for merging up to eight sources.
src/main/scala/com/raquo/airstream/combine/generated · high confidence
Reworked scanLeft and reduceLeft operators with error recovery
The scan and reduce operations on Signals and EventStreams have been restructured to provide better control over error handling. New methods like \scanLeftGenerated\ and \scanLeftGeneratedRecover\ allow users to derive the initial accumulator value from the parent's initial state, while \scanLeftRecover\ and \reduceLeftRecover\ introduce a \resumeOnError\ flag that lets streams recover from exceptions in the combine function by using the last successful value. The previous \foldLeft\ and \foldLeftRecover\ methods are now deprecated in favor of these new, more explicit naming conventions.
src/main/scala/com/raquo/airstream/scan · high confidence
Scala 2.13 compatibility stubs and infix extractor support
This update adds Scala 2.13-specific source files to maintain API parity with Scala 3 while respecting language limitations. The \dynamicImport\ operator is explicitly disabled for Scala 2.13 as it relies on Scala 3's \inline\ feature, resulting in empty trait stubs for \DynamicImportSignalObjectOps\, \DynamicImportSignalOps\, \DynamicImportStreamObjectOps\, and \DynamicImportStreamOps\. Additionally, the \withKey\ and \varWithKey\ extractors are implemented for Scala 2.13 to allow named-key extraction in pattern matches, though they do not support the \infix\ syntax required by Scala 3.9.
src/main/scala-2.13 · high confidence
Test coverage
Added comprehensive error handling tests for EventStream, Signal, and Observer; Added comprehensive test coverage for the flatten package; Added generated tests for combining up to 22 signals and streams; Added test coverage for Airstream extension operators; Added test coverage for combine, merge, and sample-combine behaviors; Added test coverage for core Airstream reactive streams; Added test coverage for ownership and subscription lifecycle; Added test coverage for scanLeft and reduceLeft behavior; Added test coverage for state management components; Added test coverage for timing operators and lazy future evaluation; Added test fixtures for lifecycle and ownership testing; Added test infrastructure and coverage for debugging and async utilities; Added tests for EventBus emission and source wiring behavior; Added tests for FetchStream abort behavior and WebStorageVar; Added tests for distinct stream and signal behavior; Added tests for extending observables from third-party packages; Added tests for split signal functionality; Added tests for split-match macro behavior and API contracts; Added tests for stream filtering, splitting, and side-effect operators; Added tests for syntax conversions and tuple operations; Added unit tests for JsPriorityQueue and JsResilientIterator; Removed experimental Airstream tests.
Dependencies
Upgrade to Scala.js DOM 2.0.0 and Scala 3
The build configuration has been updated to use scala-js-dom 2.0.0 and Scala 3 as the default version, while maintaining cross-compilation support for Scala 2.13. This change also introduces source map generation pointing to GitHub for better debugging in CI environments and configures the test environment to use JSDOM.
(dependencies) · high confidence
Housekeeping
Initial project scaffolding and documentation
This change establishes the foundational structure for the Airstream project by adding essential configuration and documentation files. It includes a .gitignore to exclude build artifacts and IDE settings, a .scalafmt.conf for code formatting, a CODEOWNERS file for repository access control, and a CONTRIBUTING.md guide for developers. Additionally, it adds the LICENSE, README, and CHANGELOG files to define usage terms, project overview, and version history.
(repo-wide) · high confidence
Written by cca.canine.dev from the codebase's own history, inside the signed delivery this page is composed from.
How this codebase got here
Score
- CAI 65 → 64 (-0.7)
- Rubric changed (rubric-2026.10.5 → rubric-2026.11.2) — scores are not directly comparable.
Lenses
- Code Health 66 → 66 (+0.0)
- Architecture 87 → 85 (-1.7)
- Maturity 62 → 62 (-0.3)
- Readiness 60 → 60 (+0.0)
- Security 78 → 70 (-7.5)
- Performance 86 → 86 (+0.0)
Resolved (2)
- Scanner failed to run — not a clean result
- Scanner failed to run — not a clean result
Changes since last survey
- 1 commits — 0 feature/other, 1 fixes
By area
- src/main — 1 commit
Notable commits
- fix: Fix: WebStorageVar syncing could be looking at stale values in case of rapid events.
Written by cca.canine.dev from the codebase's own history, inside the signed delivery this page is composed from.
Survey your own repository
raquo/Airstream was measured the same way every project in this corpus was: the same rubric, at a pinned commit, with the result published in full. Point a surveyor at a repository you know and see whether you agree with it.
About this page
- The score is its most recent published measurement, taken on 6 November 2026 at a pinned commit. It is not a live figure and does not change until the project is measured again.
- Measured at commit c988545d81ed4c42998f5ad41e7b03cb513a46dc — the exact code this score is about.
- Scored under rubric-2026.11.2 — the same rubric and the same method as every other entry in this index.
- Measured by Canine Code Analyzer (cca.canine.dev) using cca measure-2026.11.3+preprod-60d1b390edf0.