Talks
Speakers
Events
Topics
Sign in
Home
Talks
Speakers
Events
Topics
Leaderboard
Use
Analytics
Sign in
Suggest modification to this talk
Title
Description
ViewComponents in the Real World - Joel Hawksley - rubyday 2021 With the release of 6.1, Rails added support for rendering objects that respond to 'render_in', a feature extracted from the GitHub application. This change enabled the development of ViewComponent, a framework for building reusable, testable & encapsulated view components. In this talk, we’ll share what we’ve learned scaling to hundreds of ViewComponents in our application, open sourcing a library of ViewComponents, and nurturing a thriving community around the project, both internally and externally. The ninth edition of the Italian Ruby conference, for the third time organised by GrUSP, took place online on April 7th 2021. Speaker and details on https://2021.rubyday.it/
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
**ViewComponents in the Real World** is a presentation delivered by Joel Hawksley at RubyDay 2021, focusing on how GitHub has utilized ViewComponents to build scalable, reusable, and testable UI components within their Rails application. Joel discusses both the technical aspects of integrating ViewComponents and the cultural implications of fostering a developer community around these components. **Key Points Discussed:** - **Introduction to ViewComponents:** - ViewComponents emerged from the need to manage complex UI in GitHub’s large Rails monolith, which handles tens of thousands of requests per second and contains over 4,700 views. - ViewComponents enable a structured way to create reusable components similar to React components in a Ruby on Rails environment. - **Scalability Challenges:** - Scaling an application creates challenges, such as identifying which templates render certain parts of a page. To overcome this, GitHub implemented a custom ERB compiler that adds HTML comments to templates, indicating their source. - Visual changes often require more robust testing than unit tests provide; therefore, Joel’s team created a system test conversion module to improve testing efficiency. - **Development Tools:** - A tool named **ViewFinder** was developed to map out how templates reference each other, helping developers understand the dependencies and potential impacts of their changes. - Joel emphasizes that defining clear components helps enforce UI consistency across the application, making UI updates more seamless. - **Performance Improvements:** - ViewComponents help minimize database queries and increase performance by enforcing the understanding of how view logic interacts with the database. This can prevent unnecessary queries and improve efficiency. - **Community Engagement and Open Source:** - The team open-sourced their **Primer ViewComponents library**, which gained significant interest and contributions from the community, leading to lessons on empathy and accessibility in documentation and contribution processes. - **Future Directions:** - There are ongoing discussions on improving caching mechanisms in ViewComponents and adapting practices from contemporary frameworks like React. Joel emphasizes the importance of continuous innovation to keep Ruby and Rails relevant in a rapidly evolving tech landscape. **Conclusion:** Joel's presentation illustrates that adopting ViewComponents at GitHub has led to significant growth in component usage, improved consistency in UI design, better testing strategies, and heightened performance. The community-driven approach to open sourcing these components has fostered a collaborative and innovative environment, benefiting both GitHub and the wider development community.
Suggest modifications
Cancel