It's interesting, working on projects in React, Svelte, and Blazor, to see the common pitfalls and patterns which pervade all of them.
By far and away the biggest/most common pain point is state management.
Where to put state, how/when to share it, how much state to keep on the client vs server/db
By far and away the biggest/most common pain point is state management.
Where to put state, how/when to share it, how much state to keep on the client vs server/db
Comments
In general I try to limit how much state lives in the frontend in the first place.
I then tend to break the UI down into smaller components with their own state where possible.
React Context, Svelte Stores (in Svelte 4), Blazor cascading parameters, custom services/functions/classes fit the bill here.
Can also be challenging to keep tabs on what depends on that shared state.
It's also why I'm a fan of Blazor's 'static' server-side rendering (well, apart from the name!) for some types of app.
It actively prohibits keeping track of state in the client, because there is no client!
Naming things is hard.
Great stuff.
https://github.com/TimeWarpEngineering/timewarp-state