Jets 5 is a massive release. I started it a few months ago, and it just snowballed. Almost every line of the Jets core source code was touch. I think users will be thrilled with the Jets 5 results.

Single Lambda Function for Controllers

This is one of the biggest changes about Jets 5. Jets now deploys a single Lambda function that handles Jets Controller requests. Working with a single Lambda function for controllers simplifies debugging. The newly introduced jets logs takes advantage of this and can be used to tail logs from CloudWatch in your terminal. A single Lambda function also helps with prewarming.

Jets Jobs still have a discrete Lambda function per Ruby method since they can be connected to individual Event Rules.

Router Improvements

Similarly, Jets now deploys an API Gateway with essentially a single proxy route. Technically, there are 2 routes, one for the root level and a catchall route, but it’s simpler to think about it as a single endpoint.

This enables Jets to write a more powerful Router than APIGW. Jets can get around APIGW limitations like the “Sibling Variable Limit” problem.

The Jets Router is also more closely “compatible” with the Rails Routing engine. This makes it easier to write gems like kingsman, which is a port of devise. Yes, there’s an authentication solution for the Jets now, and it’s called Kingsman.

Jets Engines

Jets Engines comes into existence with Jets 5. A Jets Engine is very similar to a Rails Engine. It’s essentially a port of it. Studying the Rails Engines source code for this was a trip. The Rails Engine source code is a beautiful piece of work.

Jets Engines allows you to hook into the Jets initialization process and write extensions. Many plugins were written as a part of this. Here are some of them:

Interestingly, the Engine initializer ability helps abstract and decouple things like database initialization. This makes Dynomite and ActiveRecord completely optional for a Jets app.

Controller Improvements

Jets Controllers are also improved. I took a completely different approach with controllers this time. Essentially, I’m making Jets Controllers “ActionController and ActionView compatible”. Thanks to the approach, I was able to add support for:

  • around filters
  • cache control and etag caching support
  • content security policy
  • cookies support via actionpack
  • flash support
  • forgery protection improvements
  • importmap support
  • i18n support

Boom! That’s a lot of great features.

CloudFormation Improvements

I completely refactored the CloudFormation builders. It writes to friendly template names now. Internally, the logical ID and property names have all been converted to CamelCase format. It’s much easier to work with the Jets code when it’s all CamelCase on the inside. We can easily search for the CamelCase version that matches the AWS CloudFormation documentation. This is a huge deal for those familar with CloudFormation who want to debug and investigate.

Users can still use Ruby conventional underscore casing from the outside in their Jets app. Jets converts fields to CamelCase correctly early on during the processing phase.

Jets Pro

As a part of Jets 5, Jets Pro has been improved to support:

  • Release History: See your release history with the web browser or with the jets releases CLI command.
  • Rollback Ability: Rollback your app if needed.

To see your release history:

jets releases

To rollback

jets rollback VERSION

Jets Docs

The Jets Docs site has been improved. There are gentle learn guides for 3 the different modes:

There’s also additional detailed docs.

  • Kingsman: Authentication Solution.
  • Dynomite: DynamoDB ActiveModel Compatible Library.
  • HowTos: New HowTos Section.

Jets Upgrade Tool

I’m also introducing a separate jets-upgrade tool. This tool rewrites your Jets project source code to work with Jets 5. Of course, accounting for all cases and Jets apps is unfeasible. This script cannot perform miracle upgrades. It’s a best-effort script, and the hope is that this script gets you pretty far and is helpful. 😄

Summary

There are so many improvements that a blog post won’t do it justice. I’m happy that it’s finally out. Take Jets 5 for a ride and enjoy! 🎉