Skip to content

Modernize the site: Nuxt 4 + TypeScript + Bun, optimized assets, GitHub Pages deploy - #1

Merged
mathhulk merged 11 commits into
developfrom
claude/vibrant-faraday-ux7zgr
Nov 22, 2026
Merged

mathhulk merged 11 commits into
developfrom
claude/vibrant-faraday-ux7zgr

Conversation

@mathhulk

@mathhulk mathhulk commented Nov 18, 2026 •

Copy link
Copy Markdown
Collaborator

Brings develop from Vue 2 / Vue CLI 4 up to a current stack, makes the site much lighter, and adds automatic deployment to GitHub Pages from main. This PR combines what was previously reviewed as a stack of seven PRs (#2–#7 are closed in favour of this one). The commits are kept in that order, so each step can still be reviewed on its own.

Stack

Before After
Framework Vue 2.6, vue-router 3 Nuxt 4 (Vue 3.5, vue-router 5, Vite), pre-rendered with nuxt generate
Language JavaScript TypeScript (strict), <script setup lang="ts"> throughout
Tooling Vue CLI 4, webpack, Babel, Yarn, ESLint 6 Bun, @nuxt/eslint (ESLint 10), nuxt typecheck
Layout CSS Bootstrap 5.0.0-alpha1 grid + utilities from cdnjs Plain CSS (flexbox, with a small columns() helper that keeps the original widths)
Reset Meyer reset 2.0 (2011) from cdnjs Modern reset after Josh Comeau and Andy Bell
Fonts Google Fonts: every weight and style of Poppins and Merriweather @nuxt/fonts: self-hosted latin Poppins in the 5 weights used, with metric-matched fallbacks
Icons Material Icons webfont + icons8 PNGs @nuxt/icon + Iconify Material Symbols, as inline SVG
Avatars mc-heads.net by username mc-heads.net by Minecraft UUID (survives name changes)
Deploy — GitHub Actions → GitHub Pages on every push to main, with lint and type-check on every PR

Performance

Before (blockeley.com) After
/campus page weight 28.4 MB, 40 requests ~0.6 MB, 26 requests
/club page weight 6.2 MB, 61 requests ~0.4 MB
Home background video 17 MB 1.85 MB, and skipped for reduced-motion and Save-Data
Images + video in the repo 80 MB 3.7 MB (WebP, sized to display)
Render-blocking third-party CSS 5 requests to 3 hosts none; critical CSS is inlined in each page

Fixes along the way

  • Leaks:
    • The Campus server-status check ran every 3 s forever, even after leaving the page. It now runs every 60 s, pauses while the tab is hidden, and stops on unmount.
    • The Club credits scrolled with a 25 ms interval that was never cleared. They're now a CSS animation at the same speed, still pausing on hover, and respecting reduced motion.
  • Navigation drift: the mobile menu had no link to Club and said "Explore" instead of "Home". Both menus are now built from one list.
  • Broken 404 link: the 404 page linked to /merchandise, which was removed on develop and itself 404s. It now links to the Club page.
  • Two latent bugs found by the type checker: a class binding to something that was never defined, and a prop and a template ref sharing a name.
  • Smaller fixes:
    • duplicate undefined keys in the timeline;
    • the web manifest's broken icon paths;
    • the scroll lock is now one CSS :has() rule instead of two components toggling a body class;
    • accent colours now come from route meta instead of a Sass map that still had colours for deleted pages.

Visible changes (everything else is pixel-identical to the live site)

  • Mobile menu: gains the Club link and says "Home" instead of "Explore".
  • 404 page: its second button goes to Club instead of the removed merchandise store.
  • Icons: Material Symbols glyphs are drawn slightly differently, and the board-role icons now take each page's accent colour.
  • Footer: 3px shorter, because block-level images remove the gap that used to sit under the inline logo.
  • Long timeline headings: they hyphenate where the browser supports it.

Merging and deploying

  1. Merge this PR into develop.
  2. Merge develop into main.
    • Expect two conflicts. main's last commit ("Remove commencement alert", 3226bdf) edited src/App.vue and src/views/Home.vue, which have since moved into app/.
    • Resolve them by deleting both files. develop had already removed the commencement alert by other means, so nothing is lost.
  3. Pages source: Settings → Pages → Source: GitHub Actions. The old pages branch has a CNAME for blockeley.mathhulk.com.
  4. DNS: point blockeley.com at GitHub Pages; it's currently served from another host behind Cloudflare. public/CNAME is already set.

After that, every push to main deploys automatically. main is the default branch, so the github-pages environment's default rule already allows it to deploy. Pull requests and pushes to other branches only lint, type-check and build.

Notes

  • Crafatar: evaluated for the avatars, but it currently returns its fallback skin with a server error for every player. The UUIDs are stored, so switching later is a one-line change in AvatarImage.vue.
  • 19th Century page: still unrouted, as it was on develop. app/views/Century.vue explains how to enable it.
  • TypeScript 7: stays on 6.0 until vue-tsc and typescript-eslint support TypeScript 7's native compiler.

Verification

  • From a clean bun install --frozen-lockfile, as CI runs it: lint, nuxt typecheck and nuxt generate pass.
  • Served the build behind a server that behaves like GitHub Pages: 200 for real pages, 404 with full content for unknown URLs.
  • Built with Vue's hydration-mismatch details on: no warnings and no console errors.
  • Screenshots at 390, 800 and 1500px on every page, compared step by step through each commit and against the live site.
  • Interaction checks:
    • mobile menu and scroll lock;
    • location full screen, Java/Bedrock toggle, scroll buttons;
    • credits pausing on hover;
    • per-page accent colour and <title>;
    • client-side navigation, including leaving the 404 page;
    • external links opening in a new tab with noopener noreferrer.

🤖 Generated with Claude Code

https://claude.ai/code/session_01DxVDmLPux3Tx7RV1v4yznD

Replace Vue CLI 4 / webpack / Babel / Yarn with Vite 8 and Bun, and move
from Vue 2 + vue-router 3 to Vue 3.5 + vue-router 5. ESLint moves to v10
with a flat config.

- index.html moves to the project root with a module entry; drop the
  link to css/style.css, which never existed
- Mount on #app, since Vue 3 no longer replaces the mount element
- Router: createRouter/createWebHistory, catch-all as /:pathMatch(.*)*,
  drop the removed `exact` prop (v4+ active matching is per route)
- Declare `emits` on components that re-emit click/close/change, so
  Vue 3 doesn't also fall the listener through to the root element
- Sass: @import -> @use, str-slice/inspect -> string.slice/meta.inspect
- Template images use absolute /images/... paths (Vite would otherwise
  try to resolve relative src attributes as modules)
- Event.vue: remove `rgba(var(--accent-color)F0)`, which modern Sass
  rejects and which browsers already ignored as invalid, so rendering
  is unchanged
- Drop the unused babel.config.js, core-js and the leftover
  shopify-buy/vuex dependencies

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01DxVDmLPux3Tx7RV1v4yznD
Assets (public/ 80 MB -> 3.7 MB):
- Re-encode every photo PNG as WebP sized to how it is displayed
  (60.9 MB -> 1.7 MB; e.g. featured locations 26 MB -> 330 KB)
- Re-encode the home background video to 720p H.264 without the
  (always muted) audio track, with faststart (17 MB -> 1.85 MB)
- Remove images nothing references anymore (articles, slides, shirt,
  history/image4)
- Lazy-load and async-decode below-the-fold images; give avatar images
  intrinsic sizes

Render-blocking third-party CSS removed (5 requests to 3 hosts):
- Bootstrap grid + utilities (~96 KB) -> the 1.6 KB of rules actually
  used, plus Meyer reset, bundled in src/styles/vendor.css
- Google Fonts (every weight/style of Poppins and Merriweather) ->
  self-hosted latin Poppins 300/400/500/700/900 via @fontsource;
  Merriweather is only loaded by the (unrouted) Century page
- Material Icons font -> an Icon component with inline SVGs for the
  seven glyphs in use

Runtime:
- Campus: the server status was fetched every 3s forever, even after
  leaving the page. Poll every 60s (mcsrvstat caches for a minute),
  skip while the tab is hidden, refresh on return, stop on unmount;
  move to the v3 API
- Club credits: replace the never-cleared 25ms setInterval scrolling
  with a compositor-only CSS transform animation at the same speed,
  still pausing on hover, and honouring prefers-reduced-motion
- Club: shuffle builders once instead of on every render
- Timeline: key events by title (club events have no warp, so every
  key was undefined)
- Location: clear the body scroll lock if unmounted while full screen

Also: meta description and theme colour, fix the web manifest's icon
paths and name, delete unused Card and News components.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01DxVDmLPux3Tx7RV1v4yznD
- Build with vite-ssg: /, /campus and /club are rendered to static HTML
  at build time (flat club.html/campus.html so Pages serves them without
  a redirect) and hydrate into the same SPA; the catch-all route is also
  rendered as 404.html, which Pages serves with a 404 status
- Critical CSS is inlined per page with beasties
- Per-page <title> via @unhead/vue, driven by route meta
- Club: shuffle the builder credits after mount so the pre-rendered
  HTML hydrates without a mismatch
- Campus: show "Checking mc.blockeley.com" until the first status
  response, instead of baking "offline" into the static HTML
- public/CNAME for blockeley.com
- .github/workflows/deploy.yml: lint + build every pull request; on
  push to develop (or manual dispatch) upload dist/ and deploy it with
  actions/deploy-pages

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01DxVDmLPux3Tx7RV1v4yznD
- Every component and view is now <script setup lang="ts"> with typed
  props (defineProps<...>), emits and slots; main, router, data and the
  Vite/ESLint configs are .ts
- Strict tsconfig (via @vue/tsconfig) plus noUncheckedIndexedAccess and
  noUnused*; shared TimelineEvent/Member types in src/types.ts, route
  meta typed through vue-router's RouteMeta, mcsrvstat response typed
- Icon names are a union derived from the SVG path map, so an unknown
  icon is a type error
- Boolean props (alternate, continue, centered, progress) are real
  booleans; callers pass the bare attribute instead of the "true" string
- `bun run build` type-checks with vue-tsc first; `bun run typecheck`
  runs it alone and CI runs it as its own step
- ESLint uses @vue/eslint-config-typescript (typescript-eslint)

TypeScript 6.0: TypeScript 7's native compiler has no JS API yet, which
vue-tsc and typescript-eslint (<6.1) both need.

Bugs the type checker found:
- Framed bound a `classObject` that was never defined
- Credits used `credits` as both the prop and the template ref name

Also works around a vite-ssg bug: its duplicate check for the <link>s it
adds never matches, so a CSS chunk the entry already links (Splash's,
now that Rolldown splits the Vue runtime into a shared chunk) got a
second non-CORS link and was downloaded twice. onPageRendered now keeps
only the first link per URL.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01DxVDmLPux3Tx7RV1v4yznD
The previous 720p encode was corrupt: decoding it reports invalid NAL
units throughout, so browsers can fail to play it or show glitched
frames. Re-encoded from the original with the same settings (720p
H.264 CRF 30, no audio, faststart, 1.85 MB); a full decode now reports
no errors.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01DxVDmLPux3Tx7RV1v4yznD
Root-cause fixes:
- Patch vite-ssg's duplicate-<link> check (`attrs.file` -> `attrs.href`)
  with `bun patch`, replacing the regex dedupe in vite.config.ts
- Page scroll lock is CSS (`body:has(.mobile-navigation,
  .location-full-screen)`) instead of two components toggling a body class
- Accent colours live in route meta and are set as --accent-color on the
  app root; the tint uses color-mix() and the blob is a mask, replacing a
  route-name-keyed SCSS map that generated a data-URL per colour (four of
  them for routes that no longer exist)
- One navigationLinks list (src/site.ts) drives both the desktop bar and
  the mobile menu, which had drifted: mobile said "Explore" and had no
  link to Club
- Campus scroll buttons use scrollIntoView + scroll-margin-top instead of
  offsetTop arithmetic

Simplifications:
- Shared URLs (Discord, Patreon, builder form) defined once in src/site.ts
- Button/LinkButton/IconButton: let @click fall through instead of
  re-emitting; drop unused props and CSS (progress spinners, IconButton
  link/colour/notification variants); IconButton is a real <button>,
  LinkButton a plain <a>
- Options uses defineModel; Campus binds v-model to "Java"/"Bedrock"
- framed-image Sass mixin replaces three copies of the image-frame CSS;
  aspect-ratio replaces padding-top ratio hacks
- Club renders both boards from one v-for; builders.ts is a plain array;
  dead .space-wrapper @extend and col-xs-12 removed
- Inline single-use computeds, v-bind="event" in Timeline, merged
  duplicated media-query blocks

Efficiency:
- Navbar/footer/mobile logo uses a 2.3 KB 160px image instead of the
  16 KB 920px one; poster re-encoded at 1280px (77 KB -> 35 KB) and
  preloaded with high priority on the home page
- Background video is fetched and played after mount, and skipped for
  prefers-reduced-motion and Save-Data
- Location is loaded on demand by Event, so /club no longer downloads it
- Server status: a tab coming back into view only refetches when the last
  check is over a minute old
- Remove unused images (logo.png, logo-light.png, seven avatar icons);
  favicon.ico moves to the site root where browsers request it

Content: the 404 page linked to /merchandise (removed on develop), which
itself 404s; it now links to the Club page.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01DxVDmLPux3Tx7RV1v4yznD
Nuxt replaces the hand-assembled Vite + vite-ssg + vue-router + unhead
setup with the mainstream, actively maintained Vue framework, and
`nuxt generate` pre-renders the site exactly as before.

- src/ -> app/ (Nuxt 4 layout): views become file-based pages
  (index/campus/club), App.vue becomes layouts/default.vue,
  PageNotFound becomes error.vue; components, styles and data move as-is
- Page title and accent colour come from definePageMeta; the error page
  passes its accent to the layout
- experimental.prerenderErrorPages renders error.vue into 404.html at
  build time, so unknown URLs still get real content with a 404 status
- nitro.prerender.autoSubfolderIndex: false keeps club.html/campus.html,
  served by GitHub Pages without a trailing-slash redirect
- Links use NuxtLink, which also handles external URLs (adding
  rel="noopener noreferrer" for new tabs), so Button no longer picks
  between <a>/RouterLink itself
- Head tags (lang, description, theme colour, icons, manifest) move to
  nuxt.config.ts; component styles are inlined into each page by Nuxt
- ESLint uses @nuxt/eslint (aware of auto-imports); `v-slot:` is now
  the `#` shorthand throughout; type-checking is `nuxt typecheck`
- Removed: vite-ssg and its patch, beasties, @unhead/vue (held on v2),
  direct vue-router/vite/@vitejs/plugin-vue, and the hand-written
  tsconfigs/ESLint setup
- CI deploys .output/public

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01DxVDmLPux3Tx7RV1v4yznD
…ns, @nuxt/fonts

- Bootstrap 5.0.0-alpha1 grid/utilities -> plain CSS: a .container
  primitive in app/styles/base.css, and each layout (section column,
  timeline, footer, board cards, location grid, navigation bar) sized in
  its own component with flexbox and a small columns() Sass function
  that keeps the original column widths
- Meyer reset (2011) -> a modern reset after Josh Comeau and Andy Bell;
  menus use role="list", and the site keeps its line-height: 1 base
  explicitly. Images are now block-level, removing the inline-image gap
  under the footer logo (footer is 3px shorter)
- Icons: @nuxt/icon with Iconify's Material Symbols (Google's successor
  to Material Icons), rendered as inline SVG at build time; replaces the
  hand-maintained Icon component and the icons8 PNG role icons, which
  required an attribution link the site didn't have. Role icons now take
  the page's accent colour
- Fonts: @nuxt/fonts serves the same @fontsource Poppins files and adds
  metric-matched fallback faces, so text doesn't reflow when the web font
  loads; Merriweather is resolved the same way when 19th Century is on
- Avatars: mc-heads.net looked up by Minecraft UUID instead of username,
  so a name change no longer breaks an avatar (images are identical).
  Crafatar was evaluated but is currently returning its fallback skin
  with a server error for every player
- Timeline uses display: flow-root to contain its events' margins (the
  Bootstrap column did this implicitly as a flex item), and event
  headings hyphenate rather than breaking mid-word under the new reset

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01DxVDmLPux3Tx7RV1v4yznD
@mathhulk mathhulk changed the title Upgrade to Vue 3, Vite and Bun Modernize the site: Nuxt 4 + TypeScript + Bun, optimized assets, GitHub Pages deploy Nov 22, 2026
main is the production branch; develop is for work in progress. Deploying
from the default branch also matches the github-pages environment's
default deployment rule, so no environment change is needed.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01DxVDmLPux3Tx7RV1v4yznD

defineProps<{
credits: readonly string[];
}>( );

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we implement prettier or some more modern oxc-based formatter to make all these files look nice?

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done in #10, using oxfmt, the Oxc project's formatter. It's Prettier-compatible, and in a comparison with Prettier on this repo the output matched apart from the default line width. It formats the Vue templates, scripts and styles, plus TypeScript, SCSS, JSON and YAML. CI now checks formatting on every PR. The rendered pages are pixel-identical before and after.


Generated by Claude Code

@mathhulk
mathhulk merged commit 5467685 into develop Nov 22, 2026
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants