Tad Thorley, Developer

Writings and such

Modest Vue For the HTML You Already Have

Stimulus has a description top and center of its home page: “A modest JavaScript framework for the HTML you already have.” By “modest” I think it is claiming that: it won’t take over your routing, it won’t bury its view code deep in JavaScript code, it can be applied to the pages you choose (and won’t affect the pages that you don’t), etc. By “HTML you already have” I think it is claiming that you can take an HTML-first approach; you can write your HTML and then “sprinkle” in some JavaScript functionality later.

...

Writing Stimulus Sold Me On Vue

For the past 3 years I had been working on a Rails app with an Angularjs 1.5 front-end (SPA); I didn’t love it. It was much more complex than it needed to be. Our front-end permission management was CanCan implementd for the front-end that would interpret our backend’s CanCan permission object passed to it as JSON. The routing rules used a lot of regular expressions. The pages had deeply nested Angular controllers. The Angular templates were dozens and dozens of Rails view partials buried deep inside various directories. I would often fantasize about deleting the whole thing and replacing it with straightforward HTML. Most of the functionality would have been the same.

...

Using and Customizing Ant Design with Rails 6

Ant Design is an incredibly thorough design system with a lot of useful React components. The trick is that all of the CSS is generated with Less and there are no plans to support Sass or anything else. Less support is really poor in the Rails community right now; the gems are largely abandoned. If you want to customize Ant Design with a Rails project you need to do it via Webpack.

...

Converting SQL Queries to Arel

My big project at work this year is to upgrade our codebase from Rails 4 to Rails 5 (and hopefully Rails 6 if we have time). The biggest obstacle is that we rely heavily on the Squeel gem; a gem that was abandoned 5 years ago and isn’t compatible with Rails 5. There is a newer alternative called Baby Squeel that doesn’t tie into the internals of ActiveRecord, but it is also undermaintained. My team concluded that our best option is to rewrite everything using only ActiveRecord and the Arel that underlies it. Unfortunately, I’ve found that Arel is underdocumented, so I’m sharing my findings here.

...

An Analog Clock in DragonRuby

I’ve been a fan of DragonRuby since its release. I’ve been programming for a while, but I’m not familiar with game programming. I’ve been creating small projects for myself to explore and learn. This time I decided to make a simple analog clock with labels for the ordinals and lines for the second, minute, and hour hand.

...

So I Wanted to Put Code in My Blog

I have been thinking about (re)starting a technical blog. I was looking at an old blog and I was reminded of my biggest frustration with blogging: I hate how blogging platforms handle code. As a developer, I want to share code in most of my posts and it always feels awkward. I would often just create GitHub gists to bypass the platform altogether.

...