DEV Community

Discussion on: 3 reasons why I went framework agnostic and why you should do that too

Collapse
 
gklijs profile image
Gerard Klijs

It's not really new, but web components are currently properly supported by the major browsers. So it's useful now. One of the caveats is global state. For example if you have an application where you have some profile data stored in de backend. And almost all the components need part of that data. But you could have a web component for that. But having dependencies on other components complicates things.

Collapse
 
stefannieuwenhuis profile image
Stefan Nieuwenhuis

I think managing global state is rather an architectural challenge and not so much about web components. Every application, unregarding the framework used, has to deal with a global state in one way or another and every framework or library has its own solution for it. Just take a look at Redux, RxJs, NgRx or Vuex and all the different patterns (for example the Container Components pattern in React) invented to handle (global) state effectively.

Thread Thread
 
cristinaruth profile image
Cristina Ruth

Agreed. Global state is tricky indeed. Then you add in backend and persistence and it becomes more complicated.

Thread Thread
 
raduab profile image
Radu

there's a promising state management library at sam.js.org. It is inspired and follows the semantics of the Turing Award winner Dr. Leslie Lamport's TLA+. It is also framework agnostic. You should check it out!