Ruby on Rails 7 revises support for JavaScript

0

Ruby on Rails 7, a planned upgrade to the 17-year-old web application framework, has moved to an alpha stage, with a new mechanism for writing JavaScript in Rails.

Exceed the Webpacker Tool To bundle JavaScript, which Ruby on Rails has been using for five years, Rails 7 takes a knotless approach, without having to forgo NPM packages. This approach takes advantage of advancements in browser support for ECMAScript 6, JavaScript modules, HTTP / 2, and the Import maps for rails tool to import JS modules.

Additionally, with the replacement of TurboLinks and Rails UJS by the Stimulus JS framework and the Turbo Tool to reduce the need for custom JS, Rails now has a full front-end configuration for writing Rails applications. It is not necessary to manage node dependencies in node_modules, with bundler configurations, or with other common JavaScript development challenges, depending on a September 15 Bulletin announcing the alpha version.

Rails developers have also improved the integration between Rails and JavaScript + CSS bundlers. Companion Gems that can be triggered through the new Rails -javascript[bundler] and -css[bundler] allow the start of a new application or the modification of one that begins by importing maps to be used Esbuild, Rollup.js, Webpack, and other technologies.

Instructions for getting started with Rails are available at guides.rubyonrails.org. Other additions and changes in Rails 7.0:

  • Encrypted attributes have been added to Active Record, allowing an application to offer encryption at work in addition to traditional coverage at rest and in transit. This provides additional security.
  • Asynchronous query loading to run queries in parallel.
  • The Spring for Rails app preloader is no longer enabled by default, as faster computers have made it less relevant.
  • ActionController::Live#send_stream makes it easy to stream generated files on the fly in controller actions.
  • Active storage now uses the safest and fastest libvips as its default variant processor.
  • Parallelized tests now compare a number of processor cores to a number of tests and scale the parallelization accordingly.

Copyright © 2021 IDG Communications, Inc.


Source link

Leave A Reply

Your email address will not be published.