Moving from Rails to Vue Saved Me Headaches — and $84/Year

The fairly extensive Ruby gem was replaced with a JavaScript code library weighing in at around 200 lines.In the Rails app, all the number crunching took place server-side..Naturally, this was reversed in the Vue app, and all the calculations happen on the client..There is no app server, just plain old web servers serving static files from a CDN..This could result in tremendous cost savings should the app scale, because the computational heavy-lifting is delegated to the client device it’s running on..This works because the calculations aren’t too intense, and I’m not worried about revealing trade secret algorithms.One thing that’s sorely lacking?.Tests!.I manually tested the code as I went, comparing results produced by the two apps until I was satisfied I’d achieved behavioral parity..I took a break from TDD for this exercise because of the exploratory nature of the migration project..Now that I’ve got a working prototype in place, the purist in me demands a TDD rewrite..The pragmatist is okay with a test-last approach.Step 5: Add PagesOut of the box, Vue builds Single Page Apps (SPA)..If you have multiple pages, you’ve got to add routing..The Rails app sported an About page, and the runner’s prescribed pace is also displayed on its own page.. More details

Leave a Reply