Code splitting in esbuild: Caveats and setup

Posted 8 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...

Better HTML forms: use type, inputmode, enterkeyhint and autocomplete

Posted 9 months ago by Dominik Schöler.
adactio.com

Web forms can be made much more usable with a few HTML attributes. Short summary: type: Tells browsers about the...

Preventing users from uploading malicious content

Posted 10 months ago by Henning Koch.

When you allow file uploads in your app, a user might upload content that hurts other users. Our primary concern...

We have deprecated Rack::SteadyETag

Posted 10 months ago by Henning Koch.

Rack::SteadyETag was a Rack middleware that generates the same default ETag for responses that only differ in XOR-masked...

Rails: Fixing ETags that never match

Posted 10 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...

Breaking changes for boolean attributes in HAML 6

Posted 11 months ago by Emanuel.

Haml 6 has some breaking changes regarding boolean attributes. Only the following attributes and aria/data attributes are considered boolean attributes...

Simple Form: Rendering errors without an appropriate attribute

Posted 11 months ago by Emanuel.

Usually you add errors to :base in ActiveRecord, in case no appropriate attribute could be used to add the error...

Rails: Assigning associations via HTML forms

Posted 11 months ago by Emanuel.

Let's say we have posts with an attribute title that is mandatory. Our example feature request is to tag...

Rails: Composing an ETag from multiple records

Posted 12 months ago by Henning Koch.

Rails offers the fresh_when method to automatically compute an ETag from the given record, array of records or scope...

Rails: Your index actions probably want strict_loading

Posted 12 months 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...

Rails Partials

Posted About 1 year ago by Niklas Hä..

Rails partials have a lot of "hidden" features and this card describes some non-obvious usages of Rails Partials.

How to turn images into inline attachments in emails

Posted About 1 year ago by Klaus Weidinger.

Not all email clients support external images in all situations, e.g. an image within a link. In some cases, a...

Rails: Encrypting your database information using Active Record Encryption

Posted About 1 year ago by Emanuel.

Since Rails 7 you are able to encrypt database information with Active Record. Using Active Record Encryption will store an...

Rails: Accessing helper methods from a controller

Posted About 1 year ago by Henning Koch.

In Rails 5+ you can access a helper from a controller using the helpers method: # Inside a controller action

Dynamic super-overridable methods in Ruby – The Pug Automatic

Posted About 1 year ago by Henning Koch.
thepugautomatic.com

How a macro can dynamically define a method that can be overridden with super in the same class.

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...

Jasmine: Creating DOM elements efficiently

Posted Over 1 year ago by Henning Koch.

Jasmine specs for the frontend often need some DOM elements to work with. Because creating them is such a common...

Jasmine: Cleaning up the DOM after each test

Posted Over 1 year ago by Henning Koch.

Jasmine specs that work with DOM elements often leave elements in the DOM after they're done. This will leak...

Chrome DevTools: Treasure (Overview)

Posted Over 1 year ago by Julian.

tl;dr The Chrome DevTools are a neat collection of tools for the daily work as a web developer. If...

Chrome DevTools: DOM Breakpoints - Breakpoints on HTML Elements

Posted Over 1 year ago by Julian.

tl;dr In Chrome DevTools in the Elements tab or in Firefox in the Inspector tab you can right click...

Debug flaky tests with an Unpoly observeDelay

Posted Over 1 year ago by Niklas Hasselmeyer.

Unpoly's [up-observe], [up-autosubmit] and [up-validate] as well as their programmatic variants up.observe() and up.autosubmit...

Git commands to discard local changes

Posted Over 1 year ago by Felix Eschey.

You have uncommited changes (you can always check by using git status), which you want to discard.

SEO: The subtle differences of robots.txt disallow vs meta robots no-index

Posted Over 1 year ago by Dominik Schöler.
workingdraft.de

The robots.txt file and HTML tag can be used to control the behavior of search engine crawlers. Both have different...