Talks
Speakers
Events
Topics
Sign in
Home
Talks
Speakers
Events
Topics
Leaderboard
Use
Analytics
Sign in
Suggest modification to this talk
Title
Description
RailsConf 2019 - Rethinking the View Layer with Components by Joel Hawksley _______________________________________________________________________________________________ Cloud 66 - Pain Free Rails Deployments Cloud 66 for Rails acts like your in-house DevOps team to build, deploy and maintain your Rails applications on any cloud or server. Get $100 Cloud 66 Free Credits with the code: RailsConf-19 ($100 Cloud 66 Free Credits, for the new user only, valid till 31st December 2019) Link to the website: https://cloud66.com/rails?utm_source=-&utm_medium=-&utm_campaign=RailsConf19 Link to sign up: https://app.cloud66.com/users/sign_in?utm_source=-&utm_medium=-&utm_campaign=RailsConf19 _______________________________________________________________________________________________ While most of Rails has evolved over time, the view layer hasn’t changed much. At GitHub, we are incorporating the lessons of the last decade into a new paradigm: components. This approach has enabled us to leverage traditional object-oriented techniques to test our views in isolation, avoid side-effects, refactor with confidence, and perhaps most importantly, make our views first-class citizens in Rails. #railsconf #confreaks
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 presentation "Rethinking the View Layer with Components" at RailsConf 2019, Joel Hawksley from GitHub explores a new approach to redefining the Rails view layer by leveraging ideas from React components. He emphasizes the need for adaptation as Rails' view layer has remained largely unchanged over many years despite significant advancements in web development practices. Key Points Discussed: - **Creativity and Innovation**: The concept of creativity is discussed in relation to generating new ideas by reapplying existing ones, setting the tone for the presentation. - **Problems with Current Rails Views**: Hawksley highlights the shortcomings of the traditional Rails view layer, including difficulties in testing, auditing with code coverage, reasoning about data flow, and maintaining basic Ruby standards. Rails views often follow implicit method signatures, making them inconsistent with standard Ruby practices. - **Progressive Enhancement**: He explains GitHub's commitment to progressive enhancement, which allows users in low-powered devices or outdated browsers to interact with the application without relying heavily on JavaScript. - **Comparing Rails and React**: React’s use of components is presented as providing multiple advantages, such as encapsulation of UI elements, straightforward data flow, and simplified isolated testing which is not typically available in Rails views. - **Action View Component**: The introduction of an experimental Rails feature, Action View Component, allows views to be tested in isolation, efficiently and in line with Ruby’s standards, thereby facilitating better code quality and maintainability. - **Examples of Refactoring**: The presenter walks through an example of transforming a hard-to-test Rails view into a component, detailing the steps from setting up unit tests to creating a new badge component. This includes implementing proper validations and simplifying data flow. - **Performance Benefits**: By adopting this new architecture, they achieved significant performance improvements with tests running approximately 240 times faster, transitioning from six seconds for traditional tests to about 25 milliseconds for component tests. - **Implementation and Future Vision**: Hawksley concludes by discussing how GitHub has integrated these components into production with ongoing plans for wider implementation across their view layers, focusing on standardizing UI component rendering. The session emphasizes the importance of evolving Rails' view architecture to improve testing efforts, maintainability, and performance, ultimately fostering a more robust application structure that aligns with modern web practices.
Suggest modifications
Cancel