Talks
Speakers
Events
Topics
Sign in
Home
Talks
Speakers
Events
Topics
Leaderboard
Use
Analytics
Sign in
Suggest modification to this talk
Title
Description
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.
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
In the talk "ViewComponents in the Real World" by Joel Hawksley at RailsConf 2021, the speaker discusses the implementation and scaling of ViewComponents at GitHub, emphasizing their significance in enhancing the design system and the overall Rails application architecture. **Key Points:** - **Introduction of ViewComponents:** - Launched with Rails 6.1, allowing for reusable, testable view components. - Developed in response to challenges encountered in GitHub's extensive monolithic Rails application, which serves tens of thousands of requests per second and features complex UI components. - **Challenges Faced:** - Difficulty in tracking templates and their usage in a large codebase. - Managing state during local development for testing visual changes. - Identifying template relationships and usage caused friction during modifications. - **Solutions Implemented:** - **Template Annotations:** Implemented custom HTML comments with template paths in the output to identify which template rendered which part of a page, later incorporated into Rails. - **Testing Improvements:** Developed a method to convert controller tests into system tests to ease visual change verification. - **Viewfinder Tool:** Created to trace template usage across the codebase employing static code analysis, aiding developers to understand template relationships and streamline testing. - **Adoption of ViewComponents:** - Introduced a component-based architecture inspired by React, improving consistency in the UI by preventing visual inconsistencies through reusable components. - Developed tools to measure and enforce performance standards within view code, notably reducing database queries linked to rendering views. - **Mailers and Complex Layouts:** - Developed specific view components for constructing complex HTML emails, streamlining adherence to modern HTML standards without legacy issues. - **Communication Strategies:** - Emphasized the role of documentation, linters, and community engagement in improving the organizational rollout of components. - Utilized automated tools to ensure developers consistently use the right components, facilitating easier onboarding and contributions. - **Open Source Contributions:** - The importance of community engagement in refining the ViewComponent library, leading to valuable lessons in documentation and contributions from a diverse range of developers. **Conclusions:** Hawksley concludes that continuous innovation within Rails is crucial for maintaining its relevance, urging developers to actively contribute and improve frameworks, reflecting on the importance of adopting new technologies for long-term success. Overall, the talk provides insights into the practical application of ViewComponents at GitHub, showing how they enhance design efficiency, improve testing practices, and contribute to a robust development culture.
Suggest modifications
Cancel