140 KB of JavaScript on a page with four interactions

Four interactive blocks on a page, each shipping its own approach to the same problem.

the breakdown:

  carousel      22 KB   bespoke, written 2021
  filter        41 KB   a small framework, bundled
  accordion      8 KB   bespoke
  map           69 KB   a third-party widget
  ───────────────────
                140 KB, and three of the four
                implement their own event delegation

the first three share nothing and could.

Four independent solutions to the same class of problem is what happens when blocks are built one at a time over three years, and no individual decision was wrong. The map is the honest exception — a third-party widget is not going to share a runtime with anything, and the other three coming down to eighteen kilobytes made it the largest item by a distance.