Skip to content

Align markdown-remark with Astro and test incremental rebuilds - #2033

Merged
David Pine (IEvangelist) merged 1 commit into
mainfrom
sebros/markdown-remark-astro-peer
Nov 5, 2026
Merged

David Pine (IEvangelist) merged 1 commit into
mainfrom
sebros/markdown-remark-astro-peer

Conversation

@sebastienros

Copy link
Copy Markdown
Contributor

Summary

Follow-up to #1929, carrying over the two items from the review of #1927 (now closed) that still apply to main.

  • @astrojs/markdown-remark peer range: Astro 7.4.1 declares ^7.3.0, but the site's Markdown processor in astro.config.mjs was pinned to 7.2.1. This bumps it to 7.3.4, which also moves the direct dependency onto the same @astrojs/internal-helpers version as Astro (0.13.0).
  • Second-build coverage: nothing tested incremental reuse across builds. tests/unit/incremental-build.vitest.test.ts builds a small throwaway site several times with the real experimental flags, api-cache-key.ts, og-cache-key.ts, patched Astro and the Bun runtime. It checks:
    • unchanged inputs produce byte-identical output
    • a changed API document re-renders only its own HTML and Markdown routes
    • a changed OG renderer asset re-renders only social cards
    • a new deployment commit re-renders API pages but not social cards
    • a removed document is pruned from dist and the page cache
    • an imported SVG's image metadata crosses the worker boundary and still resolves on restored pages

The test takes about 12s and needs bun on PATH, which the validation job already provides.

@astrojs/mdx@7.0.3 still depends on its own exact copy of @astrojs/markdown-remark 7.2.1, so two versions stay installed until mdx is updated. The lockfile change also moves the hoisted acorn, source-map, remark-smartypants and @astrojs/prism versions that the new markdown-remark needs; other consumers keep their previous versions nested.

Third-party links and affiliations

None.

Validation

  • bun run build:production: passed, 32,203 pages built.
  • bun run test:unit: passed (1163 passed, 1 skipped).
  • bun run lint: passed.
  • bun install --frozen-lockfile: passed.
  • Confirmed the new test fails when it should, by temporarily removing the Astro worker patch (DataCloneError), dropping og-image.png from the OG key, and removing deployment metadata from the API key.
  • Not run: E2E tests, and the test on Linux or Windows. It has only run on macOS so far.

Astro 7.4.1 declares a peer range of ^7.3.0 for @astrojs/markdown-remark,
but the site's Markdown processor was pinned to 7.2.1. Bump it to 7.3.4.

Add a regression test that builds a small site repeatedly with the real
flags, cache-key helpers, patched Astro and Bun runtime. It covers reuse of
unchanged pages, invalidation on document, renderer asset and deployment
changes, pruning of removed paths, HTML and Markdown route parity, and SVG
image metadata crossing the worker boundary.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🟢 Approval recommended

No active review issues block the Markdown dependency update and added incremental-build regression coverage.

No open issues 🎉

What changed in this PR

This follow-up to #1929 aligns the frontend’s Markdown processor with Astro’s peer dependency range and adds regression coverage for incremental builds.

Changes:

  • Updates @astrojs/markdown-remark from 7.2.1 to 7.3.4 and refreshes the lockfile while retaining MDX’s separate dependencies.
  • Adds a miniature-site test covering cache reuse, selective invalidation, removed-page cleanup, and SVG handling across prerender workers.
File Description
src/​frontend/​tests/​unit/​incremental-build.vitest.test.ts Tests repeated builds using Bun, patched Astro, and production cache-key helpers.
src/​frontend/​package.json Updates the direct Markdown processor dependency to 7.3.4.
src/​frontend/​bun.lock Records updated dependencies and preserves older versions required by other consumers.

Review effort: Balanced

@aspire-repo-bot

Copy link
Copy Markdown
Contributor

Frontend HTML artifact ready

The latest frontend build uploaded the frontend-dist artifact for PR #2033. Use the VS Code button below to open this PR with GitHub Artifacts Explorer and browse the built HTML locally.

VS Code: Open PR #2033 artifacts

This comment updates automatically when a new frontend build artifact is uploaded.

Copy link
Copy Markdown
Member

docs-pr-reviewer report — [partial — phase A: key claims evaluated; phase B: not run (docs site was not served in this automated run)]

Recommendation: needs human

Source used: n/a — dependency/tooling (pins @astrojs/markdown-remark 7.3.4; incremental rebuild test)
PR status: non-draft, mergeable, maintainer-authored (sebastienros), opened 2026-11-03 — not stale.

Phase A — claims

Phase B — doc-tester

Not run; rendering of the changed pages is not browser-checked.

🤖 Posted by aspire.dev - squad (AI Agent)

@IEvangelist
David Pine (IEvangelist) merged commit 264a00f into main Nov 5, 2026
20 checks passed
@IEvangelist
David Pine (IEvangelist) deleted the sebros/markdown-remark-astro-peer branch November 5, 2026 13:48
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.

3 participants