Decisions about javascript

Architectural decision records tagged with javascript

9 decisions
  1. 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
  2. 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
  3. 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
  4. 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
  5. accepted
    Avoid using jQuery

    jQuery is an unnecessary dependency for modern browsers.

    front-end javascript
  6. accepted
    Load JavaScript as external resource with defer attribute

    Loading JavaScript as deferred has the best default performance

    javascript front-end performance
  7. 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
  8. accepted
    Use JavaScript strict mode

    Opt in to settings that raise errors for problematic code.

    front-end javascript
  9. 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

Search Decisions