From 06209dc45e4cf55ff096e72572dd78260005a289 Mon Sep 17 00:00:00 2001 From: Doxa Maps Date: Sat, 26 Sep 2026 06:49:33 +0000 Subject: [PATCH] One pinned-UMD loader for PPLR and the Wall: library/utils/loadPinnedUmd.js pplr-data-maps and the Wall each carried the same ~40-line d3 loader (pinned, SRI, and a trap that keeps the UMD from writing into a host page's own window.d3). It is now one library helper, fed from the CDN registry. check:pinned-umd (headless, gates:post): the tag carries the pinned integrity, a host's d3 gains no keys, and a failed load rejects leaving the host's d3 in place. Both bundles build. --- internal/check-pinned-umd.mjs | 50 +++++++++++++++ library/utils/loadPinnedUmd.js | 62 +++++++++++++++++++ package.json | 4 +- .../pplr-data-maps/src/utils/pplrData.js | 57 ++--------------- .../wall-of-people-groups/src/wallD3.js | 59 ++---------------- 5 files changed, 125 insertions(+), 107 deletions(-) create mode 100644 internal/check-pinned-umd.mjs create mode 100644 library/utils/loadPinnedUmd.js diff --git a/internal/check-pinned-umd.mjs b/internal/check-pinned-umd.mjs new file mode 100644 index 000000000..eb5dd9c06 --- /dev/null +++ b/internal/check-pinned-umd.mjs @@ -0,0 +1,50 @@ +#!/usr/bin/env node +/** + * check-pinned-umd — library/utils/loadPinnedUmd.js loads a pinned UMD library WITHOUT touching the host + * page's global of the same name, and sets integrity + crossorigin. Headless: a stand-in document whose + *