Repository navigation
Releases
Releases · sayakmukherjee080/snappy-prerender
v2.12.3
Changed
- Rebuilt the README and added focused docs for configuration, head metadata, hydration, output, locales and audit. No runtime changes.
Full changelog: https://github.com/sayakmukherjee080/snappy-prerender/blob/main/CHANGELOG.md
v2.12.2
Changed
- Cleaned up changelog formatting so GitHub renders release notes without manual line breaks. No runtime changes.
Full changelog: https://github.com/sayakmukherjee080/snappy-prerender/blob/main/CHANGELOG.md
v2.12.1
Changed
- Shortened the feature summary in the README and demo. No runtime changes.
Full changelog: https://github.com/sayakmukherjee080/snappy-prerender/blob/main/CHANGELOG.md
v2.12.0
Added
llmsTxtgenerates anllms.txtroute index with sections, page titles, descriptions and links.- The object form accepts
file,title,description,include,excludeandmaxRoutes. - CLI flags:
--llms-txt,--llms-txt-fileand--llms-txt-max-routes. report.llmsTxtrecords the file, route count, sections and listed URLs.
Changed
llms.txtis rebuilt on cached runs and skipped for dry runs and image output.
Full changelog: https://github.com/sayakmukherjee080/snappy-prerender/blob/main/CHANGELOG.md
v2.11.4
Changed
- Expanded the README feature summary to cover the full 2.11 feature set: framework
support, prerendering and routing, Playwright rendering, hydration verification, SEO
and discovery, locales, incremental builds, output optimisation, vendor assets and
state capture, auditing, operations and interfaces. No runtime behaviour changed.
Full changelog: https://github.com/sayakmukherjee080/snappy-prerender/blob/main/CHANGELOG.md
v2.11.3
Added
- Incremental prerendering with
incremental: true(revalidate),incremental: 'trust'
andincremental: false. Unchanged routes are restored from a persistent cache instead
of being rendered again. - Per-route dependency fingerprints for source HTML, referenced JS/CSS, local asset
existence, output configuration and the written page hash. Cached HTML lives outside
dist, so a normal Vite, CRA or static build can replace the output directory without
losing reusable pages. - API response revalidation for recorded
GET/HEADrequests. Shared endpoints are
deduplicated,ETag/Last-Modifiedconditional requests are used when available, and
a changed body hash renders only the routes that depend on it. Requests with
Authorization, non-GET methods, oversized bodies, streaming, or failed responses are
never replayed and always render. incremental.cachePath,incremental.maxAge,incremental.lockTimeout,
incremental.exclude,incremental.data.hosts,incremental.data.maxBytesand
routeOverrides[].incremental.- A cache lock beside the cache file stops two builds from writing or pruning the same
cache at once. The default fails fast with the owning pid;incremental.lockTimeout
waits for a bounded time, and a lock left by a dead process is reclaimed. - Cache maintenance now prunes unreferenced root HTML pages, generated state and SEO
scripts, and vendored assets and manifests, so removed routes and changed assets do
not accumulate in the cache directory. - A capped crawl (
maxRoutes) writes the accepted routes to the incremental cache
instead of discarding the whole cache entry, so route priority and cache reuse work
together. - Asset localization with
vendorAssets: download allowlisted CSS, fonts, images and
optionally scripts into content-hashedsnappy-assets/files and rewrite HTML, CSS
@import,url(),srcset, style attributes and inline<style>references. vendorAssets.hosts,vendorAssets.types,vendorAssets.maxBytes,
vendorAssets.onError(warn/fail) andvendorAssets.failOnExternalAssets.- Vendored asset source hashes participate in incremental revalidation. Local vendor
files, generated state scripts and SEO locale scripts are cached and restored. - CLI flags for incremental caching, data revalidation limits, asset localization and
the self-contained asset gate.
Changed
preloadLinksnow reads script hints from the final document and merges them with
runtime-loaded chunks, so localized and dynamically imported scripts both get hints.- Verification skips cached routes and records whether a route was verified; intentionally
skipped hydration routes remain reusable.
Fixed
- Routes whose vendor download failed under
vendorAssets.onError: 'warn'are not written
to the incremental cache, so the next build retries the download instead of reusing a
page with an external asset. inlineCss: 'inline'no longer fetches cross-origin stylesheets during the render pass,
which previously made the route uncacheable and left the localized CSS as a link. Local
snappy-assets/stylesheets, including localized@importrules, are inlined after
asset localization.- Concurrent routes that reference the same vendored asset now share one in-flight write
instead of racing on the same temporary file.
Security
- Vendor downloads enforce the host allowlist, redirect re-checks, private-host rejection
unless explicitly allowlisted, TLS validation, per-asset byte limits and content-type
checks. A response whose content type does not match the requested CSS, script, font or
image kind is refused instead of being written as a local asset. API response bodies and
credentials are never written to the cache.
Full changelog: https://github.com/sayakmukherjee080/snappy-prerender/blob/main/CHANGELOG.md
v2.11.1
Added
drift,baselinePathandfailOnDriftstore a per-route baseline and report added,
removed, moved, changed, HTML-only and status-changed routes.htmlHashfor the exact written file andcontentHashfor a normalized fingerprint of
visible text, SEO metadata, links, images and JSON-LD. Ordinary script and style changes
do not count as content drift.report.driftwith per-routedriftStatusanddriftReasons, plus a baseline schema in
docs/report.md. The JSON report version is now 2.sitemapLastmodadds<lastmod>from the baseline. New and content-changed routes get the
build date; unchanged and HTML-only routes keep their previous date.- CLI flags
--drift,--baseline,--fail-on-drift,--fail-on-drift-statusand
--sitemap-lastmod.
Changed
- Baselines are written only after a complete, non-dry run. Incomplete builds and failed
failOnDriftruns keep the old baseline and preserve previous sitemap dates. - A baseline is kept outside the output directory by default so
cleanDestinationcannot
delete it.
Fixed
- Sitemap
lastmoduses the real build start instead offreezeTime, so a fixed content
clock no longer prevents deployment dates from advancing. - A failed
failOnDriftrun keeps the previous baseline, so the next run still compares
against the last accepted build.
Full changelog: https://github.com/sayakmukherjee080/snappy-prerender/blob/main/CHANGELOG.md
v2.8.1
Changed
- README now includes the Product Hunt launch badge. No runtime behaviour changed.
v2.8.0
Added
freezeTime,timezoneandrandomSeedmakeDate/Date.now()and optional
Math.random()deterministic across render and verification.SOURCE_DATE_EPOCHis
honoured, and pages can readwindow.__SNAPPY_NOW__/window.__SNAPPY_NOW_ISO__.hydration.allowRerenderandhydration.skip, plusrouteOverrides[].hydration, let
explicitly dynamic routes re-render without being reported as failures.localesadds path or single locale modes with automatic<html lang>, canonical,
og:locale,og:locale:alternate, self/alternate/x-defaulthreflang, sitemap
alternates, translated route maps and hreflang audit rules.seoLocaleseeds a cookie orlocalStoragelocale before render and verification, and
optionally writes a pre-app bootstrap into the output. It supports localStorage, cookie
or both,overwrite,navigator,forceHtmlLang, route scoping, CSP hash and strict
externalization.- CLI flags for the clock, hydration policies, simple locale matrices and SEO locale.
- Report fields for the fixed clock, locale counts, per-route locale, hydration policy,
allowed re-renders, ignored hydration errors and generated locale scripts. Headacceptstagsfor arbitraryscript,style,noscriptandbaseelements,
with attribute objects, text, trustednoscriptHTML and explicit keys.HeadacceptshtmlAttributes,bodyAttributesandtitleAttributes, restoring the
document's original attributes when no Head wants them.HeadacceptsdefaultTitle, multipleimagesand multiplealternateLocales; repeated
same-nameextrametas can opt into duplicates. These replace the client-side surface of
React Helmet and React Helmet Async.HeadacceptsonChangeClientStatefor observing added, removed and changed entries
after real DOM updates.- React 19 native
<meta>and<link>tags are adopted and updated instead of
duplicated. A correct native<title>is left to React so navigation can remove it, while
older template titles are removed. - The head entry documents
HeadProps,HeadTag,HeadAttributesandHeadChangewith
JSDoc types; the package remains plain JavaScript and adds no TypeScript files.
Changed
- Final HTML processing uses one parsed document for preload injection, CSP hashes,
page metadata and preload resources instead of reparsing after each step. - Render and verification use fewer Playwright round trips.
- Route writes, audit link checks, destination copies and sitemap-index fetches run with
bounded concurrency; route reports are merged in deterministic order. - Preload hints are sorted, so repeated builds do not reorder modulepreload links.
- Inline stylesheet text and critical CSS processor state are cached within a run.
- Relative route-source loading and browser/server startup overlap where safe.
- The JSON report includes phase timings, and
npm run benchmarkmeasures large sites. reuseVerificationContextoptionally reuses one browser context per verification worker.- A not-found page's generated noindex replaces an existing robots directive instead of
adding a second meta tag.
v2.7.0
Added
- Site audit for route health, links, metadata, sitemap and CSP. Findings are report-only
unlessfailOnAuditErroris set;auditIgnoreLinksexcludes dynamic links. reportPath/--reportwrites a versioned JSON report with per-route records, audit,
verification, sitemap, preload manifest, truncation and traces.routesFileandroutesFromSitemapseed routes from text, JSON or a sitemap. Sitemap
indexes are followed one level, and relative paths resolve against the config file.- Deterministic BFS crawling when
maxRoutesorroutePriorityis set.
truncated.droppedRouteslists the routes that did not fit. routeOverridesfor per-route timeout, wait, readiness, crawl and storage state.transformHtml, sync or async, runs before preload and CSP injection.- Framework detection for React, Vue, Svelte and Preact, with framework-specific hydration
messages andfirstMismatchdetails. preloadLinksfor runtime chunks, fonts and the LCP image.- Sitemap hreflang alternates, image entries and
sitemap.locsin the report. - Head JSON-LD,
lang/dirand hreflang alternates. - App-declared 404 pages via
<meta name="prerender-status-code" content="404">. csp: 'hash'adds a meta policy with SHA-256 hashes for inline scripts and styles.retries,retryDelayandtraceOnErrorfor failed renders.initmigration for a legacyreactSnapblock.- CLI flags and documentation for the new options.
Changed
- Verification reports the detected framework and uses its hydration message patterns.
- SVG
<title>elements are no longer counted as page titles. - Page metadata, audit findings and sitemap entries use the final HTML after transform and
preload injection. - Route sources resolve relative paths against the config file. Sitemap base and origin
handling is stricter. - The JSON report includes the verification summary, uses crawl acceptance order for
order, and redacts credentials, query strings and the storage-state path.
Fixed
- A configured
notFoundRoutemay return HTTP 404 and is still written as404.html;
verification accepts that status for the same route. - An explicit
frameworkselects its hydration message patterns during verification. - A non-string
transformHtmlresult fails that route with a clear error. routeOverridesignores undefined values instead of clearing base settings.audit.linksCheckedcounts every link pair considered, and route-health findings are
included in the audit.preloadLinksdoes not preload scripts removed byremoveScriptTagsortransformHtml.- CSP hash mode warns when the generated policy blocks a browser request.
initnormalises a single-stringreactSnap.include.- The image sitemap collects
srcsetand<picture><source>candidates. - New no-op option combinations produce configuration warnings.