Skip to content

Instantly share code, notes, and snippets.

@eyn
Created September 10, 2017 22:50
Show Gist options
  • Save eyn/ed581f800a3496ad2fda8ad3fa3b5cce to your computer and use it in GitHub Desktop.
Save eyn/ed581f800a3496ad2fda8ad3fa3b5cce to your computer and use it in GitHub Desktop.
Upgrade Notes for v0.x to V1

Upgrade Notes

Material-UI was started 3 years ago. The ecosystem has evolved a lot since then, we have also learned a lot. @nathanmarks started an ambitious task, rebuilding Material-UI from the ground-up taking advantage of this knowledge to address long-standing issues.

There are major breaking changes between v0.1x and v1. There is often no direct mapping from the v0.1x API to the v1 API so moving from v0.1x to v1 can require quite extensive changes. Luckily these don't all need to be done at one time and you can run v0.1x side by side with v1 while you move between versions.

Side by Side Installation

To install v1 alongside v0.1x will will create a new package material-ui-next which aliases to the v1 release and leave material-ui pointing to the 0.1x release. We can then import components as follows:

import FlatButton from 'material-ui/FlatButton'; // v0.x
import Button from 'material-ui-next/Button'; // v1.x

Using YARN

Run the following commmand:

yarn add material-ui-next@npm:material-ui@next

Peer Dependencies

Using NPM

??? Edit package.json ???

Major changes

There are several major changes which impact all components

Styling

Styles => withStyles

Icons

Ontouch Tap

Events

OnTouchTap -> OnClick

Individual Components

AppBar

AutoComplete

### Avatar

Badge

BottomNavigation

FlatButton

<FlatButton label="Label" primary onTouchTap={handleTouchTap} />
<Button color="primary" onClick={handleClick}>Label</Button>

RaisedButton

FloatingActionButton

IconButton

Card

Chip

DatePicker

Dialog

Divider

Drawer

GirdList

Icons

List

Menu

IconMenu

DropDownMenu

Paper

Popover

Progress

SelectField

Slider

Checkbox

RadioButton

Toggle

Snackbar

Stepper

Subheader

Table

Tabs

TextField

TimePicker

ToolbarGroup

ToolbarGroup

Removed

IconMenu

Convert to IconButton and Menu

material-ui/svg-icons

NavigationMoreVert => MoreVert in material-ui-icons

MenuItem

PrimaryText => children

Subheader => ListSubheader

Drawer => Drawer

type="persistant" onRequestChange => onRequestClose

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment