All Decisions
A complete list of architectural decision records
-
acceptedEnforce SDC Schema Validation
Without enforced schema validation, Single Directory Components can silently accept incorrect or missing props, leading to runtime errors and inconsistent rendering.
-
acceptedLoad JavaScript libraries conditionally
Loading all JavaScript globally increases initial page weight and slows down pages that don't need it.
-
acceptedAlways provide editors control over image style cropping
Manual user intervention can help prevent automated cropping from eliminating the most important parts of a photo.
-
acceptedAutomate checking for uncommitted files
Uncommitted files resulting from builds can cause issues during deployments.
-
acceptedUse data-drupal-selector to target form elements in JavaScript
Classes and IDs are unstable JavaScript targets in Drupal, while data-drupal-selector is a stable hook provided by the Form API.
-
acceptedRespect prefers-reduced-motion for all animations and transitions
Users with vestibular disorders rely on the prefers-reduced-motion media query to disable or reduce motion that can cause discomfort.
-
acceptedUse the feature branch git workflow
Establishing a standard git workflow improves velocity and consistency of delivery.
-
acceptedAlways pin GitHub Actions to a commit hash
GitHub Actions referenced by a mutable tag or branch can be silently replaced with malicious code, exposing CI/CD secrets across every repository that uses them.
-
acceptedUse Stylelint
Using Stylelint helps prevent errors and keeps code in a consistent format.
-
acceptedUse Tagify for entity autocomplete widgets in Drupal
Drupal's default entity reference autocomplete widget has limited UX. A modern, well-supported replacement is needed and the Tagify module has been successfully used in several Lullabot projects.
-
acceptedUse composer audit in automated checks for known security vulnerabilities
Third-party dependencies can introduce known security vulnerabilities at any time, so projects need an automated mechanism to detect them early.
-
acceptedOnly allow developers and site administrators access to the default Drupal files listing
Drupal's built-in files listing at
/admin/content/filesis a technical tool that has caused editorial confusion and accidental data loss. -
acceptedUse PHPStan for PHP code static analysis at level 6
Static analysis catches type errors, logic bugs, and unsafe code paths without running the application, improving code quality at low cost.
-
acceptedUse 'drush deploy' when building Drupal sites
When updating Drupal code and configuration in a given environment, it's useful to make sure all members of the team and all teams follow a consistent set of steps, in the same order. Having consistent steps across multiple projects will reduce onboarding for new team members.
-
acceptedUse the term "microcontent" to describe embeddable content from the same website
Teams have used inconsistent terminology — including "micro-content", "component", "embeds", and "inline content" — to describe content that is embedded within pages but never exists independently.
-
acceptedUse `access_unpublished` for password-protected pages
Some pages need to be accessible only to specific groups or individuals using a password or token, without requiring a full user account.
-
acceptedSelf-host Third-Party Static Assets
Third-party hosted assets (e.g. web fonts, icon libraries) can lead to performance, privacy, and reliability issues. These include GDPR violations, extra DNS lookups, and outages outside the organization control.
-
acceptedLayer elements deliberately with stacking contexts
Overlap elements predictably by creating new stacking contexts for
z-indexvalues. -
acceptedThe main branch of a project should always be ready to deploy to production
Even with the best planning, unexpected bugs and security issues can require a fast deployment to production. By ensuring the main branch is always deployable, we minimize additional development work and QA in the case of an unplanned deployment.
-
acceptedUse Renovate for third-party dependency updates
Renovate supports automatic updates across a wide variety of ecosystems ensuring our projects are secure and up to date.
-
acceptedUse SVG view box instead of width and height
Using viewBox improves maintainability.
-
acceptedUse human-readable names as exposed filter identifiers in Views
-
acceptedEnforce Twig coding standards with automatic linting
Linters like twigcs keep code more consistent and readable
-
acceptedUse ImageMagick with Drupal
Drupal requires the GD PHP extension, but many sites prefer ImageMagick for better performance, flexibility, and reliability. This choice affects image features, speed, and deployment in various hosting environments.
-
acceptedAvoid using jQuery
jQuery is an unnecessary dependency for modern browsers.
-
acceptedUse relative units in CSS for resizable content
Using relative units improves accessibility by ensuring that text and content does not overlap when zooming web pages or changing the base font size.
-
acceptedUse only one h1 on each page
Using one h1 on each page is best practice for accessibility and usability.
-
acceptedUse description template for upstream patches in composer
When managing patches in a
composer.jsonfile, clear and consistent descriptions improve maintainability and facilitate tooling. Currently, there is no standard template for describing patches, leading to inconsistent documentation. -
acceptedUse 11ty to manage the ADRs
We need a site generator to publish our ADRs.
-
acceptedDocument project setup in README.md
Documentation for getting started on a project should always be found in the same place and use the same formatting.
-
acceptedUse SVGs for icons
Using SVGs for icons has the best display, performance, and accessibility
-
acceptedDo not use placeholder text in form fields
Placeholder text introduces significant usability and accessibility issues and should be avoided.
-
acceptedOrder content type form fields based on content priority
When content types have dedicated pages, matching the display order when possible makes edit forms easier to understand.
-
acceptedLoad JavaScript as external resource with defer attribute
Loading JavaScript as deferred has the best default performance
-
deprecatedStandardize the order of steps when building a Drupal site
When updating Drupal code and configuration in a given environment, it's useful to make sure all members of the team and all teams follow a consistent set of steps, in the same order. Having consistent steps across multiple projects will reduce onboarding for new team members.
-
deprecatedLoad JavaScript as external resource with async and defer attributes
Loading JavaScript as async & deferred has the best default performance
-
acceptedUse Typed Entity to encapsulate business logic in dedicated classes
Wrapping the business logic for an entity using Typed Entity produces code that is easier to read, maintain, test, and discover.
-
acceptedLeverage view modes when rendering entities
Rendering entities using view modes have multiple benefits. These include better maintainability, faster initial development time, better performance, and hardened security.
-
acceptedUse [ticket-id]--[short-description] in feature branch names
Omitting key information in branch names can cause confusion over the purpose of a branch.
-
acceptedUse identical cache backends on development environments
Using memory caches like Memcached or Redis in production but not in development environments can lead to bugs and confusion.
-
acceptedUse JavaScript strict mode
Opt in to settings that raise errors for problematic code.
-
acceptedUse SMACSS to organize CSS within projects
Organizing CSS within projects the same way Drupal organizes its CSS establishes a consistent pattern.
-
acceptedUse TypeScript for pure JavaScript development
Strictly typed languages like TypeScript avoid unexpected behavior, prevent bugs, and improve code maintainability.
-
acceptedDo not add the Metatag field to the node form
The metatag field makes the node form slow and overly complex for editorial users.
-
acceptedUse CSS Logical Properties
Decoupling styles from a language's writing direction makes them easier to maintain across translations.
-
deprecatedUse gatsby-theme-adr to manage the ADRs
We need a site generator to publish our ADRs.
-
acceptedUse Claro for the Drupal administration theme
Claro offers a modern, responsive, and accessible interface that showcases Drupal's capabilities from the outset.
-
acceptedUse inclusive language in code and technical writing
Inclusive language can make technical subjects more inviting and understandable.
-
acceptedUse Type Tray to improve editorial UX
Drupal's editorial experience in the "Add Content" page is confusing out of the box, especially when the content model's complexity increases.
-
acceptedUse Simple Add More to improve editorial experience
Drupal core by default outputs the maximum number of values (cardinality) as empty elements on entity forms, which usually represents a poor user-experience.
-
acceptedBreak composer install if patches don't apply
Allowing builds to succeed with failed patches can lead to malformed code or hidden errors.
-
acceptedUse local copies of patch files
When using cweagans/composer-patches, it is important that patch sources are consistent and do not change between builds.
-
acceptedStore Composer Patches configuration in composer.json
Validating a complete Composer configuration is important to ensuring build issues are caught early.
-
acceptedConfigure Composer Patches to Use `-p2` as `patchLevel` for Drupal core
Drupal's git repository has a different directory structure than projects built on Drupal. Default Composer Patches settings can cause Drupal patches to be silently misapplied.
-
acceptedUse dedicated accounts for service integrations
Service integrations that use personal accounts tie the function of the service with the person's engagement with the project.
-
acceptedAlways hide non-translatable fields on translation forms
When content translation is enabled, it's possible to decide which fields can be translated.
-
acceptedLock entity language on edit forms
Editors new to Drupal often try to translate content by changing the language on existing content, causing confusion for site visitors.
-
acceptedConsistently name entity fields
Adopting a consistent set of rules when naming entities in Drupal can reduce errors and improve maintainability.
-
deprecatedComposer patches configuration and best practices
Default
composer-patchessettings can lead to misapplied patches or hidden errors. Using a consistent configuration across projects will reduce errors and save time. -
acceptedUse PHPUnit for unit testing PHP code
-
acceptedBlock the Drupal user 1 account in production environments
The first user account in a Drupal site (often referred to as "administrator" or "user 1") is granted every permission automatically. If the account credentials are compromised, an attacker can easily inject JavaScript to attack site visitors and can likely execute arbitrary PHP code.
-
acceptedAlways use typehints in new PHP code
Following stricter typing where available can significantly reduce bugs, and simplify maintainability. This has been proven by several studies across different disciplines.
-
acceptedConfirm Drupal site configuration is always in a default state
Configuration should never be in an overridden state after configuration import(s) have been completed.
-
acceptedUse DDEV for local environments
The software development industry is continuing to move to containers both for production and local environments. It's clear that the bulk of new investment in local tooling is going towards container-focused solutions. While containers themselves add some complexity to local environments, they also reduce variance in development environments for teams with multiple developers.
-
acceptedUse strict types in PHP code
PHP's type coercion can cause logical errors within a program. For example, when a float is cast to an int, the decimal portion is lost. We aim to reduce these errors in our code, but they can easily slip through manual code review. Following stricter typing where available can significantly reduce bugs, as shown by Python's urllib3 type hinting case study.
-
acceptedStage File Proxy for static files
Lullabot often works on projects that have large numbers of static file assets in production, such as images or PDFs. Keeping a complete copy of those files for each environment is wasteful, since developers tend to only look at a small portion of a site locally. A solution is needed to reduce disk use and the time it takes to update an environment.
-
acceptedUse settings.php for environment overrides and local settings
When developing a Drupal website, additional modules and configuration are useful for local and development environments.
-
acceptedAvoid command aliases and short options
When writing scripts for CI tasks or local procedures, it is helpful to have the full command spelled out. Having the long options and avoiding command aliases will reduce chances of misinterpretation and mistakes. This will also reduce the need for checking the documentation while reading or reviewing a script.
-
deprecatedDefine the order of steps when building a Drupal site
When updating Drupal code and configuration in a given environment, it's useful to make sure all members of the team and all teams follow a consistent set of steps, in the same order. Having consistent steps across multiple projects will reduce onboarding for new team members.
-
acceptedEnvironment Indicator
All Drupal websites our team works on have one or more environments. At a minimum, there will be a production and a local development environment. Most projects will have production, staging, development preview, and local environments. Developers and QA often access different environments at the same time. Since making content or configuration changes on the wrong environment can have unintended consequences, it is important to be able to distinguish environments easily.
-
deprecatedUse Log4brains to manage the ADRs
-
acceptedRecord architecture decisions
We need to record the architectural decisions made on this project.