paint-brush
React Styleguidist 7.0.0- hello webpack 4, goodbye Node.js 4by@sapegin
1,583 reads
1,583 reads

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

by Artem SapeginApril 5th, 2018
Read on Terminal Reader
Read this story w/o Javascript
tldt arrow

Too Long; Didn't Read

👋 <a href="https://opencollective.com/styleguidist" target="_blank"><strong>Support Styleguidist</strong></a><strong> on Open Collective</strong> 👋

People Mentioned

Mention Thumbnail

Companies Mentioned

Mention Thumbnail
Mention Thumbnail
featured image - React Styleguidist 7.0.0- hello webpack 4, goodbye Node.js 4
Artem Sapegin HackerNoon profile picture

👋 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️! ❤️