Code splitting in esbuild: Caveats and setup

Posted 10 months ago by Henning Koch.

TL;DR Still has caveats. Code splitting is a feature of JavaScript bundlers that can keep huge libraries out of...

Find Where a Rake Task is Defined

Posted 10 months ago by Henning Koch.
jacopretorius.net

You can use rake --where task to find the source location that defines task: bundle exec rake --where assets:precompile...

Chromedriver: Connect local chromedriver with docker

Posted 10 months ago by Emanuel.

Debugging your integration tests, that run a headless Chrome inside a docker image, is tricky. In many cases you can...

Fast rubocop autocorrection alias

Posted 11 months ago by Michael Leimstädtner.

The rubocop binary has a few interesting flags: rubocop (using the --parallel default ) scans the current repository for linting issues...

Rails: Fixing ETags that never match

Posted 11 months ago by Henning Koch.

Every Rails response has a default ETag header. In theory this would enable caching for multiple requests to the same...

ASDF: A Version Manager To Rule Them All

Posted 11 months ago by Julian.

tl;dr asdf allows you to manage multiple runtime versions with a single CLI tool and is backwards compatible by...

JavaScript: Detecting the end of native smooth scrolling

Posted 12 months ago by Henning Koch.

When you use native smooth scrolling there is no built-in method to detect the end of the scrolling animation...

Rails: Your index actions probably want strict_loading

Posted About 1 year ago by Henning Koch.

By activating strict_loading you force developers to address n+1 queries by preloading all associations used in the index...

How to enable template coverage support for simplecov

Posted About 1 year ago by Felix Eschey.
github.com

Since Ruby 3.2.0 you can measure coverage support for eval statements and support has been added for the simplecov gem...

SASS: Reusing styles from other files

Posted About 1 year ago by Dominik Schöler.

SASS has an @extend keyword to inherit styles. .alert color: red &.-framed border: 1px solid red padding: 5px &.-homepage

Heads up: Deployment with newly generated SSH key (using ED25519) might fail

Posted About 1 year ago by Fabian Schwarz.

If you use a newer SSH key generated with the ED25519 algorithm instead of RSA (see Create a new SSH...

Rails: Using database default values for boolean attributes

Posted About 1 year ago by Emanuel.

In the past we validate and set default values for boolean attributes in Rails and not the database itself.

git: find the version of a gem that releases a certain commit

Posted About 1 year ago by Daniel Straßner.

Sometimes I ran across a GitHub merge request of a gem where it was not completely obvious in which version...

Fixing wall of net/protocol warnings

Posted Over 1 year ago by Henning Koch.

After upgrading to Rails 6.1.7.2 one of our apps printed a wall of warnings while booting: /var/www/app/shared/bundle/ruby/2.6.0/gems/net-protocol-0.2.1/lib/net/protocol.rb:68: warning: already...

Bundler 2.3 honors the version specified in `BUNDLED_WITH`

Posted Over 1 year ago by Klaus Weidinger.
bundler.io

Bundler so far ignored the version specified under BUNDLED_WITH in the Gemfile.lock. This had two annoying consequences:

Timecop: reset after each test

Posted Over 1 year ago by Daniel Straßner.

Timecop is a great gem to set the current time in tests. However, it is easy to introduce flakyness to...

Jasmine: Mocking ESM imports

Posted Over 1 year ago by Henning Koch.

In a Jasmine spec you want to spy on a function that is imported by the code under test. This...

Heads up: network requests `Kernel#open` are not mocked with VCR

Posted Over 1 year ago by Michael Leimstädtner.

We usually rely on VCR and WebMock to prevent any real network connection when running our unit tests.

Temporary solution for connection errors with rubygems

Posted Over 1 year ago by Jakob Scholz.

If you're experiencing that your bundle install command fails with an error message like this, rubygems.org might...

Creating a Rails application in a single file

Posted Over 1 year ago by Arne Hartherz.
greg.molnar.io

Greg Molnar has written a neat article about creating a single-file Rails app. This is not meant for production...

Local development with SSL and Puma

Posted Over 1 year ago by Daniel Straßner.

Sometimes the need arises for SSL in local development. We have guides for different webservers, this one is for puma...

Yarn: Use yarn-deduplicate to cleanup your yarn.lock

Posted Over 1 year ago by Florian Leinsinger.
github.com

Note Use yarn dedupe in Yarn v2+: https://yarnpkg.com/cli/dedupe This package only works with Yarn v1. Yarn v2 supports...

Generating and streaming ZIP archives on the fly

Posted Over 1 year ago by Arne Hartherz.

When your Rails application offers downloading a bunch of files as ZIP archive, you basically have two options:

Fix for mysql2 error "Incorrect MySQL client library version! This gem was compiled for x.x.x but the client library is y.y.y."

Posted Almost 2 years ago by Tobias Kraze.

This should be fixed in the latest LTS-branches of our mysql2 fork, 0.2.x-lts and 0.3.x-lts...