+1

New Rails Version and its Features

Every thing in this worlds needs to go under some change to cope up with the rapid changing world. In things related to technology, its a pretty obvious thing. One of the growing web framewok, Rails built on ruby language is not exception. The current Rails version 5 was released in August,2016 with some cool changes to help developers solve any problem easily. So after that three beta version of rails 6 is released. It is expected that rails 6 will be available in Deember, 2019. Lets see some of the changes it will have . Note that Rails 6 will require Ruby 2.5.0+

1. Action Mailbox

Action Mailbox guides incoming emails to controller-like mailboxes for processing in Rails. It ships with ingresses for Mailgun, Mandrill, Postmark, and SendGrid. We can also handle inbound mails directly via the built-in Exim, Postfix, and Qmail ingresses. The inbound emails are turned into InboundEmail records using Active Record and feature lifecycle tracking, storage of the original email on cloud storage via Active Storage, and responsible data handling with on-by-default incineration. These inbound emails are routed asynchronously using Active Job to one or several dedicated mailboxes, which are capable of interacting directly with the rest of your domain model.

2. Action Text

Action Text brings rich text content and editing to Rails. It includes the Trix editor that handles everything from formatting to links to quotes to lists to embedded images and galleries. The rich text content generated by the Trix editor is saved in its own RichText model that's associated with any existing Active Record model in the application. Any embedded images (or other attachments) are automatically stored using Active Storage and associated with the included RichText model.

3. Parallel Testing

Parallel Testing will allow us to parallelize the test suite. While forking processes is the default method, threading is supported as well. Running tests in parallel will reduce the time it takes to run entire test suite.

4. Action Cable Testing

Since Action Cable is used at different levels inside the application, We must need to test both the channels, connection classes themselves, and the other entities broadcast correct messages. Action Cable testing tools will allow us to test the Action Cable functionality at any level: connections, channels, broadcasts.

5. Default Bundler - Webpacker

In rails 6, webpack is going to be a default JavaScript bundler for Rails through the webpacker gem, replacing the previously-default Rails Asset Pipeline and providing for better interoperability with modern JavaScript libraries and coding standards. In short, webpacker is a gem providing integration with webpack and JS package managers such as yarn.

6. New code loader - Zeitwerk

Rails 6 comes up with a brand new code loader for Ruby- Zeitwerk, which is going to replace the classic Rails loader that has been around since 2004. Zeitwerk was built with the intention of getting rid of all the drawbacks of the classic loader, as well as eliminating all known use cases for require_dependency. The new autoloader is also useful for gem or gem-like projects creators. Meet , since it allows any application to have its own independent loader, comprising own configuration, inflector and optional logger.

Also there are some minor changes in active record and other changes that shape up this framwork. You can check that in rails guide

References: https://edgeguides.rubyonrails.org/6_0_release_notes.html


All rights reserved

Viblo
Hãy đăng ký một tài khoản Viblo để nhận được nhiều bài viết thú vị hơn.
Đăng kí