Skip to content

Load the nav script with defer instead of async - #307

Merged
Zethson merged 1 commit into
mainfrom
perf-assets
Sep 11, 2026
Merged

Load the nav script with defer instead of async#307
Zethson merged 1 commit into
mainfrom
perf-assets

Conversation

@Zethson

@Zethson Zethson commented Sep 11, 2026

Copy link
Copy Markdown
Member

Summary

  • bootstrap.bundle.js loads with defer instead of async, ahead of main.js. The nav dropdowns and mobile collapse depend on it and could be dead on first paint.
  • Inter is preloaded. It was only discoverable after main.scss parsed.
  • Remote avatars get referrerpolicy="no-referrer" and decoding="async".

@netlify

netlify Bot commented Sep 11, 2026

Copy link
Copy Markdown

Deploy Preview for jade-cajeta-1bcca0 ready!

Name Link
🔨 Latest commit ace2fe1
🔍 Latest deploy log https://app.netlify.com/projects/jade-cajeta-1bcca0/deploys/6aa3d167c4b94c00080d7c1f
😎 Deploy Preview https://deploy-preview-307--jade-cajeta-1bcca0.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

@Zethson Zethson changed the title Drop the icon font, subset the webfonts, fix nav script loading Subset the webfonts, fix how the nav script loads Sep 11, 2026
bootstrap.bundle.js was async while the nav dropdowns and the mobile collapse
depend on it, so the nav could be dead on first paint. Ordered ahead of main.js.

Inter is preloaded: it was only discoverable after main.scss parsed.

Remote avatars get referrerpolicy=no-referrer and decoding=async.
@Zethson Zethson changed the title Subset the webfonts, fix how the nav script loads Load the nav script with defer instead of async Sep 11, 2026
@Zethson
Zethson merged commit 8038b2d into main Sep 11, 2026
6 checks passed
@Zethson
Zethson deleted the perf-assets branch September 11, 2026 10:09
@flying-sheep

flying-sheep commented Sep 11, 2026

Copy link
Copy Markdown
Member

No, type="module" has been the way to go since 8 years ago.

  • implies defer
  • implies "use strict"
  • allows module syntax
  • probably more stuff you really absolutely don’t want to miss

I’ll do a PR

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants