Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[core] Flatten the import path #11330

Merged

Conversation

oliviertassinari
Copy link
Member

@oliviertassinari oliviertassinari commented May 11, 2018

This pull-request was time-consuming, so many lite changes to make 🤖. Closes #9532

Breaking change

Motivation

  1. It's a simple pattern to learn. People won't need to go back and forth with the documentation to learn the import paths 💭.
  2. People bundle size will decrease 🚀.
  3. In an ideal world, we would import everything from the root module and tree sharking would be taken care of for us. This change doesn't matter in this world ☮️.
import {
  Table,
  TableBody,
  TableCell,
  TableFooter,
  TablePagination,
  TableRow,
} from 'material-ui';

The diff

-import CircularProgress from '@material-ui/core/Progress/CircularProgress';
+import CircularProgress from '@material-ui/core/CircularProgress';
-import { ListItem } from '@material-ui/core/List';
+import ListItem from '@material-ui/core/ListItem';

Upgrade path

We provide a codemod to automate the migration: https://github.com/mui-org/material-ui/tree/master/packages/material-ui-codemod#import-path. I have used it to upgrade all the demos in the documentation :).

@oliviertassinari oliviertassinari force-pushed the flatten-the-folder-structure branch 4 times, most recently from 52af5d6 to d5f2bf9 Compare May 11, 2018 22:52
@oliviertassinari oliviertassinari force-pushed the flatten-the-folder-structure branch from d5f2bf9 to 36203d6 Compare May 11, 2018 23:10
@oliviertassinari oliviertassinari merged commit f4be182 into mui:v1-beta May 11, 2018
@oliviertassinari oliviertassinari deleted the flatten-the-folder-structure branch May 11, 2018 23:24
@koutsenko
Copy link

codemod fails when using experimental features in src like export from.

@jjwilliams42
Copy link

The link you provided is a 404

@oliviertassinari
Copy link
Member Author

@jackjwilliams I have updated the link.

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

Successfully merging this pull request may close these issues.

3 participants