3 ms·
This isn't meant as a contradiction of your point, but there are plenty of ways to use component-based architectures with server-side rendered apps, too, like G
by aaronbrethorst 4y ago
This isn't meant as a contradiction of your point, but there are plenty of ways to use component-based architectures with server-side rendered apps, too, like GitHub's ViewComponent gem for Rails. https://viewcomponent.org https://viewcomponent.org
Also, I'd go so far as to say that if you're not using a component based architecture for your web app's view layer, you're creating a ton of extra work for yourself.
- cgarvis 4y ago+1 Using it in a Elixir/Liveview app. Using phx_component_helper has made making those components really easy. https://phx-component-helpers-demo.onrender.com https://phx-component-helpers-demo.onrender.com
- inopinatus 4y agoI’d add you don’t even need ViewComponent. Layouts, partials, variants, and helper functions provide plenty of heavy lifting options when it comes to refactoring your HTML. My take on ViewComponent: it’s what helper functions become when they grow up into proper objects. Great for larger projects, may be more infrastructure than necessary for smaller ones, adopt incrementally when they seem compelling.
- aaronbrethorst 4y agoDon't need it, but I've found ViewComponent to be a big win over partials. Being explicit with the available state instead of implicit has helped me catch plenty of bugs.
- Vinnl 4y agoYep exactly, and Tailwind does indeed still make sense with that approach!