Paul Krill
Editor at Large

Ruby on Rails 7 rejiggers JavaScript support

news
Dec 16, 20212 mins

Now available in a production release, Rails 7 removes the requirements for Node.js and Webpack, while supporting NPM and ES module imports.

ruby
Credit: Thinkstock

Ruby on Rails 7, the latest version of the web application framework, is now available as a production release. The update embraces a full-stack approach to web development with support for JavaScript advancements.

Released December 15, Rails 7 leverages browser support for the ECMAScript 6 JavaScript standard and ECMAScript modules, wide adoption of HTTP/2, and the import maps standard for importing JavaScript modules. It gives developers a “no-Node” approach to front-end development while still providing access to NPM packages and modern JavaScript. Rails 7 replaces TurboLinks and Rails UJS with Hotwire’s Turbo and Stimulus on the front end.

Most Rails applications will not require Node.js, given the new defaults. Developers can use the JavaScript bundler they prefer, as Webpack is no longer required. The same approach has been taken with CSS bundlers that rely on Node; Rails 7 files require only a compiled application.css file. Bundlers such as Tailwind or Bootstrap can be used.

Rails 7.0 guides can be found at guides.rubyonrails.org. Rails 7.0 release notes are also available at the project website. Other improvements in Ruby on Rails 7:

  • Encrypted attributes have been added to Active Record, enabling applications to offer at-work encryption in addition to traditional at-rest and in-transit coverage. An additional security layer is provided through this improvement.
  • With asynchronous query loading, two unrelated queries can be run concurrently via a controller action.
  • The Zeitwerk code loader replaces the const_missing approach.
  • The Spring application preloader is no longer on by default, as faster computers have made it unnecessary except for the largest applications.
Paul Krill

Paul Krill is editor at large at InfoWorld. Paul has been covering computer technology as a news and feature reporter for more than 35 years, including 30 years at InfoWorld. He has specialized in coverage of software development tools and technologies since the 1990s, and he continues to lead InfoWorld’s news coverage of software development platforms including Java and .NET and programming languages including JavaScript, TypeScript, PHP, Python, Ruby, Rust, and Go. Long trusted as a reporter who prioritizes accuracy, integrity, and the best interests of readers, Paul is sought out by technology companies and industry organizations who want to reach InfoWorld’s audience of software developers and other information technology professionals. Paul has won a “Best Technology News Coverage” award from IDG.

More from this author