Skip to content

v1.7.1

Choose a tag to compare

@github-actions github-actions released this 22 Jul 20:03
135e182

What's Changed

Added

  • is-styleguide-render on <html> for every component and page render. A
    component's JS sometimes has to know it is being previewed rather than served
    live — to skip page-load choreography a screenshot would otherwise catch
    mid-flight, or to lift a production-only guard. The renderer is the only layer
    that knows this for a fact, so consumers should not have to derive it.
    Without the class the reachable signal is location.pathname, and two real
    components in a downstream project ended up testing
    startsWith('/styleguide/render/') — which couples them to this package's
    ROUTING and would break silently the day a route moves, with no failing test
    to say so.

    Emitted unconditionally, with no iframe config required, and it composes
    with iframe.html_class / the dark theme class rather than replacing them.
    Consumers on an older version can seed the same class through
    iframe.html_class, so the check reads identically either way and needs no
    version branch.

    Two worked cases from the project that prompted this: a hero whose reveal is a
    1000 ms setTimeout plus a 0.5 s transition (the suite shoots ~1.5 s earlier
    and captured a blank frame), and vanilla-cookieconsent, whose default
    hideFromBots matches navigator.webdriver and therefore hides from every
    automated browser — correct in production, a blank baseline in a preview.

    The 404 render is deliberately untouched: it is the package's own error page,
    not a consumer's component, and nothing of theirs runs inside it.

Pull Requests

  • #102 — feat(render): announce the styleguide context on

Full Changelog: v1.7.0...v1.7.1