From ac27acda67c28b934444eca714280f450c82f8ee Mon Sep 17 00:00:00 2001 From: Ruslan Date: Wed, 1 Jul 2026 18:09:25 +0300 Subject: [PATCH 01/19] perf(iot-hub): remove dead astro:page-load listeners The site has no View Transitions/ClientRouter, so astro:page-load never fires. Each setup already inits on DOMContentLoaded (or immediately) and is idempotent, so the extra listener was dead registration. --- src/components/IotHub/DetailMeta.astro | 6 ++---- src/components/IotHub/IotHubSort.astro | 1 - src/components/IotHub/ListingsFilterBar.astro | 1 - src/components/IotHub/iot-hub-dynamic-search.ts | 1 - src/components/IotHub/iot-hub-search-bar-init.ts | 1 - src/components/Pagination/PerPageSelector.astro | 1 - 6 files changed, 2 insertions(+), 9 deletions(-) diff --git a/src/components/IotHub/DetailMeta.astro b/src/components/IotHub/DetailMeta.astro index d11bc2d7e..38b7610f2 100644 --- a/src/components/IotHub/DetailMeta.astro +++ b/src/components/IotHub/DetailMeta.astro @@ -414,8 +414,8 @@ const hasAnyColumn = creator || secondColumn || thirdColumn || useCasesColumn; // Runtime chip-overflow. For each `[data-chip-overflow]` container, // measure every `[data-chip-overflow-item]` chip, hide the ones that // don't fit, and update the `[data-chip-overflow-counter]` chip with - // `+N`. Re-runs on container resize, on `astro:page-load`, and once - // after web fonts settle so widths re-measure with final glyph metrics. + // `+N`. Re-runs on container resize and once after web fonts settle so + // widths re-measure with final glyph metrics. type ChipDataset = { chipOverflowGap?: string; chipOverflowTemplate?: string; chipOverflowMin?: string; chipOverflowInited?: string }; @@ -515,6 +515,4 @@ const hasAnyColumn = creator || secondColumn || thirdColumn || useCasesColumn; } else { initAll(); } - // Re-init after Starlight / Astro view transitions swap the DOM. - document.addEventListener('astro:page-load', initAll); diff --git a/src/components/IotHub/IotHubSort.astro b/src/components/IotHub/IotHubSort.astro index 02438cee9..db7e1ec2c 100644 --- a/src/components/IotHub/IotHubSort.astro +++ b/src/components/IotHub/IotHubSort.astro @@ -311,5 +311,4 @@ const initial = getIotHubSortOption(initialSortId); } else { initAll(); } - document.addEventListener('astro:page-load', initAll); diff --git a/src/components/IotHub/ListingsFilterBar.astro b/src/components/IotHub/ListingsFilterBar.astro index 47ebec561..503b26c39 100644 --- a/src/components/IotHub/ListingsFilterBar.astro +++ b/src/components/IotHub/ListingsFilterBar.astro @@ -426,5 +426,4 @@ const { } else { initListingsBars(); } - document.addEventListener('astro:page-load', initListingsBars); diff --git a/src/components/IotHub/iot-hub-dynamic-search.ts b/src/components/IotHub/iot-hub-dynamic-search.ts index a88fe63a7..3899fab8c 100644 --- a/src/components/IotHub/iot-hub-dynamic-search.ts +++ b/src/components/IotHub/iot-hub-dynamic-search.ts @@ -569,5 +569,4 @@ export function initDynamicSearch(): void { } else { setupDynamicSearch(); } - document.addEventListener('astro:page-load', setupDynamicSearch); } diff --git a/src/components/IotHub/iot-hub-search-bar-init.ts b/src/components/IotHub/iot-hub-search-bar-init.ts index 923109bcd..52b51c470 100644 --- a/src/components/IotHub/iot-hub-search-bar-init.ts +++ b/src/components/IotHub/iot-hub-search-bar-init.ts @@ -77,5 +77,4 @@ export function initSearchBars(): void { } else { run(); } - document.addEventListener('astro:page-load', run); } diff --git a/src/components/Pagination/PerPageSelector.astro b/src/components/Pagination/PerPageSelector.astro index 6cb60a92b..675826f75 100644 --- a/src/components/Pagination/PerPageSelector.astro +++ b/src/components/Pagination/PerPageSelector.astro @@ -224,5 +224,4 @@ const labelId = `tb-pagination-pp-${slug || 'nav'}`; } else { initPerPageSelectors(); } - document.addEventListener('astro:page-load', initPerPageSelectors); From 985e63bcd7f8e58b2f0a4e424ab7496978ac89d4 Mon Sep 17 00:00:00 2001 From: Ruslan Date: Wed, 1 Jul 2026 18:57:14 +0300 Subject: [PATCH 02/19] perf(3p): defer MailerLite embed to interaction; idle-schedule UTM link rewrite MailerLite universal.js + ml('load') now load on first interaction via __deferOnInteraction instead of at parse; UtmTracker's document.links rewrite runs at requestIdleCallback instead of DOMContentLoaded. Moves third-party/main-thread work out of the load/LCP window. --- src/components/DemoRequestForm.astro | 60 +++++++++++++++------------- src/components/UtmTracker.astro | 7 +++- 2 files changed, 37 insertions(+), 30 deletions(-) diff --git a/src/components/DemoRequestForm.astro b/src/components/DemoRequestForm.astro index a41efd33f..90014e289 100644 --- a/src/components/DemoRequestForm.astro +++ b/src/components/DemoRequestForm.astro @@ -32,36 +32,40 @@ const { title, description, features, gtmFormId } = Astro.props;