Skip to main content

ADR 002: Standalone Angular Components Only

Status: Accepted
Date: 2026-05-23

Context

Angular has transitioned fully to standalone components as the default pattern (v19+, reinforced in v21). Synapse UI is a greenfield library targeting the latest stable Angular (21.x).

We must decide whether to ship components as standalone or wrap them in NgModule for backward compatibility with older Angular apps.

Decision

All Synapse UI components will be standalone only. No NgModule wrappers will be provided or maintained.

Every component will use:

  • standalone: true
  • ChangeDetectionStrategy.OnPush
  • Signal-based input() and output() APIs

Consequences

Positive

  • Aligns with Angular's current and future direction.
  • Simpler consumer imports: imports: [AiPromptBarComponent].
  • Better tree-shaking — no module indirection.
  • Cleaner Storybook setup (no wrapper modules).

Negative

  • Consumers on Angular 14–17 must upgrade to use the library (acceptable — we target latest).
  • No barrel SynapseUiModule for one-line import of all components (by design — tree-shaking priority).

Alternatives Considered

AlternativeWhy rejected
NgModule + standalone dual exportDoubles maintenance; modules are deprecated path
NgModule onlyAgainst Angular direction; worse DX for modern apps
Minimum Angular 17Still behind current; no compelling reason to support older