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

[docs] Change imports from @material-ui/styles to @material-ui/core/styles #17447

Merged
merged 12 commits into from
Oct 4, 2019

Conversation

mnemanja
Copy link
Contributor

@mnemanja mnemanja commented Sep 16, 2019

Closes #17387
Closes #15867

@mui-pr-bot
Copy link

mui-pr-bot commented Sep 16, 2019

Details of bundle changes.

Comparing: 9122b60...0f05e13

bundle Size Change Size Gzip Change Gzip
LinearProgress -- 65.6 kB -- 20.3 kB
@material-ui/core[umd] ▲ +24 B (+0.01% ) 306 kB ▼ -31 B (-0.04% ) 87.9 kB
Link -- 66.9 kB -- 21.1 kB
@material-ui/core ▲ +46 B (+0.01% ) 346 kB -- 94.8 kB
@material-ui/lab -- 144 kB -- 44.9 kB
@material-ui/styles -- 51.8 kB -- 15.6 kB
@material-ui/system -- 15.6 kB -- 4.35 kB
AppBar -- 64.2 kB -- 20 kB
Avatar -- 62.6 kB -- 19.6 kB
Backdrop -- 67.8 kB -- 20.9 kB
Badge -- 65.6 kB -- 20.2 kB
BottomNavigation -- 62.4 kB -- 19.5 kB
BottomNavigationAction -- 75.4 kB -- 23.8 kB
Box -- 70.7 kB -- 21.3 kB
Breadcrumbs -- 68.3 kB -- 21.3 kB
Button -- 79.6 kB -- 24.6 kB
ButtonBase -- 73.9 kB -- 23.1 kB
ButtonGroup -- 64.5 kB -- 20 kB
Card -- 62.9 kB -- 19.6 kB
CardActionArea -- 75 kB -- 23.6 kB
CardActions -- 62 kB -- 19.3 kB
CardContent -- 62 kB -- 19.3 kB
CardHeader -- 65.4 kB -- 20.4 kB
CardMedia -- 62.4 kB -- 19.5 kB
Checkbox -- 81.9 kB -- 25.7 kB
Chip -- 71 kB -- 21.8 kB
CircularProgress -- 64.4 kB -- 20.1 kB
ClickAwayListener -- 3.91 kB -- 1.59 kB
Collapse -- 67.8 kB -- 20.9 kB
colorManipulator -- 3.83 kB -- 1.52 kB
Container -- 63.4 kB -- 19.7 kB
CssBaseline -- 57.6 kB -- 18 kB
Dialog -- 82.5 kB -- 25.6 kB
DialogActions -- 62.1 kB -- 19.4 kB
DialogContent -- 62.2 kB -- 19.4 kB
DialogContentText -- 64.3 kB -- 20.1 kB
DialogTitle -- 64.6 kB -- 20.2 kB
Divider -- 62.6 kB -- 19.6 kB
docs.landing -- 54.3 kB -- 14.3 kB
Drawer -- 84.4 kB -- 26.1 kB
ExpansionPanel -- 71.1 kB -- 22.1 kB
ExpansionPanelActions -- 62.1 kB -- 19.4 kB
ExpansionPanelDetails -- 61.9 kB -- 19.3 kB
ExpansionPanelSummary -- 78.2 kB -- 24.6 kB
Fab -- 77 kB -- 23.9 kB
Fade -- 23.1 kB -- 8.06 kB
FilledInput -- 73 kB -- 22.6 kB
FormControl -- 64.8 kB -- 20 kB
FormControlLabel -- 65.8 kB -- 20.5 kB
FormGroup -- 62 kB -- 19.3 kB
FormHelperText -- 63.3 kB -- 19.7 kB
FormLabel -- 63.2 kB -- 19.5 kB
Grid -- 65.1 kB -- 20.3 kB
GridList -- 62.5 kB -- 19.5 kB
GridListTile -- 63.9 kB -- 19.9 kB
GridListTileBar -- 63.2 kB -- 19.7 kB
Grow -- 23.7 kB -- 8.18 kB
Hidden -- 66.4 kB -- 20.7 kB
Icon -- 63.1 kB -- 19.6 kB
IconButton -- 76.3 kB -- 23.7 kB
Input -- 72.1 kB -- 22.5 kB
InputAdornment -- 65.4 kB -- 20.5 kB
InputBase -- 70.3 kB -- 22 kB
InputLabel -- 65.1 kB -- 20.2 kB
List -- 62.4 kB -- 19.3 kB
ListItem -- 76.8 kB -- 24 kB
ListItemAvatar -- 62.1 kB -- 19.4 kB
ListItemIcon -- 62.2 kB -- 19.4 kB
ListItemSecondaryAction -- 62 kB -- 19.3 kB
ListItemText -- 65.2 kB -- 20.4 kB
ListSubheader -- 63 kB -- 19.7 kB
Menu -- 88.4 kB -- 27.6 kB
MenuItem -- 77.8 kB -- 24.3 kB
MenuList -- 66 kB -- 20.6 kB
MobileStepper -- 68 kB -- 21.1 kB
Modal -- 14.4 kB -- 5.03 kB
NativeSelect -- 76.7 kB -- 24.1 kB
NoSsr -- 2.19 kB -- 1.04 kB
OutlinedInput -- 73.8 kB -- 22.9 kB
Paper -- 62.4 kB -- 19.3 kB
Popover -- 82.8 kB -- 25.5 kB
Popper -- 28.4 kB -- 10.2 kB
Portal -- 2.91 kB -- 1.32 kB
Radio -- 82.5 kB -- 25.8 kB
RadioGroup -- 63.3 kB -- 19.7 kB
Rating -- 70.2 kB -- 22.3 kB
RootRef -- 4.7 kB -- 1.78 kB
Select -- 113 kB -- 33.5 kB
Skeleton -- 62.5 kB -- 19.5 kB
Slide -- 25.1 kB -- 8.69 kB
Slider -- 75.3 kB -- 23.6 kB
Snackbar -- 77.1 kB -- 24 kB
SnackbarContent -- 66 kB -- 20.6 kB
SpeedDial -- 85.9 kB -- 27 kB
SpeedDialAction -- 115 kB -- 36.4 kB
SpeedDialIcon -- 64.9 kB -- 20.2 kB
Step -- 62.6 kB -- 19.5 kB
StepButton -- 82.3 kB -- 25.8 kB
StepConnector -- 62.7 kB -- 19.6 kB
StepContent -- 68.9 kB -- 21.4 kB
StepIcon -- 64.9 kB -- 20.1 kB
StepLabel -- 68.9 kB -- 21.5 kB
Stepper -- 64.9 kB -- 20.3 kB
styles/createMuiTheme -- 16.2 kB -- 5.78 kB
SvgIcon -- 63.3 kB -- 19.7 kB
SwipeableDrawer -- 90.7 kB -- 28 kB
Switch -- 81.1 kB -- 25.2 kB
Tab -- 76.5 kB -- 24.2 kB
Table -- 62.4 kB -- 19.4 kB
TableBody -- 62.1 kB -- 19.3 kB
TableCell -- 64.4 kB -- 20.1 kB
TableFooter -- 62.1 kB -- 19.3 kB
TableHead -- 62.1 kB -- 19.3 kB
TablePagination -- 139 kB -- 40.6 kB
TableRow -- 62.5 kB -- 19.5 kB
TableSortLabel -- 77.5 kB -- 24.4 kB
Tabs -- 85.6 kB -- 27.2 kB
TextareaAutosize -- 5.11 kB -- 2.14 kB
TextField -- 121 kB -- 35.4 kB
docs.main ▼ -402 B (-0.07% ) 599 kB ▼ -36 B (-0.02% ) 191 kB
ToggleButton -- 76.3 kB -- 24 kB
ToggleButtonGroup -- 63.5 kB -- 19.8 kB
Toolbar -- 62.3 kB -- 19.4 kB
Tooltip -- 99 kB -- 31.3 kB
TreeItem -- 73.7 kB -- 23.1 kB
TreeView -- 65.9 kB -- 20.6 kB
Typography -- 63.9 kB -- 19.9 kB
useMediaQuery -- 2.49 kB -- 1.05 kB
Zoom -- 23.1 kB -- 8.08 kB

Generated by 🚫 dangerJS against 0f05e13

@mnemanja mnemanja changed the title Adjust documentation methods being imported from @material-ui/styles to @material-ui/core/styles [Docs] Adjust documentation methods being imported from @material-ui/styles to @material-ui/core/styles Sep 16, 2019
@mnemanja mnemanja changed the title [Docs] Adjust documentation methods being imported from @material-ui/styles to @material-ui/core/styles [docs] Adjust documentation methods being imported from @material-ui/styles to @material-ui/core/styles Sep 16, 2019
@mnemanja mnemanja changed the title [docs] Adjust documentation methods being imported from @material-ui/styles to @material-ui/core/styles [docs] Adjust documentation methods being imported from @material-ui/styles to @material-ui/core/styles Sep 16, 2019
@mnemanja mnemanja changed the title [docs] Adjust documentation methods being imported from @material-ui/styles to @material-ui/core/styles [docs] Adjust documentation methods being imported from @material-ui/styles to @material-ui/core/styles Sep 16, 2019
@mbrookes
Copy link
Member

mbrookes commented Sep 28, 2019

Hi @mnemanja, thanks for starting this. I have pushed it a bit further.

@oliviertassinari
There is still a bit more to do. I haven't changed any of the following:

Guides

  • FAQ
  • Migration from v3

Styles

  • Advanced
    • Gatsby plugin

Components

  • Slider
    • Size snapshot

There may still be some exports unresolved (I only re-exported what was documented).

Also, there is a TypeScript error in docs/src/pages/styles/advanced/WithTheme.tsx that I'm unsure about how to resolve.

@oliviertassinari
Copy link
Member

@mbrookes I'm looking at the fails.

@mbrookes mbrookes changed the title [docs] Adjust documentation methods being imported from @material-ui/styles to @material-ui/core/styles [docs] Change imports from @material-ui/styles to @material-ui/core/styles Sep 28, 2019
@mbrookes mbrookes added the docs Improvements or additions to the documentation label Sep 28, 2019
Copy link
Member

@oliviertassinari oliviertassinari left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It seems to be good, on my side. It would be great to double-check. They might be opportunities to improve the documentation wordings.

We shouldn't forget to update the examples once the changes are released.

@mbrookes
Copy link
Member

mbrookes commented Oct 1, 2019

@joshwooding Could you cast your eye over 7a94ecd please?


To remove the need for injecting a theme in the React's context **systematically** and to reduce the number of manual installations a developer needs to do, the `@material-ui/styles` modules are re-exported from `@material-ui/core/styles` (with a default theme).
To reduce the number of packages required when used with Material-UI, and to simplify the imports, `@material-ui/styles` modules are re-exported from `@material-ui/core/styles`. To remove the need to systematically supply a theme, the default Material-UI theme is applied to `makeStyles`, `styled`, and `withStyles`.
Copy link
Member

@mbrookes mbrookes Oct 1, 2019

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
To reduce the number of packages required when used with Material-UI, and to simplify the imports, `@material-ui/styles` modules are re-exported from `@material-ui/core/styles`. To remove the need to systematically supply a theme, the default Material-UI theme is applied to `makeStyles`, `styled`, and `withStyles`.
To reduce the number of packages to install when using Material-UI, and to simplify the imports, `@material-ui/styles` modules are re-exported from `@material-ui/core/styles`. To remove the need to systematically supply a theme, the default Material-UI theme is applied to the re-exported `makeStyles`, `styled`, and `withStyles` modules.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

When what is used with Material-UI?

@joshwooding
Copy link
Member

joshwooding commented Oct 1, 2019

What does "improve consistency" mean in this context?

How does it simplify the imports?

Only one package to import style modules from, so simpler to reason about, and can be flattened if using named imports. I guess it's a bit redundant though.

Only using one package to import everything from :)

@oliviertassinari
Copy link
Member

To reduce the number of packages required

It still uses the same number of transitive packages. It might be confusing.

@mbrookes
Copy link
Member

mbrookes commented Oct 2, 2019

Suggestion revised.

@oliviertassinari
Copy link
Member

Looks great

@oliviertassinari
Copy link
Member

oliviertassinari commented Oct 4, 2019

A change we should have done a long time ago, excited to see it land :).

@lookfirst
Copy link
Contributor

THANK YOU!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
docs Improvements or additions to the documentation
Projects
None yet
6 participants