David Heinemeier Hansson Avatar

David Heinemeier Hansson

David Heinemeier Hansson gist.github.com

A peek inside HEY's Gemfile đź‘€

DHH posted a gist sharing HEY’s Ruby dependencies for the curious. It’s a pretty stock Rails app with MySQL (?!) and Redis stores, Elasticsearch, and a few other niceties. One line that caught my eye was:

gem 'turbo', github: 'basecamp/turbo'

That points to a private repo, so there will probably be some new open source turbolinks stuff here real soon. Anything else in this Gemfile catch your interest?

David Heinemeier Hansson Signal v. Noise

Designing for the web ought to mean making HTML and CSS

DHH shared his thoughts on The Great Divide. After all, the web IS just…HTML, CSS, and JavaScript…

…as The Great Divide points out, regression is lurking, because the industry is making it too hard to work directly with the web. The towering demands inherent in certain ways of working with JavaScript are rightfully scaring some designers off from implementing their ideas at all. That’s a travesty.

At Basecamp, web designers all do HTML, CSS, and frequently the first-pass implementations of the necessary JavaScript and Rails code as well! It means they get to iterate on their design ideas with full independence. In the real app!

David Heinemeier Hansson Ruby on Rails blog

Action Mailbox for Rails 6

DHH announced on the Ruby on Rails blog the details behind Action Mailbox, the second brand new framework coming to Rails 6 (the first was Action Text). Action Mailbox routes incoming emails to controller-like mailboxes for processing in Rails.

The framework was, like Action Text and Active Storage, extracted from Basecamp 3. We’ve been using a related approach to route everything from forwarded emails to email replies to messages and discussions. After extracting the ideas into Action Mailbox, we reintegrated the framework into Basecamp, and we’ve been running the code we’re sharing today for over a month in production.

David Heinemeier Hansson weblog.rubyonrails.org

Rails 6 will provide a built-in rich text editor

DHH announces Action Text, a big new feature coming to Rails 6:

It’s an integration between the Trix editor, Active Storage-backed file and image processing, and a text-processing flow that ties it all together. With Action Text, you really shouldn’t ever have to impoverish your users with a vanilla textarea ever again!

I’m a bit torn on this. On one hand, Trix is a good tool and many (most?) web apps need rich text editing at some point in their lifespan. On the other hand, it’s difficult to build general purpose features like this that span both the front and back ends of the stack.

Rails 6 is a ways away (with betas starting in early 2019), so we’ll have to wait and see. Regardless of whether this particular feature pans out, it’s great to see the Rails team continue to innovate and try new things.

The Changelog The Changelog #286

JavaScript sprinkles in Basecamp turned Stimulus

David Heinemeier Hansson (DHH) shares the story of how JavaScript sprinkles in Basecamp evolved into a full-fledged framework called Stimulus. We talked about ins and outs of Basecamp as it is today, Ruby, JavaScript, David’s somewhat new found love for JavaScript, how they open source because they can, and David’s new YouTube series called “On Writing Software Well”.

David Heinemeier Hansson m.signalvnoise.com

Stimulus 1.0: a modest JavaScript framework for the HTML you already have

When you combine the gains of Turbolinks and Stimulus…

Turbolinks maintains a persistent process, just like single-page applications do. It intercepts links and loads new pages via Ajax. The server still returns fully-formed HTML documents. This strategy alone can make most actions in most applications feel really fast. For Basecamp, it sped up the page-to-page transition by ~3x.

But Turbolinks alone is only half the story. Prior to Stimulus, Basecamp used different styles and patterns to apply “JavaScript sprinkles”.

Stimulus rolls up the best of those patterns into a modest, small framework revolving around just three main concepts: Controllers, actions, and targets. It’s designed to read as a progressive enhancement when you look at the HTML it’s addressing…

You should 💯 read the rest of this post as well as watch this proposition of Turbolinks from Sam Stephenson at RailsConf 2016. ALSO, we’re recording a show next week with David Heinemeier Hansson about Stimulus, so send us any questions you have by replying to this email, Slack, or Twitter.

David Heinemeier Hansson github.com


DHH’s latest is sure to be controversial:

A modest JavaScript framework for the HTML you already have

Modest in scope, perhaps, but not in prescription.

It doesn’t seek to take over your entire front-end—in fact, it’s not concerned with rendering HTML at all. Instead, it’s designed to augment your HTML with just enough behavior to make it shine.

The “JavaScript Sprinkles” style has always appealed to me more than using full-in frameworks. We might have to give this a try…

0:00 / 0:00