v3.1.0
Changelog version 3.1.0
Changelog v3.1.0
Feature
- Feature:
- Author: @jesusalcaladev
- Commit:
ed84f8a
PluginContext.outDir— new readonly property exposing the build output directory (e.g.,'dist/') to plugin lifecycle hooks, eliminating the need for plugins to hardcode output paths--turbomode forboltdocs build— Sätteri-powered build pipeline with native WASM parsing, critical CSS extraction, and Shiki syntax highlighting- Available via CLI:
boltdocs build --turbo - Native WASM MDX parser (satteri) replaces @mdx-js/rollup for faster compilation
- Critical CSS extraction via zig-critters (WASM) removes unused CSS
- Shiki syntax highlighting with dual light/dark themes
- Remark/rehype plugin adapter layer supports standard unified plugins (e.g. mermaid)
- Fallback to standard MDX compiler if satteri fails
- Collections hooks API — simplified hooks for collection data access
usePosts(collection?)— defaults to"blog", returns all filtered postsusePost()— reads current post from context insidepost.tsxuseRecentPosts(collection?, count?)— defaults to"blog"with count of 5- Removed
useCollectionList(was redundant) - Feature Flags & Drafts — control page visibility per environment
draftsconfig:{ visible?: boolean, environments?: string[] }— control draft visibilityfeatureFlagsconfig:Record<string, boolean | string>— define flags, pages declare required flags- Draft badge in navbar when viewing draft pages
BOLTDOCS_DRAFTS=trueenv var to force draft visibility- PostHog integration — built-in analytics support for PostHog
- Config:
integrations.analytics.posthog.apiKey(required),host(optional, defaults to US cloud) - Session recording and autocapture off by default (opt-in via config)
- EU cloud support:
host: 'https://eu.i.posthog.com' - Injects PostHog JS snippet into
<head>at build time (production only) - Client-side detection via
window.posthoginuseAnalytics()hook - Locale switching bug: Switching languages on collection pages (e.g.,
/blog) now correctly navigates to the localized version (e.g.,/es/blog) instead of redirecting to/docs - Vercel analytics script fix:
vercel.analyticsandvercel.speedInsightsnow default totrueif not specified in config, preventing accidental omission of analytics scripts - Native parser binary path lookup now includes
bdocs-parseras a local fallback - Removed
build:wrapperscript fromzig-critterspackage.json (was broken) - Fixed
mainfield inzig-critters/package.jsonto point towasm/index.mjs - Critical regex fix:
__staticRouterHydrationDatascript removal regex was crossing</script>boundaries, eating the entire HTML structure (missing<body>,</head>,id="root"). Added negative lookahead(?!<\/script>)to prevent matching across script tags. - Locale bug fix:
DefaultCollectionListnow usesusePosts()which filters by current locale/version instead ofuseLoaderData()which bypassed filtering - Turbo mode fixes: Shiki syntax highlighting now produces correct HTML with merged class attributes; CSS parser handles escape sequences and edge cases in selectors; WASM memory model uses arena allocation for reliability
--turboperformance fixes: Fixed 5 issues causing turbo+cache to be slower than default mode:- Server build now correctly skips when client code is unchanged (was always running)
computeClientCodeHashno longer scans monorepo directories (packages/, scripts/, etc.)- Beasties critical CSS engine now skipped in turbo mode (uses zig-critters only)
- Config resolution no longer runs twice in build pipeline
- Turbo flag now propagated through entire pipeline to
generateRoutes useLocalizedTohome link fix:site:/now resolves to/${activeLocale}instead of bare/when i18n is enabled, ensuring the navbar home button stays in the current localeuseI18ncollection locale switching fix: Switching locale from a blog post page (/blog/en/post) now correctly produces/blog/es/postinstead of/en/blog/es/postuseI18ncollection list locale switching fix: Switching locale from a collection root page (e.g.,/blog) no longer navigates away — collection root URLs are locale-independent- SSG SEO meta tags fix: Blog post pages and other content pages now correctly render per-page
<title>,og:title,og:description, andog:imagemeta tags in the static HTML. Previously, react-helmet-async'sHelmetProviderwas not populating the helmet context becauseisDocumentevaluated totruein the SSG context (jsdom active). Fixed by forcingHelmetProvider.canUseDOM = falseand using synchronousrenderToStringto guarantee Helmet lifecycle methods complete before HTML is serialized. - Duplicate meta tags cleanup: Removed redundant generic
og:title,og:description,og:image,twitter:*,og:type,og:url,canonical, and<title>frominjectHtmlMeta(). These were duplicates of what Helmet renders per-page viadata-rhattributes. Each page now has a single set of SEO meta tags managed by react-helmet-async. - Beasties disabled: Critical CSS inlining via Beasties is now disabled by default. HTML pages no longer contain ~37 KB of inlined
<style>tags. CSS loads once via external<link>and is cached by the browser. Reduces total HTML output by ~7.3 MB across all pages. - Duplicate
crossoriginattribute fixed: The regex that addscrossoriginto<link rel="stylesheet">now uses a negative lookahead to avoid duplicating the attribute when it's already present. - Duplicate EN locale removed:
generateI18nFallbacks()now skips the default locale when generating fallback routes. Previously, English content was duplicated at both root level (/docs/api/cli) and locale-prefixed (/docs/en/api/cli), resulting in ~8 MB of identical HTML files. - Inline code styling fix: Added missing styles for inline
<code>elements (backtick text). Previously, inline code rendered as plain unstyled text with no visual distinction. Now applies background, terracotta text color, padding, border-radius, and monospace font using the existing--color-code-bgand--color-code-texttheme variables. useLocalizedTodefault locale prefix fix: Links like/docs/guidesno longer incorrectly get prefixed with the default locale (e.g.,/docs/en/guides). The hook now skips adding the locale prefix whenactiveLocale === defaultLocale, matching the behavior of the route generation system. Also fixessite:/root links for the default locale.- Browser tab title fix: The
<title>tag now renders correctly in the browser tab. Previously,helmet-compat.tsxunconditionally setHelmetProvider.canUseDOM = false, preventing Helmet from updatingdocument.title. Now the flag is only set during SSG rendering (via__BOLTDOCS_SSG_RENDERING__global), allowing Helmet to manage the title on client-side navigation.
Bug Fix
- Updated dependencies [, ]:
- Commit:
1e726e1
- Commit:
- @bdocs/parser@1.1.0
- @bdocs/ssg@0.2.0
Last updated on October 18, 2026