Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
basic draft for actionview-component integration
- Allows updating of specific component without replacing entire dom - could also work without components with selector argument - in the future, probably a new class that can be subclassed can be made available like StimulsComponent or so. - For now, the Reflex class must implement the rendered_component and selector methdos, though selector can be left to nil if the entire body is to be replaced
- Loading branch information
91f855b
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This very looks promising! Have you run any benchmarks to see if/how this improves performance? We should see some savings with server rendering, data size over the wire, and less work on the client. Would be great to quantify the savings.
I'm also wondering if we could consolidate the internal API rather than use forking the logic. Default behavior would treat the entire page as the default component with a default selector of
body
. Then users could override for partial page updates. Thoughts?91f855b
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the feedback!
I had not even thought of benchmarking, since it was not my main concern, but good point, of course this will be a concern. I already went a little bit ahead from this commit, so I think in order for us to have a meaningful discussion I'll rig up a pull request (please don't feel any pressure at all that this should someday be merged, more as a conversation vehicle). I think my use case was pretty specific, and there I got what I wanted, but it might need some elaboration.
About keeping the API consistent: totally agree! My only doubt is where/how do you hook in the "selector" concept in a nice way, that's what I am not yet sure about. Anyways, let's continue in the PR.