React Styleguidist 7.0.0- hello webpack 4, goodbye Node.js 4

Written by sapegin | Published 2018/04/05
Tech Story Tags: javascript | design-systems | components | react | style-guides

TLDRvia the TL;DR App

đź‘‹ Support Styleguidist on Open Collective đź‘‹

I’m happy to announce a new major release of React Styleguidist.

Webpack 4 support

Webpack 3 is still supported too.

Node.js 6 is the lowest supported version

Styleguidist won’t work with Node.js 4 anymore.

Examples are wrapped in React.Fragment

You don’t need to wrap multiple JSX tags in a div anymore.

// 6.x<div>  <Button primary>Primary button</Button>  <Button secondary>Secondary button</Button></div>// 7.x<Button primary>Primary button</Button><Button secondary>Secondary button</Button>

Fragment JSX syntax also works:

// 7.x<>  <Button primary>Primary button</Button>  <Button secondary>Secondary button</Button></>

New format of the template option

We’re now using mini-html-webpack-plugin and @vxna/mini-html-webpack-template instead of html-webpack-plugin. This will make things like adding a favicon or fonts from Google Fonts much easier.

If you’re using a custom HTML template, you need to update your style guide config. Instead of:

// 6.xmodule.exports = {  template: './styleguie/template.html'}

You need to use something like this:

// 7.xmodule.exports = {  template: {    favicon: 'https://assets-cdn.github.com/favicon.ico'  }}

Or like this:

// 7.xmodule.exports = {  template: {    head: {      links: [        {          rel: 'stylesheet',          href: 'https://fonts.googleapis.com/css?family=Roboto'        }      ]    }  },  theme: {    fontFamily: {      base: '"Roboto", sans-serif'    }  }}

There are a few more changes, see a full change log.

❤️ Huge thanks to Andrey Okonetchnikov, Nikolay Burlov, Rubén Moya and others for help with this release️! ❤️


Written by sapegin | Web developer, award-losing photographer and dog friend.
Published by HackerNoon on 2018/04/05