SSWConsulting / SSWConsulting/SSW.Website
💸 Perf - Stop loading AOS on pages that don't use it
@isaaclombardssw is already working on this.
Since Jul 23, 2026.
- Dominant language
- HTML
- Stars
- 14
- Forks
- 10
- Avg merge
- 13h 51m
- Merged PRs (30d)
- 38
Description
Sub-issue of the AI for Business Leaders performance PBI. Part of the same main-thread cleanup pass.
Description
app/tina-client.tsx imports the AOS library and runs AOS.init({ duration: 1200, once: true }) plus AOS.refresh() in a mount effect on every page of the site, with an AOS.refreshHard() on unmount. Six block files additionally import aos/dist/aos.css.
AOS.init()/refresh() walk the DOM and measure element positions, which adds main-thread work and layout reads during hydration.
There are 12 data-aos usages in the whole codebase, and none of them are in any component this page renders (spacer, imageTextBlock, cardCarousel, accordionBlock, logoCarousel, breadcrumbs). The library, its CSS and its init cost are pure overhead here.
Proposed solution
- Move AOS init out of
TinaClientand into the handful of components that actually usedata-aos(testimonialsCard,youtubePlaylist,videoCards,consulting/benefits,training/presenterBlock,liveStream/liveStreamWidget,button/utilityButton), lazily importing the library there - Remove the stray
import "aos/dist/aos.css"lines from block files that have nodata-aosattributes - If AOS ends up used by only a couple of components, consider replacing it with CSS entirely and dropping the dependency
Acceptance criteria
- Neither the AOS JS nor its CSS loads on
/events/ai-for-business-leaders - AOS animations still work on the pages that use them (a testimonials page, a training page, and the live-stream widget)
- No console errors about AOS being uninitialised
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Assessment
This issue has not been assessed yet.