From 96e206b6715fcd44d963450cbb2e6a9a955e8f90 Mon Sep 17 00:00:00 2001 From: John O'Keefe Date: Thu, 12 Mar 2026 09:04:13 -0400 Subject: [PATCH] perf(templates): add defer attribute to main.js script tags - Add defer attribute to all main.js script includes across 22 template files - Improves page load performance by allowing HTML parsing to continue without blocking - Maintains script execution order while enabling parallel resource loading This optimization reduces page render blocking and improves perceived load times across all admin and user-facing pages that include the main.js bundle. Affected pages include: admin dashboard, library management, settings, user management, analytics, bookshelf, collections, conflicts, custom sections, devices, documentation, profile, progress tracking, queue, and authentication pages (login/register). --- templates/admin.templ | 2 +- templates/admin_library.templ | 2 +- templates/admin_settings.templ | 2 +- templates/admin_users.templ | 2 +- templates/analytics.templ | 2 +- templates/bookshelf.templ | 2 +- templates/collection_rules.templ | 2 +- templates/collections.templ | 4 ++-- templates/conflicts.templ | 2 +- templates/custom_section.templ | 2 +- templates/dashboard.templ | 2 +- templates/devices.templ | 6 +++--- templates/docs.templ | 2 +- templates/header.templ | 2 +- templates/index.templ | 2 +- templates/login.templ | 2 +- templates/profile.templ | 2 +- templates/progress.templ | 2 +- templates/queue.templ | 2 +- templates/register.templ | 2 +- templates/unlinked_books.templ | 2 +- 21 files changed, 24 insertions(+), 24 deletions(-) diff --git a/templates/admin.templ b/templates/admin.templ index a171290..c756012 100644 --- a/templates/admin.templ +++ b/templates/admin.templ @@ -7,7 +7,7 @@ templ Admin(user User) { Admin Dashboard - Bookhoard - + diff --git a/templates/admin_library.templ b/templates/admin_library.templ index 38993d8..c91d740 100644 --- a/templates/admin_library.templ +++ b/templates/admin_library.templ @@ -150,7 +150,7 @@ templ AdminLibrary(user User, libraries []LibraryData, users []User) { - + } diff --git a/templates/admin_settings.templ b/templates/admin_settings.templ index aaa0c7f..647c3fe 100644 --- a/templates/admin_settings.templ +++ b/templates/admin_settings.templ @@ -7,7 +7,7 @@ templ AdminSettings(user User, systemConfig map[string]string, errorMessage stri System Settings - Bookhoard - + diff --git a/templates/admin_users.templ b/templates/admin_users.templ index a120e9c..d4dbbd3 100644 --- a/templates/admin_users.templ +++ b/templates/admin_users.templ @@ -7,7 +7,7 @@ templ AdminUsers(currentUser User, users []User, adminCount int) { Users - Bookhoard Admin - + diff --git a/templates/analytics.templ b/templates/analytics.templ index eaf2036..f93718f 100644 --- a/templates/analytics.templ +++ b/templates/analytics.templ @@ -8,7 +8,7 @@ templ Analytics(user User) { Reading Analytics - Bookhoard - + diff --git a/templates/bookshelf.templ b/templates/bookshelf.templ index dc08700..175e934 100644 --- a/templates/bookshelf.templ +++ b/templates/bookshelf.templ @@ -8,7 +8,7 @@ templ BookShelf(user User, libraries []LibraryData) { Library - Bookhoard - + diff --git a/templates/collection_rules.templ b/templates/collection_rules.templ index eb99e59..980c478 100644 --- a/templates/collection_rules.templ +++ b/templates/collection_rules.templ @@ -8,7 +8,7 @@ templ CollectionRules(user User, collection CollectionData) { Collection Rules - { collection.Name } - Bookhoard - + diff --git a/templates/collections.templ b/templates/collections.templ index 4cdd50e..dccbd6b 100644 --- a/templates/collections.templ +++ b/templates/collections.templ @@ -10,7 +10,7 @@ templ Collection(user User, collections []CollectionData, errorMessage string) { Collections - Bookhoard - + @@ -109,7 +109,7 @@ templ CollectionDetail(user User, collection CollectionData, books []handlers.Bo { collection.Name } - Bookhoard - + diff --git a/templates/conflicts.templ b/templates/conflicts.templ index feecf06..5b74aba 100644 --- a/templates/conflicts.templ +++ b/templates/conflicts.templ @@ -10,7 +10,7 @@ templ Conflicts(user User, conflicts []handlers.ConflictDetailResponse, total in Sync Conflicts - Bookhoard - + diff --git a/templates/custom_section.templ b/templates/custom_section.templ index 8aa8472..217d130 100644 --- a/templates/custom_section.templ +++ b/templates/custom_section.templ @@ -8,7 +8,7 @@ templ CustomSectionBuilder(user User, libraries []LibraryData, errorMessage stri Create Custom Section - Bookhoard - + diff --git a/templates/dashboard.templ b/templates/dashboard.templ index 528eb39..c9533d4 100644 --- a/templates/dashboard.templ +++ b/templates/dashboard.templ @@ -13,7 +13,7 @@ templ Dashboard(user User, sections []handlers.SectionData, allSections []handle Dashboard - Bookhoard - + diff --git a/templates/devices.templ b/templates/devices.templ index 5e1ee84..3f0d6a1 100644 --- a/templates/devices.templ +++ b/templates/devices.templ @@ -10,7 +10,7 @@ templ Devices(user User, devices []handlers.DeviceInfo, pendingRegistrations []P Device Management - Bookhoard - + @@ -112,7 +112,7 @@ templ Devices(user User, devices []handlers.DeviceInfo, pendingRegistrations []P style="background-color: var(--bg-primary); color: var(--text-primary); border-color: var(--border);" />