
The first update of Rails 8 has been released and it brings a whole lot of features and improvements as always. The new version is built on Rails 7.2 providing optimizations for a faster and hassle-free development.
Some of the key features of the update includes Authentication, Propshaft, Solid Trifecta, Thruster and Kamal 2.
Authentication
Rails 8.0 enables basic authentication with a single command, which automatically generates all the necessary files for handling authentication system using database-tracked sessions and password reset.
The code for generating
bin/rails generate authentication
It will generate
app/models/current.rb
app/models/user.rb
app/models/session.rb
app/controllers/sessions_controller.rb
app/controllers/passwords_controller.rb
app/mailers/passwords_mailer.rb
app/views/sessions/new.html.erb
app/views/passwords/new.html.erb
app/views/passwords/edit.html.erb
app/views/passwords_mailer/reset.html.erb
app/views/passwords_mailer/reset.text.erb
db/migrate/xxxxxxx_create_users.rb
db/migrate/xxxxxxx_create_sessions.rb
test/mailers/previews/passwords_mailer_preview.rb
Propshaft
After 15 years of service, the old rails Sprockets system is replaced by a new asset pipeline called Propshaft. The purpose of introducing Propshaft is mainly to take advantage of modern day JavaScript and browser improvements.
Propshaft is a more simple and advanced method that avoids unnecessary tasks to keep the asset pipeline clean. Unlike Sprockets, Propshaft provides a straightforward path for assets and adds digest stamps for caching.
Solid Trifecta
Rails 8.0 came up with three new backend adapters named Solid Cable, Solid Cache, and Solid Queue. It removed the dependency of using various drives for queues, jobs and cache.
Solid Cable
Solid Cable as the default Action Cable adapter in production, configured as a separate queue database in config/database.yml. This makes it possible to drop the common dependency on Redis, if it isn’t needed for any other purpose. Despite polling, the performance of Solid Cable is comparable to Redis in most situations. And in all circumstances, it makes it easier to deploy Rails when Redis is no longer a required dependency for Action Cable functionality
Solid Queue
Solid Queue as the default Active Job backend in production, configured as a separate queue database in config/database.yml. It is a DB-based queuing backend for Active Job, designed with simplicity and performance in mind. Besides regular job enqueuing and processing, Solid Queue supports delayed jobs, concurrency controls, recurring jobs, pausing queues, numeric priorities per job, priorities by queue order, and bulk enqueuing.
Solid Cache
Solid Cache as the default Rails.cache backend in production, configured as a separate cache database in config/database.yml. It is a type of cache storage that uses a database to store data instead of relying on memory-only options like Redis or Memcached. This allows you to keep a much larger cache because modern SSD drives are fast enough that accessing data from disk doesn’t slow things down much compared to using RAM. In short, it’s often better to store a large cache on disk rather than a small one in memory.
Streamlined Deployments with the Power of Kamal 2 and Thruster
The deployment has always been a headache for developers, that’s why many use PaaS platforms for an easy, fast and secure deployment.
Rails 8 comes ready with Kamal 2, a tool that makes it easy to deploy your app anywhere, whether on a cloud server or your own hardware. Kamal can take a new Linux server and turn it into a working application or support server with just one command: “kamal setup.” All you need are the server’s IP addresses and your SSH key set up, and you can have your app running in production in less than two minutes.
We’re a web and mobile app development company, passionate about turning ideas into scalable digital solutions. Whether you’re launching a new product or enhancing an existing one, our team can help you bring it to life. Let’s build something great together!
📩 Reach out to us at [email protected]