Skip to content

Commit

Permalink
[docs] Add breaking change in upgrade guide
Browse files Browse the repository at this point in the history
  • Loading branch information
oliviertassinari committed Jun 13, 2020
1 parent a28a218 commit bd54da9
Show file tree
Hide file tree
Showing 3 changed files with 78 additions and 0 deletions.
20 changes: 20 additions & 0 deletions docs/pages/guides/migration-v4.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
import React from 'react';
import MarkdownDocs from 'docs/src/modules/components/MarkdownDocs';
import { prepareMarkdown } from 'docs/src/modules/utils/parseMarkdown';

const pageFilename = 'guides/migration-v4';
const requireDemo = require.context('docs/src/pages/guides/migration-v4', false, /\.(js|tsx)$/);
const requireRaw = require.context(
'!raw-loader!../../src/pages/guides/migration-v4',
false,
/\.(js|md|tsx)$/,
);

export default function Page({ demos, docs }) {
return <MarkdownDocs demos={demos} docs={docs} requireDemo={requireDemo} />;
}

Page.getInitialProps = () => {
const { demos, docs } = prepareMarkdown({ pageFilename, requireRaw });
return { demos, docs };
};
1 change: 1 addition & 0 deletions docs/src/pages.js
Original file line number Diff line number Diff line change
Expand Up @@ -186,6 +186,7 @@ const pages = [
{ pathname: '/guides/composition' },
{ pathname: '/guides/server-rendering' },
{ pathname: '/guides/responsive-ui', title: 'Responsive UI' },
{ pathname: '/guides/migration-v4', title: 'Migration From v4' },
{ pathname: '/guides/migration-v3', title: 'Migration From v3' },
{ pathname: '/guides/migration-v0x', title: 'Migration From v0.x' },
{ pathname: '/guides/testing' },
Expand Down
57 changes: 57 additions & 0 deletions docs/src/pages/guides/migration-v4/migration-v4.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
# Migration from v3 to v4

<p class="description">Yeah, v4 has been released!</p>

Looking for the v4 docs? [Find them here](https://material-ui.com/versions/).

> This document is a work in progress.
Have you upgraded your site and run into something that's not covered here?
[Add your changes on GitHub](https://github.com/mui-org/material-ui/blob/master/docs/src/pages/guides/migration-v3/migration-v3.md).

## Introduction

This is a reference for upgrading your site from Material-UI v4 to v5.
While there's a lot covered here, you probably won't need to do everything for your site.
We'll do our best to keep things easy to follow, and as sequential as possible so you can quickly get rocking on v5!

## Why you should migrate

This documentation page covers the *how* of migrating from v4 to v5.
The *why* is covered in the [release blog post on Medium](https://medium.com/material-ui/material-ui-v4-is-out-4b7587d1e701).

## Updating your dependencies

The very first thing you will need to do is to update your dependencies.

### Update Material-UI version

You need to update your `package.json` to use the latest version of Material-UI.

```json
"dependencies": {
"@material-ui/core": "^5.0.0"
}
```

Or run

```sh
npm install @material-ui/core

or

yarn add @material-ui/core
```

## Handling breaking changes

### Divider

- [Divider] Use border instead of background color. It prevents inconsistent height on scaled screens. For people customizing the color of the border, the change requires changing the override CSS property:

```diff
.MuiDivider-root {
- border-color: #f00;
+ background-color: #f00;
}
```

0 comments on commit bd54da9

Please sign in to comment.