sprockets > webpacker > sprockets > esbuild > importmaps
paperclipintegrations - ditch
active storagewill always take 5x longer than you ever thought possible
turbolinkscan mess with any inline JS littered in views, rewrite as turbo-friendly
stimuluscontrollers if you can
cdn-urlscripts in layouts/views - eg:
bootstrap nodepackage. Which one is in use? Why both? Who wrote this…?
rails diffis your friend https://railsdiff.org/126.96.36.199/7.0.6
rails-new-outputis your even bester friend https://github.com/railsdiff/rails-new-output
/config/initialisersonce you’ve set their version in
raketasks that can mess up your data. Less code to maintain
attr_encryptedonce you hit rails 7.0. Migrate your 2FA keys
configgem - use
envvars for things that need changing without a full deploy (I’m looking at you Heroku), or things managed by 3rd party apps (eg
envspecific creds where applicable
aws sdkif you are only need s3 - use the s3 specific gem
httpartyfor simple api interactions, instead of including a huge buggy gem, at the cost of having to maintain the api url versioning yourself
wkhtmltopdfon heroku? There’s a
wkhtmltopdf-herokuspecific gem that works
faker- should only be a few differences to fix
pagy> all other pagination gems
punditis great for locking down granular access to things
phonelibis great for phone/mobile sanitise/formatting
pg_searchis handy for
postgresfull text search
papertrail(saas) - tracking changes like audited vs online log storage
coffee-rails, use an online service to decaffinate
yui-compressoretc once you have
webpackerpackaging the FE
letter_openeris your friend on local dev. If you absolutely must test on an smtp server, add some sandbox email intercepting so you don’t email real people. Friends don’t let friends spam. But you use obfuscated data, right?
npm- should have a
yarn.lockin the root
nodeversions 10>12>14>16>18>20 up to the oldest your hosting platform supports - new ones are always fiddly and will probably make you sob uncontrollably.
openssl 1.1.1, and can’t go above
node 18/20without using the
openssl-legacy-providernode option - sorted in ruby 3.1 which uses
therubyracergems as you have
purgecsscan help remove unused css - but sometimes it gets it wrong, add exceptions to
bower. Move them to
.node-versionin the root - if you don’t, travis will assume the latest for it’s ubuntu version, which may throw errors around
ubuntu 22 / jammyfor >= ruby 3.1 apps - no
ubuntu 20 / focalfor node 20, but with
postgres 15, you’ll have difficulties trying to get it working. Just use
postgres 12in your travis config and save hrs of fucking around which you know in your heart of hearts you’ll never get back. In celebration of the time you’ve just saved, plant a garden or do something nice.
heroku-20 / focalfor apps < ruby 3.1
heroku-22 / jammyfor apps >= ruby 3.1
stdoutand let heroku manage the logs - and maybe pipe to
papertrailfor a better ui
If you’re stuck on a Rails upgrade, give us a shout! If you’d like to complain about the mixing up of metaphors, lame movie references, or anything that’s rustled your jimmies please head over to our Linkedin and leave a complaint there. We value the feedback.
Most Rails update guides are just sad regurgitations of rubyonrails.org guides.
Not this one.
Make a cup of tea, strap yourself in and get ready - this is the unvarnished, definitive guide. We've already wasted all the time there is and been down all the rabbit holes there are, so you don't need to!
So nice. 👍
18 Sep 2023