Minor Changes
-
#71
e5d74f9Thanks @MohamedH1998! - Enable MDX optimization by default to reduce large-site build memory usage. Sites can opt out withmdx: { optimize: false }.Verified the generated starter with optimization on and with
mdx: { optimize: false }forced; the rendered HTML is structurally equivalent for element names, attributes, and non-whitespace text. AC#3 is treated as semantic/structural render parity rather than byte identity: raw bytes differ due to serializer escaping and inter-block whitespace, but the rendered document is lossless.Spot-checked the starter
componentspage, which includes JSX tags in prose, inline code with<...>, quoted code, and package names. The optimized and opt-out renders preserve those special-character text probes and match structurally.Constrain the supported Astro peer range to
>=7.0.0 <7.1.0 || >=7.2.0 <8.0.0: the 7.1.x line is excluded while its static-build regression is open upstream, but 7.2.x is admitted (verified against a sub-path build). Generated templates and the dev pin stay on the verified 7.0.x line. -
#76
acfac20Thanks @mvvmm! - Replaceastro-iconwith a built-in icon system. This is a breaking change for any project usingastro-icondirectly.Why:
astro-iconstamped a generatedlastModifiedtimestamp into its virtual module on every build, invalidating thousands of cached pages in Astro's incremental build cache. The package is unmaintained so an upstream fix isn't coming.What's new: Nimbus now provides
virtual:nimbus/icons(a Vite plugin) and@cloudflare/nimbus-docs/components/Icon.astro. The plugin auto-detects installed@iconify-json/*packages and loads local SVGs fromsrc/icons/. The component API is compatible withastro-icon(name,size,width,height,is:inline,title,desc, and all<svg>attributes). SVG bodies are passed throughreplaceIDsso internal IDs (clipPath, mask, gradient defs) are unique per render — preventing collisions when the same icon appears more than once on a page.Breaking changes:
- Remove
astro-iconfrom yourpackage.jsonandastro.config.ts - Replace
import { Icon } from "astro-icon/components"withimport Icon from "@cloudflare/nimbus-docs/components/Icon.astro" - SVG output structure changed: SVGs are always inlined; the previous
<symbol>/<use>pattern produced duplicate DOM IDs when the same icon was used more than once on a page, so it has been removed. Any CSS or JS targetingsymboloruseelements will need updating.
Migration:
- import { Icon } from "astro-icon/components"; + import Icon from "@cloudflare/nimbus-docs/components/Icon.astro";
Starter templates updated: removed
astro-icondependency andicon()integration fromastro.config.ts; all component imports updated to the new path. - Remove
Patch Changes
-
#77
1c49268Thanks @MohamedH1998! - FixNimbusHeademitting base-less SEO URLs on sub-path deployments (e.g.base: '/docs').new URL(path, Astro.site)resolves against the origin only and drops the configuredbase, so therel=sitemaplink, the LLM-indexrel=alternate,og:image/twitter:image, the JSON-LDisPartOf.url, the versionedcanonical, and the cross-versionrel=alternateall pointed at the origin root and 404'd under a sub-path. Every internal path handed tonew URL(..., Astro.site)is nowbase-prefixed via awithBasehelper, matching the existingBASE_URLhandling for the favicon and Shiki stylesheet.Root deployments (
base: '/') are unaffected: the helper is a no-op when no base is configured, and already-based paths pass through unchanged (idempotent). -
#80
ec71a7bThanks @MohamedH1998! - Fix syntax-highlighted code rendering uncoloured in dev on sites with a non-rootbase(e.g.base: "/docs"). The dev middleware that serves_nimbus/shiki.csscompared the request path exactly against the based asset path, but Vite stripsbasefromreq.urlat a non-root base, so the request 404'd and tokens fell back to their inherited colour. It now matches by suffix, serving the stylesheet regardless of how Vite presentsbase. Production was unaffected — the stylesheet is written statically at build time.