Pinia Disaster class
summary
Pinia reaches four years and lessons are concrete: avoid externalizing state out of the state function because it shares instances and breaks SSR and devtools; don’t use readonly wrappers that prevent time travel and plugin inspection; stop casting {} as Interface — that yields silent runtime errors, use ref/Ref generics or explicit unions instead; prefer refs over reactive arrays to avoid disconnected state when reassigning; treat route or browser APIs as the source of truth for global IDs and use stores as composable singletons, not a catch‑all.
AI-written summary · about
