Ruby on Rails 7, the latest iteration of the popular web application framework, has officially been released for production use as of December 15. This version marks a significant shift towards a full-stack approach, embracing the latest advancements in JavaScript while streamlining front-end development. With its focus on modern web standards, Rails 7 provides developers with a more flexible and efficient toolkit for building web applications.
One of the major updates in Rails 7 is its enhanced JavaScript support, which leverages browser-native features like the ECMAScript 6 standard and ECMAScript modules. This means developers can now work with modern JavaScript without relying heavily on external tools like Node.js. Rails 7 also takes advantage of HTTP/2 and the import maps standard, enabling efficient management and importing of JavaScript modules directly in the browser. This “no-Node” approach to front-end development simplifies workflows while still allowing developers to tap into NPM packages and modern JavaScript features.
In addition to these updates, Rails 7 introduces changes to the front-end framework by replacing TurboLinks and Rails UJS with Hotwire’s Turbo and Stimulus. These new tools enhance the user experience by offering more seamless interactions and better integration with the server-side code. The switch to Hotwire allows for more dynamic and responsive applications without the need for complex JavaScript frameworks, making development simpler and more efficient.
Perhaps one of the most significant changes in Rails 7 is its approach to bundling. With the new defaults, most Rails applications will no longer require Node.js, freeing developers from the need to use Webpack for JavaScript bundling. Similarly, Rails 7 takes a simplified approach to CSS bundling, requiring only a compiled application.css file. Developers can now use bundlers like Tailwind or Bootstrap without being tied to Node-based tools, offering greater flexibility and customization in their front-end workflows.