Remove drupalSettingsLoader.js from critical rendering path

Created on 19 August 2025, 10 days ago

Problem/Motivation

The drupalSettingsLoader javascript file is loaded without async or defer, and generally in <head>. This adds a round-trip to the critical rendering path. The loader javascript is tiny, so why not inline it (only when drupalSettings are used!)?

Steps to reproduce

Load a page, see that the drupal settings loader JS is placed in <head> without an async or defer attribute.

Proposed resolution

If there are any drupalSettings to render, simply inline the loader script after it right in the JS collection renderer.

Remaining tasks

User interface changes

Introduced terminology

API changes

Data model changes

Release notes snippet

πŸ“Œ Task
Status

Active

Version

11.0 πŸ”₯

Component

asset library system

Created by

πŸ‡ΊπŸ‡ΈUnited States luke.leber Pennsylvania

Live updates comments and jobs are added and updated live.
  • Performance

    It affects performance. It is often combined with the Needs profiling tag.

Sign in to follow issues

Comments & Activities

Production build 0.71.5 2024