New Features, Rails 5 (and 4!)
What We’re Doing Already
- Spring preloader
- Strong Parameters
- Web console on error screens
What We Can Do Right Now
rakecommands still work but are deprecated, we can now just use
- Bundled secrets: We can encrypt secrets per-environment in the repo, reducing the amount of deploy-time orchestration necessary (and keeping production passwords & API keys out of our AWS images)
- Config/secrets.yml (4.1, don’t use)
- Encrypted Secrets (5.1, don’t use)
- Credentials (5.2, do use)
- Pending Migration Errors: If you have a pending migration in dev, you get an exception screen
- Form helpers:
form_for(154) can now both be replaced by
form_with- they’re not going away (quite yet) but form_with has a much more consistent API.
- ActiveRecord Attributes API: basically, built-in support for logic like our
has_moneyhelper, but for arbitrary or custom data types.
What We Can Do With Work
- ActionMailer previews: lets us define some stub data to render cleanly, and then get a preview in-browser (with multiple variants if needed) - and have a full list of all previews readily available.
- ActiveJob (still using a shim, but now we’re rails5+ we’ve got some better options available to us. GoodJob on Postgres has a good feel in Vault, but we’ll need to manage the migration carefully.
- ActionCable: gives us the ability to easily provide realtime updates to pages - imagine sitting on an invoice screen and then seeing it change status as the customer pays it.
- ActiveStorage: A standard API (pair of models) to code against for file/large blob attachments. Would be useful to move over and replace our own S3 logic, but also to get rid of our legacy filesystem-based attachments (Paperclip) that require us to have a network share.
- System Tests - write capybara directly, use Chrome, get failure screenshots, etc. No cucumber needed.
- Russian Doll Caching: formalize our model hierarchy, set up triggers so object saves lower down propagate timestamps up the tree, and use object ID + timestamp as a cache key. Then we can cache a bunch of things (complex rendering, calculations) with a simple expiration policy.
- Redis Cache Store: Fresh in Rails 5.2, a rails-native adapter for Redis to do the caching.
- Declarative ETags: if we have the above, we can also set up some browser hints to let us avoid entire page loads on our backend for specific resources - think Invoice/Customer details screens.