Talks
Speakers
Events
Topics
Sign in
Home
Talks
Speakers
Events
Topics
Leaderboard
Use
Analytics
Sign in
Suggest modification to this talk
Title
Description
Prettier was created in 2017 and has since seen a meteoric rise within the JavaScript community. It differentiated itself from other code formatters and linters by supporting minimal configuration, eliminating the need for long discussions and arguments by enforcing an opinionated style on its users. That enforcement ended up resonating well, as it allowed developers to get back to work on the more important aspects of their job. Since then, it has expanded to support other languages and markup, including Ruby. The Ruby plugin is now in use in dozens of applications around the world, and better formatting is being worked on daily. This talk will give you a high-level overview of prettier and how to wield it in your project. It will also dive into the nitty gritty, showing how the plugin was made and how you can help contribute to its growth. You’ll come away with a better understanding of Ruby syntax, knowledge of a new tool and how it can be used to help your team.
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 "Prettier Ruby" presented by Kevin Newton at RubyKaigi Takeout 2020 focuses on the integration of the Prettier code formatting tool with the Ruby programming language. Prettier, initially created for JavaScript, has expanded its capabilities to support numerous languages, including Ruby. This talk provides a comprehensive overview of how Prettier operates, particularly its Ruby plugin, which has garnered significant usage and is continually developed. The session highlights several key points regarding Prettier's functionality and benefits to developers: - **Introduction to Prettier**: Prettier serves as a language-agnostic formatter that employs language-specific parsers to standardize code formatting across various programming environments. - **The Ruby Plugin**: The Ruby plugin acts as both a Ruby gem and a Node module, enabling Ruby formatting through Prettier, and demonstrates consistent usage with approximately 20,000 weekly downloads. - **Processing Ruby Code**: It begins by converting Ruby code into a concrete syntax tree, retaining comments and their positions, to establish a structured intermediate representation that allows Prettier to format the code correctly. - **Utilization of Ripper**: Ripper as a Ruby standard library is used to generate the syntax tree, while additional information about comment positions and specific formatting elements is appended. - **Example Demonstration**: Newton illustrates the formatting processes using a poorly formatted Ruby code snippet, showing how Prettier transforms it into a more readable format by constructing the necessary intermediate representations while preserving code meanings and comments. - **Handling Specific Constructs**: The presentation addresses JavaScript and embedded capabilities, showing how Prettier can handle Ruby code within other formats like HTML or Markdown, ensuring uniform formatting across languages. - **Configuration Philosophy**: Prettier aims to minimize configuration options to reduce debates on coding standards, utilizing community feedback for enhancements while maintaining a consistent formatting approach across programming dialects. - **Future Plans**: Newton discusses ongoing work to enhance the plugin's performance and features, including support for recent Ruby syntax introduced in version 2.7, and encourages contributions from the community. In conclusion, the session effectively outlines Prettier's capabilities, especially in the context of Ruby, demonstrating its utility in streamlining code formatting and improving workflow efficiency for developers. Newton encourages viewers to engage with the Prettier community and contribute to its ongoing enhancement efforts.
Suggest modifications
Cancel