thoughtbot / superglue

A productive library for Classic Rails, React and Redux
https://thoughtbot.github.io/superglue/
MIT License
327 stars 8 forks source link

Mark fragments as experimental #48

Open jho406 opened 2 months ago

jho406 commented 2 months ago

Fragments in Superglue is a simple way to help identify and mutate cross cutting concerns.

For example, a shared header, if marked as a fragment, will get updated across pages in the cache automatically, if that page header changes. This means that today, a fragment is duplicated across all pages, and updating is a process of iterating through the cache and making changes.

I haven’t used this feature extensively yet, and i’m unsure of its effectiveness. There may also be better ways of modeling this in redux. Maybe a fragment node somewhere in the tree and having a selector that takes the fragment and insert it in the page state. This way, we only have one source of truth. That would be nice, but that also conflicts with digging since we need the complete tree to mutate the page state.

Anyway, I think its worth marking it in the documentation as a experimental feature.