5 ms·
The future of Rails front-end is hybrid
- deleted 2y ago[deleted]
- graypegg 2y agoOne pattern I’ve now seen succeed a few times is wrapping the react-y parts of your application into web components. That does NOT mean exposing every component as a web component, NOR building everything with web components. Rather, use it as a bridge between Rails and React. Rails just needs to put the tag onto the page to spawn frontend magic. Your teams can deploy a simple JS bundle on S3, so they can still make deployments without changes to the Rails side of things. This also allows Hotwire to spawn a react component, since it just needs to refer to a web component’s tag as well. I’ve seen it work nicely a few times now!