Skip to content
This repository has been archived by the owner on Sep 13, 2024. It is now read-only.

Releases: happo/happo-plugin-gatsby

v2.0.0-rc.3

19 Jul 18:14
Compare
Choose a tag to compare

This version adds another exported module: happo-plugin-gatsby/filter. This module can be used in gatsby-node.js to filter out pages that aren't part of the happo run.
From the README:

Additionally, if you want to speed up the gatsby build or if you're running into errors
from the happo.io API related to payloads being too large, you can limit page creation
to only the pages included in the happo run. Modify (or create) gatsby-node.js so that
it uses happo-plugin-gatsby/filter:

// gatsby-node.js
const { onCreatePage, createPageFilter } = require('happo-plugin-gatsby/filter');

exports.onCreatePage = ({ page, actions }) => {
  // The provided `onCreatePage` filter will filter out pages that aren't part
  // of the happo test suite
  onCreatePage({ page, actions });
});

exports.createPages = async ({ graphql, actions }) => {
  // The `createPageFilter` function will return a modified/proxied
  // `createPage` function that will ignore pages that aren't part of the happo
  // test suite
  const createPage = createPageFilter(actions.createPage);
  createPage({
    path: '/foo/',
    component: 'some/component/file',
  });
}

https://github.com/happo/happo-plugin-gatsby/blob/88cefbaac262f5160230da33409744364e7ad6cc/README.md

v2.0.0-rc.2

16 Jul 21:32
Compare
Choose a tag to compare

This major release will change the way this plugin works in an effort to produce more consistent screenshots, plus make them more like what a regular user would see. Instead of just using the SSR page templates, we will now send a static build to happo.io for remote rendering. This is similar to what the happo-plugin-storybook plugin does.

Installation

npm install happo-plugin-gatsby@next

Migration from v1

  • You no longer have to build a static gatsby build yourself - it is now part of the plugin itself. Remove the INSTALL_CMD to prevent building the static package twice.
  • The pagesFilter config has changed into a simple pages array. Specify the URLs you want to be part of the happo test here, e.g. pages: ['/', '/blog', '/blog/1234'].
  • The publicFolder option is now known as outputDir, and no longer require an absolute path.
  • You need to register the plugin in your application. Add import 'happo-plugin-gatsby/register' at the top of gatsby-browser.js (stored in the root of your project).