Skip to content

v1.3.0

Choose a tag to compare

@harper-joseph harper-joseph released this 30 Jun 19:07
709be32

@harperfast/prerender-browser v1.3.0

Configurable hydration capture for JS-heavy sites (Bazaarvoice reviews, Curalate UGC,
Slick carousels). All new options are opt-in — defaults reproduce prior behavior, so
existing deployments render exactly as before.

New config options

Navigation / wait

  • navigation.domStableMs / domStableTimeoutMs / domStablePollMs / domStableTolerance
    wait until the (shadow-aware) DOM element count holds steady instead of relying solely on
    network-idle. Reliable "content is done" signal for widgets that begin loading after a
    network lull. domStableMs: 0 (default) disables it.

Scroll

  • scroll.settleUntilStable + scroll.settleStablePasses — loop full scroll-passes (with a
    network-idle wait between each) until the DOM stops changing, instead of a single
    scroll-to-bottom. Keeps IntersectionObserver-lazy widgets in view long enough to finish
    loading (review lists, UGC carousels) before the snapshot. Bounded by domStableTimeoutMs.

Resource blocking

  • block.stubImages — answer blocked image requests with a 1×1 transparent GIF (HTTP 200)
    instead of aborting. Lazy-loaders that fall back to a placeholder on load error (e.g.
    Slick) keep their real src URLs, so the serialized HTML retains real image URLs and shows
    no broken-image placeholders — at ~43 bytes per image.

Post-processing

  • postProcess.resolveLazyImages — copy a real URL from data-lazy / data-src /
    data-original / srcset into src for images that never received one (off-screen
    carousel/grid slides), so they load when the page is served.
  • postProcess.flattenShadowDom — inline open shadow roots into the light DOM (with
    host-scoped CSSOM/:host rule rewriting) so content rendered in shadow DOM — which
    outerHTML omits — is serialized, without the shadow's CSS leaking onto the rest of the page.
  • postProcess.stripBlockedResources — remove resource elements (img/iframe/script/…) whose
    URL matches a block.urlPatterns entry from the serialized output, so ad/RUM/analytics
    pixels don't fire (or error) when the cached page is loaded.

Notes

  • No breaking changes. 15/15 existing tests pass.
  • dist/ is built at release time (gitignored); the tarball workflow runs npm run build.