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: trueChangeDetectionStrategy.OnPush- Signal-based
input()andoutput()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
SynapseUiModulefor one-line import of all components (by design — tree-shaking priority).
Alternatives Considered
| Alternative | Why rejected |
|---|---|
| NgModule + standalone dual export | Doubles maintenance; modules are deprecated path |
| NgModule only | Against Angular direction; worse DX for modern apps |
| Minimum Angular 17 | Still behind current; no compelling reason to support older |