A configurable prerendering system for Harper that serves crawler/bot traffic with prerendered, cacheable HTML. This is a monorepo with two packages:
| Package | What it is |
|---|---|
@harperfast/prerender |
The Harper plugin: bot HTTP handler, render queue/scheduler, sitemap ingestion, and page cache. Fully configurable via the host app's config.yaml. |
@harperfast/prerender-browser |
The render browser: a Puppeteer-based service that claims jobs from the plugin's queue, renders pages in headless Chrome, and posts the HTML back. Per-site rendering is configurable. |
The plugin runs inside Harper; the render browser runs as one or more separate worker processes that connect to it over HTTP/MQTT.
packages/
plugin/ @harperfast/prerender (Harper plugin — JavaScript)
browser/ @harperfast/prerender-browser (render service — TypeScript)
This repo uses npm workspaces.
npm install # install both packages
npm run lint # lint everything
npm test --workspaces # run package testsSee each package's README for configuration and usage:
The plugin's securityToken and the client's RENDERER_BYPASS_* settings must match for the origin
to authenticate the renderer.
Both packages live in monorepo subdirectories, and npm can't install a subdirectory from a plain git URL — so they are distributed as GitHub Release tarballs and consumers reference the asset URLs.
-
On a branch, make changes and verify:
npm run lint npm run format:check npm test --workspaces -
Bump the version of the package(s) you changed (
packages/plugin/package.jsonand/orpackages/browser/package.json) following semver. -
Merge to
mainand push. -
Tag and create the release (use the bumped version):
git tag -a v0.1.0 -m "v0.1.0" git push origin v0.1.0 gh release create v0.1.0 --generate-notesPublishing the release triggers
.github/workflows/release.yml, which builds and attachesharperfast-prerender-<version>.tgzandharperfast-prerender-browser-<version>.tgzas release assets.
Point the dependency at the release asset URL:
The render service references harperfast-prerender-browser-<version>.tgz the same way. Anonymous
npm install of these URLs requires the repo to be public (a private/internal repo's release
assets need an authenticated download).
Apache-2.0