Skip to content

SSR/SSG Hybrid - #1675

Open
crutchcorn wants to merge 6 commits into
mainfrom
ssr-ssg-hybrid
Open

SSR/SSG Hybrid#1675
crutchcorn wants to merge 6 commits into
mainfrom
ssr-ssg-hybrid

Conversation

@crutchcorn

@crutchcorn crutchcorn commented Sep 8, 2026

Copy link
Copy Markdown
Member

This PR adds in the SSR / SSG hybrid flag to support #1669

Summary by CodeRabbit

  • New Features

    • Added support for server-rendered review builds while production continues using static builds.
    • Improved localized routing for invalid pages and 404 responses.
    • Added clearer handling for missing or unavailable content across pages and downloadable EPUBs.
  • Bug Fixes

    • Missing content, authors, events, collections, and posts now show localized 404 pages instead of causing errors.
    • 404 pages now return the correct HTTP status.
    • Review app health checks and runtime capacity were improved.
  • Documentation

    • Added guidance for local and deployed SSR/SSG configurations, runtime requirements, and rollout considerations.

@coderabbitai

coderabbitai Bot commented Sep 8, 2026

Copy link
Copy Markdown
Contributor

Review Change StackReview Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Advanced

Run ID: 66f14878-3eec-4698-af14-d9caa220439a

📥 Commits

Reviewing files that changed from the base of the PR and between 8b39080 and 84b1992.

⛔ Files ignored due to path filters (1)
  • src/pages/generated/projects/[slug].zip.ts is excluded by !**/generated/**
📒 Files selected for processing (27)
  • .github/workflows/fly-review.yml
  • .github/workflows/fly.yml
  • CONTRIBUTING.code.md
  • Dockerfile
  • astro.config.ts
  • docker-compose.yml
  • fly.review.toml
  • src/middleware.ts
  • src/pages/404.astro
  • src/pages/[...locale]/404.astro
  • src/pages/[...locale]/about.astro
  • src/pages/[...locale]/collections/[slug].astro
  • src/pages/[...locale]/events.astro
  • src/pages/[...locale]/index.astro
  • src/pages/[...locale]/join-us.astro
  • src/pages/[...locale]/people/[personid]/index.astro
  • src/pages/[...locale]/posts/[postid].astro
  • src/pages/[...locale]/search.astro
  • src/pages/[slug].epub.ts
  • src/pages/collections/art-of-accessibility/index.astro
  • src/pages/collections/big-bot-builders/index.astro
  • src/pages/collections/framework-field-guide-ecosystem/index.astro
  • src/pages/collections/framework-field-guide-fundamentals/index.astro
  • src/pages/collections/framework-field-guide/index.astro
  • src/pages/events/book-club.astro
  • src/pages/sitemap-0.xml.ts
  • src/views/about/utils/route-data.ts

Included review availability: Your plan provides up to 2 included reviews per hour; 1 remains after this review.


📝 Walkthrough

Walkthrough

The change adds selectable static and SSR Docker outputs, configures review apps for SSR, and keeps production static. Middleware now applies locale handling consistently. Routes validate locale and content lookups before rendering and use localized 404 rewrites.

Changes

SSR deployment and route validation

Layer / File(s) Summary
Selectable deployment outputs
.github/workflows/*, Dockerfile, astro.config.ts, docker-compose.yml, fly.review.toml, CONTRIBUTING.code.md
Builds select static or server output. Docker now provides nginx and Node runtime stages. Review apps use SSR-specific health checks and memory settings.
Localized route and middleware handling
src/middleware.ts, src/pages/404.astro, src/pages/[...locale]/*
Middleware always applies Paraglide processing. Invalid locale routes rewrite to localized 404 pages. The 404 page sets status 404.
Content lookup validation
src/pages/[slug].epub.ts, src/pages/collections/*, src/pages/events/book-club.astro
Missing, mismatched, hidden, or invalid content now returns a 404 response or rewrites to localized /404. Author lookups are resolved once before rendering.
About-page path generation
src/views/about/utils/route-data.ts, src/pages/[...locale]/about.astro, src/pages/sitemap-0.xml.ts
About-page path generation moves into a shared utility. Missing content produces no path, and the sitemap uses the shared generator.

Priority: ⬇️ Low

Estimated code review effort: 4 (Complex) | ~45 minutes

Merge Risk: ⚪ Minimal · up to 84b19

This change adds selectable SSR review deployments while retaining static production builds, and improves localized 404 and missing-content handling. No concrete current-head merge-blocking risk remains.

Sequence Diagram(s)

sequenceDiagram
  participant GitHubActions
  participant Dockerfile
  participant Runtime
  GitHubActions->>Dockerfile: Pass BUILD_OUTPUT
  Dockerfile->>Runtime: Select runtime-server or runtime-static
  Runtime->>Runtime: Serve SSR through Node or static assets through nginx
Loading
🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 2 functions across 5 files. (22 skipped: 2… Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly and concisely identifies the main change: supporting a hybrid SSR/SSG deployment model.
Full details: Docstring Coverage

Explanation

Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 2 functions across 5 files. (22 skipped: 22 unsupported.)

  • Fix all pre-merge checks with AI
✨ Finishing Touches 💡 1
📝 Generate docstrings 💡
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch ssr-ssg-hybrid

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

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.

1 participant