All Decisions

A complete list of architectural decision records

72 decisions
  1. accepted
    Enforce SDC Schema Validation

    Without enforced schema validation, Single Directory Components can silently accept incorrect or missing props, leading to runtime errors and inconsistent rendering.

    front-end sdc
  2. accepted
    Load JavaScript libraries conditionally

    Loading all JavaScript globally increases initial page weight and slows down pages that don't need it.

    front-end javascript
  3. accepted
    Always provide editors control over image style cropping

    Manual user intervention can help prevent automated cropping from eliminating the most important parts of a photo.

    drupal contrib-modules editorial-experience media
  4. accepted
    Automate checking for uncommitted files

    Uncommitted files resulting from builds can cause issues during deployments.

    git ci devops
  5. accepted
    Use 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.

    drupal front-end javascript
  6. accepted
    Respect 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.

    front-end css javascript accessibility
  7. accepted
    Use the feature branch git workflow

    Establishing a standard git workflow improves velocity and consistency of delivery.

    git
  8. accepted
    Always 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.

    ci security
  9. accepted
    Use Stylelint

    Using Stylelint helps prevent errors and keeps code in a consistent format.

    front-end css
  10. accepted
    Use 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.

    drupal contrib-modules editorial-experience
  11. accepted
    Use 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.

    composer security ci
  12. accepted
    Only allow developers and site administrators access to the default Drupal files listing

    Drupal's built-in files listing at /admin/content/files is a technical tool that has caused editorial confusion and accidental data loss.

    drupal access-control media editorial-experience
  13. accepted
    Use 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.

    php drupal ci
  14. accepted
    Use '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.

    drush drupal deployments
  15. accepted
    Use 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.

    drupal content-modeling editorial-experience
  16. accepted
    Use `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.

    drupal contrib-modules access-control
  17. accepted
    Self-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.

    front-end performance javascript css
  18. accepted
    Layer elements deliberately with stacking contexts

    Overlap elements predictably by creating new stacking contexts for z-index values.

    front-end css
  19. accepted
    The 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.

    devops
  20. accepted
    Use 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.

    drupal devops security
  21. accepted
    Use SVG view box instead of width and height

    Using viewBox improves maintainability.

    front-end performance
  22. accepted
    Use human-readable names as exposed filter identifiers in Views
    drupal editorial-experience views
  23. accepted
    Enforce Twig coding standards with automatic linting

    Linters like twigcs keep code more consistent and readable

    twig drupal front-end
  24. accepted
    Use 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.

    drupal images
  25. accepted
    Avoid using jQuery

    jQuery is an unnecessary dependency for modern browsers.

    front-end javascript
  26. accepted
    Use 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.

    front-end css
  27. accepted
    Use only one h1 on each page

    Using one h1 on each page is best practice for accessibility and usability.

    drupal accessibility
  28. accepted
    Use description template for upstream patches in composer

    When managing patches in a composer.json file, clear and consistent descriptions improve maintainability and facilitate tooling. Currently, there is no standard template for describing patches, leading to inconsistent documentation.

    composer
  29. accepted
    Use 11ty to manage the ADRs

    We need a site generator to publish our ADRs.

    meta
  30. accepted
    Document 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.

    documentation
  31. accepted
    Use SVGs for icons

    Using SVGs for icons has the best display, performance, and accessibility

    front-end accessibility performance
  32. accepted
    Do not use placeholder text in form fields

    Placeholder text introduces significant usability and accessibility issues and should be avoided.

    drupal editorial-experience
  33. accepted
    Order 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.

    drupal editorial-experience
  34. accepted
    Load JavaScript as external resource with defer attribute

    Loading JavaScript as deferred has the best default performance

    javascript front-end performance
  35. deprecated
    Standardize 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.

    drush drupal deployments
  36. deprecated
    Load JavaScript as external resource with async and defer attributes

    Loading JavaScript as async & deferred has the best default performance

    javascript front-end performance
  37. accepted
    Use 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.

    drupal code quality
  38. accepted
    Leverage 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.

    drupal
  39. accepted
    Use [ticket-id]--[short-description] in feature branch names

    Omitting key information in branch names can cause confusion over the purpose of a branch.

    git
  40. accepted
    Use 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.

    drupal devops
  41. accepted
    Use JavaScript strict mode

    Opt in to settings that raise errors for problematic code.

    front-end javascript
  42. accepted
    Use SMACSS to organize CSS within projects

    Organizing CSS within projects the same way Drupal organizes its CSS establishes a consistent pattern.

    front-end css
  43. accepted
    Use TypeScript for pure JavaScript development

    Strictly typed languages like TypeScript avoid unexpected behavior, prevent bugs, and improve code maintainability.

    javascript front-end back-end developer-experience
  44. accepted
    Do not add the Metatag field to the node form

    The metatag field makes the node form slow and overly complex for editorial users.

    drupal node-form editorial-experience performance seo
  45. accepted
    Use CSS Logical Properties

    Decoupling styles from a language's writing direction makes them easier to maintain across translations.

    front-end css multilingual
  46. deprecated
    Use gatsby-theme-adr to manage the ADRs

    We need a site generator to publish our ADRs.

    meta
  47. accepted
    Use Claro for the Drupal administration theme

    Claro offers a modern, responsive, and accessible interface that showcases Drupal's capabilities from the outset.

    drupal editorial-experience
  48. accepted
    Use inclusive language in code and technical writing

    Inclusive language can make technical subjects more inviting and understandable.

  49. accepted
    Use 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.

    drupal contrib-modules editorial-experience
  50. accepted
    Use 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.

    drupal contrib-modules editorial-experience
  51. accepted
    Break composer install if patches don't apply

    Allowing builds to succeed with failed patches can lead to malformed code or hidden errors.

    drupal composer php
  52. accepted
    Use local copies of patch files

    When using cweagans/composer-patches, it is important that patch sources are consistent and do not change between builds.

    drupal php composer
  53. accepted
    Store Composer Patches configuration in composer.json

    Validating a complete Composer configuration is important to ensuring build issues are caught early.

    drupal php composer
  54. accepted
    Configure 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.

    drupal php composer
  55. accepted
    Use 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.

    devops
  56. accepted
    Always hide non-translatable fields on translation forms

    When content translation is enabled, it's possible to decide which fields can be translated.

    drupal
  57. accepted
    Lock 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.

    drupal
  58. accepted
    Consistently name entity fields

    Adopting a consistent set of rules when naming entities in Drupal can reduce errors and improve maintainability.

    drupal
  59. deprecated
    Composer patches configuration and best practices

    Default composer-patches settings can lead to misapplied patches or hidden errors. Using a consistent configuration across projects will reduce errors and save time.

    drupal php composer
  60. accepted
    Use PHPUnit for unit testing PHP code
    drupal php coding testing
  61. accepted
    Block 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.

    drupal security
  62. accepted
    Always 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.

    drupal php coding
  63. accepted
    Confirm Drupal site configuration is always in a default state

    Configuration should never be in an overridden state after configuration import(s) have been completed.

    drupal deployment automation devops
  64. accepted
    Use 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.

    dev-tools drupal devops
  65. accepted
    Use 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.

    php drupal
  66. accepted
    Stage 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.

    devops locals drupal contrib-modules
  67. accepted
    Use settings.php for environment overrides and local settings

    When developing a Drupal website, additional modules and configuration are useful for local and development environments.

    dev-tools drupal
  68. accepted
    Avoid 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.

    scripting
  69. deprecated
    Define 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.

    drush deployments
  70. accepted
    Environment 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.

    contrib-modules editorial-experience
  71. deprecated
    Use Log4brains to manage the ADRs
    dev-tools doc meta
  72. accepted
    Record architecture decisions

    We need to record the architectural decisions made on this project.

    meta

Search Decisions