navbar JavaScript page weight/network chaining issues

Created on 19 October 2025, 9 days ago

Problem/Motivation

Looking in devtools I'm seeing the following issues with navbar.js:

1. With the component.js and measureScrollbar.js imports, those two files can only be loaded once navbar.js has been loaded and parsed - this means dependent network requests, which with any amount of latency can add a lot of time before the page finishes loading.

Didn't check if these affect LCP and content layout shift but it seems likely given it's the navigation bar, unless the JS doesn't affect initial rendering at all.

2. The js files are neither pre-minified, nor aggregated by Drupal's JavaScript aggregation, so they're larger than they need to be, as well as being three separate http requests (two of them chained per above).

Steps to reproduce

Proposed resolution

Remaining tasks

User interface changes

API changes

Data model changes

🐛 Bug report
Status

Active

Version

1.0

Component

Templates/PHP

Created by

🇬🇧United Kingdom catch

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

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

No activities found.

Production build 0.71.5 2024