Skip to content

feat(hacklytics2027): move the site from Next.js to Astro - #579

Merged
aamoghS merged 5 commits into
devfrom
feat/hacklytics2027-astro
Nov 6, 2026
Merged

aamoghS merged 5 commits into
devfrom
feat/hacklytics2027-astro

Conversation

@github-actions

@github-actions github-actions Bot commented Nov 6, 2026 •

Copy link
Copy Markdown
Contributor

hacklytics2027 is a static marketing site with no database. Next shipped its React runtime to render pages that are almost entirely static. Astro renders them at build time and hydrates only what needs a browser.

What changed

  • Astro 7.4.2 + @astrojs/react 7.1.1, Tailwind 4 through @tailwindcss/vite, outDir: "out" so CI and the Firebase hacklytics target are unchanged. Astro below 7.2.8 is affected by GHSA-26w7-cxv4-gfx2 (critical).
  • Astro 7 needs Vite 8. The root "vite": "^7.3.7" override (fix(deps): bump vite to ^7.3.7 #505, a security pin for Dependabot alerts Drop the exports entry for the deleted http-security module #328-Sync dev from main #332) is unchanged; two selector overrides, "astro>vite" and "@astrojs/react>vite", give only this site vite@8.3.5. pnpm why vite -r: @query/api, root, vitest and @vitest/mocker still resolve 7.3.7; mainweb typecheck and build pass.
  • Sections, FAQ, sprites, MLH badge: rendered at build, no JS.
  • Navbar, theme toggle, bloom-on-scroll, service-worker registration: small plain scripts instead of React.
  • No-flash theme script inline in <head>, same string as before. Countdown is an inline script after the hero so it never paints "00".
  • React islands only for the flower beds (bloom count depends on the date; a click plants a flower): hero client:idle, footer and 404 client:visible, mobile menu client:media="(max-width: 1023px)".
  • firebase.json immutable-cache rule and sw.js cache-first path now match /_astro/ instead of /_next/static/.
  • typecheck is tsc --noEmit over src/: astro check cannot load TypeScript 7 (no JS API). .astro files are covered by the build.
  • Docs updated: site README, docs/sites/hacklytics2027.md, mentions in docs/architecture.md, docs/getting-started.md, root README.
  • mainweb now declares babel-plugin-react-compiler@1.0.0 itself. It uses reactCompiler: true but only ever resolved the plugin through hacklytics2027's entry; dropping that broke the web build on a clean install.

Measurements

Lighthouse 12.6.1, alternating, mobile n=5, desktop n=3, median (range), busy machine.

Next Astro
Mobile score 77 (77-83) 91 (90-97)
Mobile LCP 3538 ms 2393 ms
Mobile TBT 540 ms 239 ms
Mobile CLS 0.005 0
JS transferred 151 KB 73 KB
Desktop score 99 100
Desktop LCP 800 ms 563 ms

Mobile FCP is within noise (1263 vs 1356 ms). Numbers above are from Astro 6; a 3-run mobile recheck on Astro 7 gave score 83 vs 95, LCP 3496 vs 2383 ms, TBT 329 vs 175 ms, script 151 vs 72 KB.

Parity

  • Full-page screenshots at 402 and 1440, light and dark, clock frozen: 404 and home at 1440 identical; on Astro 7, 0.0000% differing pixels for home and 404 at both widths and themes.
  • Countdown, service worker, every outbound link vs lib/links.ts, plant-a-flower, header hide on scroll, section offsets, mobile menu (aria, inert, body lock), theme toggle with persistence and no flash, 404 status, no overflow 320 to 1440, focus ring, zero console errors.
  • <head> identical apart from the favicon cache-buster query and Next's chunk scripts being gone.
  • pnpm turbo run lint typecheck build --filter=hacklytics2027 passes.

Not verified

Real Firebase cleanUrls and headers (the PR preview channel shows them), and service-worker behaviour across a deploy.


Note

Medium Risk
Large framework swap plus new Vite 8 override paths affect build outputs and caching; regressions would surface as broken Firebase hosting or hydration gaps on the marketing site.

Overview
Summary
The Hacklytics 2027 marketing workspace drops the Next.js static-export stack for Astro 7 with @astrojs/react, @tailwindcss/vite, and a matching astro.config.mjs that still outputs Firebase’s out/ directory while only hydrating the React pixel beds.

Operational updates
Monorepo docs (README.md, docs/architecture.md, docs/getting-started.md, docs/sites/hacklytics2027.md, sites/hacklytics2027/README.md) now describe the Astro workflow, dev scripts, island strategy, and caching rules; Firebase Hosting serves /_astro/** immutably instead of /_next/static, and sites/hacklytics2027/.gitignore/.oxlintrc align with Astro tooling.

Dependencies & build tooling
Root package.json/pnpm-lock.yaml add Astro + Vite 8 overrides (astro>vite, @astrojs/react>vite), uplift LightningCSS to 1.33 with yaml peer wiring, move babel-plugin-react-compiler onto sites/mainweb, and remove Next-specific deps from hacklytics2027.

Risk note
Verify Firebase preview headers/service-worker behavior with the new asset path and ensure CI picks up the dual Vite override cleanly across workspaces.

Reviewed by Cursor Bugbot for commit dc6e8fb. Bugbot is set up for automated code reviews on this repo. Configure here.

The site is a static page with a handful of interactive spots, but the
Next export shipped about 150 KB of gzipped JavaScript (React, the App
Router runtime, an inlined RSC payload) to run them. Astro renders every
section to HTML at build time and sends script only where a visitor can
use it.

What runs where:
- Sections, sprites and the FAQ render at build time with no JS.
- Navbar, theme toggle, countdown, bloom-on-scroll and the service worker
  registrar are small plain scripts. The theme icon follows the theme in
  CSS, so it is right on first paint, and the no-flash theme script stays
  an inline script in <head>.
- The four flower beds are the only React: hero (client:idle), footer and
  404 (client:visible), and the mobile menu (client:media below 1024px).

Markup, copy, CSS, head tags, URLs, 404 page, sw.js and public files are
unchanged. Astro writes to out/, so CI and Firebase need no change except
the immutable-cache rule, which now matches /_astro/ instead of
/_next/static/ (sw.js caches the same path cache-first).

Astro 6 and @astrojs/react 5 rather than 7: the root package.json
overrides vite to 7 for the whole repo and Astro 7 needs vite 8.
typecheck is tsc --noEmit because astro check needs the TypeScript JS
API, which TypeScript 7 does not ship.
Update the site reference and README for the new commands, folder layout
and the per-piece hydration choices, and the repo-level docs that named
the old framework.
@github-actions
github-actions Bot requested a review from aamoghS as a code owner November 6, 2026 15:29
@aamoghS aamoghS changed the title Feature: feat/hacklytics2027-astro to dev feat(hacklytics2027): move the site from Next.js to Astro Nov 6, 2026

@cursor cursor Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Cursor Bugbot has reviewed your changes using default effort and found 3 potential issues.

Fix All in Cursor

❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.

Reviewed by Cursor Bugbot for commit bfa254c. Configure here.

<script>
import "../scripts/theme-toggle";
</script>
{import.meta.env.PROD && <script>import "../scripts/service-worker";</script>}

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Service worker script never bundles

High Severity

Wrapping the service-worker <script> in an import.meta.env.PROD expression leaves it unprocessed. Astro only bundles top-level <script> tags, so production HTML ships a classic script with a source import that throws and never calls register(). New visitors get no worker; the network-first page cache and offline fallback never install.

Fix in Cursor Fix in Web

Reviewed by Cursor Bugbot for commit bfa254c. Configure here.

Comment thread sites/hacklytics2027/package.json Resolved
Comment thread sites/hacklytics2027/public/sw.js Resolved
@aamoghS aamoghS closed this Nov 6, 2026
@aamoghS aamoghS reopened this Nov 6, 2026
@github-actions github-actions Bot added dependencies Pull requests that update a dependency file feature labels Nov 6, 2026
@github-actions

github-actions Bot commented Nov 6, 2026 •

Copy link
Copy Markdown
Contributor Author

Dependency Review

The following issues were found:

  • ✅ 0 vulnerable package(s)
  • ✅ 0 package(s) with incompatible licenses
  • ✅ 0 package(s) with invalid SPDX license definitions
  • ✅ 0 package(s) with unknown licenses.
  • ⚠️ 17 packages with OpenSSF Scorecard issues.

View full job summary

astro below 7.2.8 allows remote code execution through AVIF image
optimization, and 6.x has no patch. Move to astro 7.4.2 and
@astrojs/react 7.1.1.

Astro 7 needs vite 8, but the root override pins vite to ^7.3.7 to patch
Dependabot alerts for every other workspace. Rather than lift that,
two scoped overrides (astro>vite and @astrojs/react>vite, both 8.3.5)
give vite 8 to the Astro site only. mainweb, packages and tooling still
resolve vite 7.3.7.
mainweb sets reactCompiler: true, and Next resolves the compiler plugin from
mainweb's own dependencies. mainweb never declared it; it resolved only
because hacklytics2027 listed babel-plugin-react-compiler@1.0.0 and pnpm
used it to satisfy next's optional peer for the whole workspace. Moving
hacklytics2027 to Astro dropped that entry, and CI's clean install of web
then failed: "Failed to resolve package babel-plugin-react-compiler while
attempting to resolve React Compiler".

Same version as before, so the compiled output is unchanged.
@github-actions

github-actions Bot commented Nov 6, 2026 •

Copy link
Copy Markdown
Contributor Author

Visit the preview URL for this PR (updated for commit dc6e8fb):

https://hacklytics2027--pr-579-815buvvh.web.app

(expires Fri, 13 Nov 2026 16:12:40 GMT)

🔥 via Firebase Hosting GitHub Action 🌎

Sign: c48ba34db61581e25fe2978355160b5eefe0e83f

Activation deletes only cache names other than CACHE_VERSION, and it was
still hacklytics-v4. A returning visitor kept the Next.js pages and
/_next/static chunks cached under it, so an offline visit could render a
cached shell that requests scripts the Astro build no longer has. v5 makes
activation drop them.
@aamoghS
aamoghS merged commit 17c9062 into dev Nov 6, 2026
11 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

⤵️ pull dependencies Pull requests that update a dependency file feature

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant