Talks
Speakers
Events
Topics
Sign in
Home
Talks
Speakers
Events
Topics
Leaderboard
Use
Analytics
Sign in
Suggest modification to this talk
Title
Description
#rubyconftw 2023 Component Driven UI with ViewComponent gem The View layer is the messiest part of a Ruby on Rails application. Developers are confused about where to put logic. Should it be in the model, presenter, decorator, helper, or partial? ViewComponents, developed by GitHub simplifies the View layer and makes it much easier to manage.
Date
Summarized using AI?
If this talk's summary was generated by AI, please check this box. A "Summarized using AI" badge will be displayed in the summary tab to indicate that the summary was generated using AI.
Show "Summarized using AI" badge on summary page
Summary
Markdown supported
The video titled "Component Driven UI with ViewComponent gem" presented by Radoslav Stankov at RubyConf Taiwan 2023, discusses strategies for managing complex view layers in Ruby on Rails applications using the ViewComponent gem developed by GitHub. Stankov shares his experiences from developing a project called "Angry Building," aimed at enhancing facility management through efficient operations, while emphasizing the importance of minimizing complexity in the architecture across both front-end and back-end technologies. **Key Points Discussed:** - **Architectural Experience**: Stankov's journey began with eight years in a dual architecture environment using Ruby on Rails and GraphQL on the back-end, and React on the front-end. - **Challenges with Views**: He highlights the confusion and complexity surrounding Rails views, which often contributes to disorganization in the application structure, particularly the inefficacies of Rails helpers and the views folder. - **Introduction to ViewComponent**: Stankov introduces ViewComponent as a solution for creating reusable and testable components that simplify view management in Rails applications. - **Features of ViewComponent**: Notably, the gem offers slots for dynamic content handling and a preview system for visual layout before actual implementation, significantly reducing setup time compared to React frameworks. - **Component Usage Guidelines**: He advises on a checklist approach for extracting components, suggesting that common use cases involve UI shared across different controllers or complex HTML generation. - **Avoiding Over-Complexity**: Discussion on when to avoid creating components, such as for single-use helpers, straightforward HTML without logic, and the risks of deep nesting can enforce clarity. - **Practical Application**: Stankov stresses the importance of ensuring components remain straightforward and enhance user interactions while maintaining system integrity and reusability of the codebase. **Conclusions and Takeaways**: Stankov concludes by reiterating the benefits of adopting a component-driven approach using ViewComponent to streamline development processes in Rails. He conveys an eagerness to foster discussions on the implications of using this gem effectively in real-world situations and encourages questions from the audience in a follow-up Q&A session. The session addressed various tools in the ecosystem, nesting challenges, and rendering techniques, enriching the dialogue around component management in Rails development.
Suggest modifications
Cancel