From a5ead74104b0048c8b4ef0462965f9a5d529f1a1 Mon Sep 17 00:00:00 2001 From: "Jorge O. Castro" Date: Tue, 31 Mar 2026 14:40:05 -0400 Subject: [PATCH 01/12] fix(flock): serve iframe-resizer child script locally to fix version mismatch The Flock contributors section was blank because contributors.html loaded @iframe-resizer/child@5.3.2 from CDN via a broken SRI hash (missing sha256- prefix), while the installed parent (@iframe-resizer/vue) is 5.5.7. Both issues caused the iframe resizer handshake to fail silently. Fix: - Add prebuild/dev cp step to copy node_modules/@iframe-resizer/child/index.umd.js to public/iframe-resizer-child.js (version-matched, no CDN dependency) - Update contributors.html to load /iframe-resizer-child.js instead of CDN URL - Add public/iframe-resizer-child.js to .gitignore (generated artifact) Fixes #530 Assisted-by: Claude Sonnet 4.6 via OpenCode Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> --- .gitignore | 3 +++ package.json | 4 ++-- public/contributors.html | 2 +- 3 files changed, 6 insertions(+), 3 deletions(-) diff --git a/.gitignore b/.gitignore index a547bf36..15c70906 100644 --- a/.gitignore +++ b/.gitignore @@ -12,6 +12,9 @@ dist dist-ssr *.local +# Generated build artifacts +public/iframe-resizer-child.js + # Editor directories and files .vscode/* !.vscode/extensions.json diff --git a/package.json b/package.json index 88bf1802..5b0ea4d1 100644 --- a/package.json +++ b/package.json @@ -4,8 +4,8 @@ "version": "0.1.0", "private": true, "scripts": { - "dev": "vite", - "build": "vue-tsc && vite build", + "dev": "cp node_modules/@iframe-resizer/child/index.umd.js public/iframe-resizer-child.js && vite", + "build": "cp node_modules/@iframe-resizer/child/index.umd.js public/iframe-resizer-child.js && vue-tsc && vite build", "preview": "vite preview", "lint": "eslint", "lint:fix": "eslint --fix", diff --git a/public/contributors.html b/public/contributors.html index faf83ba3..23f3e9ad 100644 --- a/public/contributors.html +++ b/public/contributors.html @@ -1,7 +1,7 @@ - + From ad1021b78ca31239951ca1f1bd6abf8cadfce871 Mon Sep 17 00:00:00 2001 From: "Jorge O. Castro" Date: Thu, 9 Apr 2026 01:27:44 -0400 Subject: [PATCH 03/12] =?UTF-8?q?perf(locales):=20lazy-load=20locale=20chu?= =?UTF-8?q?nks=20=E2=80=94=20index=20chunk=2060KB=E2=86=926KB=20gzip?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Remove { eager: true } from import.meta.glob in schema.ts so Vite emits each locale as a separate JS chunk instead of bundling all 13 into index.js. Changes: - schema.ts: lazy glob, SUPPORTED_LOCALES[] constant, async initI18n() - main.ts: async bootstrap — detects startup locale, calls initI18n() before app.mount() so first render is already translated - testing-main.ts: same pattern, always boots with en-US - App.vue: remove duplicate locale-detection (now in main.ts) - SceneLanding.vue: use SUPPORTED_LOCALES for language picker dropdown Build results: index.js: 184 KB raw / 60 KB gzip → 19 KB raw / 6 KB gzip (-90%) 13 per-locale chunks (~5-6 KB gzip each) now fetched on demand only Locale switching continues to work via full page reload (?lang=xx-XX). TypeScript: vue-tsc --noEmit passes. ESLint: clean. Closes projectbluefin/website#168 Ref: castrojo/copilot-config#168 (SO-2) --- src/App.vue | 9 +--- src/components/scenes/SceneLanding.vue | 9 ++-- src/locales/schema.ts | 75 +++++++++++++++++++------- src/main.ts | 23 ++++++-- src/testing-main.ts | 11 ++-- 5 files changed, 90 insertions(+), 37 deletions(-) diff --git a/src/App.vue b/src/App.vue index 7a61bbd3..aa47c3bc 100644 --- a/src/App.vue +++ b/src/App.vue @@ -16,7 +16,8 @@ import SectionPicker from './components/sections/SectionPicker.vue' import SectionVideo from './components/sections/SectionVideo.vue' import TopNavbar from './components/TopNavbar.vue' -import { i18n } from './locales/schema' +// Locale is resolved and set before mount by main.ts → initI18n(). +// App.vue no longer needs to re-apply locale logic at component setup time. const visibleSection = ref('') provide('visibleSection', visibleSection) @@ -48,12 +49,6 @@ onBeforeMount(() => { }, 100) }) }) - -const urlParams = new URLSearchParams(window.location.search) -const currentLocale = urlParams.get('lang') || window.navigator.language -if (i18n.global.availableLocales.includes(currentLocale)) { - ;(i18n.global as any).locale = currentLocale -}