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

[Link] Warn when using plain function component in component #17825

Merged
merged 5 commits into from
Oct 14, 2019
Merged

[Link] Warn when using plain function component in component #17825

merged 5 commits into from
Oct 14, 2019

Conversation

Nikhil-Pavan-Sai
Copy link
Contributor

@Nikhil-Pavan-Sai Nikhil-Pavan-Sai commented Oct 10, 2019

Closes #16454

@mui-pr-bot
Copy link

mui-pr-bot commented Oct 10, 2019

Details of bundle changes.

Comparing: 83b8323...8df0d58

bundle Size Change Size Gzip Change Gzip
SwipeableDrawer -- 90.7 kB ▼ -4 B (-0.01% ) 28 kB
BottomNavigationAction -- 75.3 kB ▲ +3 B (+0.01% ) 23.8 kB
Collapse -- 67.8 kB ▲ +3 B (+0.01% ) 20.9 kB
StepIcon -- 64.7 kB ▲ +3 B (+0.01% ) 20.1 kB
Toolbar -- 62.3 kB ▲ +3 B (+0.02% ) 19.5 kB
ButtonBase -- 73.8 kB ▼ -2 B (-0.01% ) 23.1 kB
Fab -- 76.7 kB ▼ -2 B (-0.01% ) 23.8 kB
IconButton -- 76 kB ▼ -2 B (-0.01% ) 23.6 kB
InputBase -- 70.2 kB ▼ -2 B (-0.01% ) 22 kB
MenuItem -- 78 kB ▼ -2 B (-0.01% ) 24.3 kB
SnackbarContent -- 65.8 kB ▲ +2 B (+0.01% ) 20.6 kB
SpeedDial -- 85.9 kB ▲ +2 B (+0.01% ) 27 kB
StepConnector -- 62.7 kB ▲ +2 B (+0.01% ) 19.6 kB
SvgIcon -- 63 kB ▲ +2 B (+0.01% ) 19.6 kB
TablePagination -- 139 kB ▼ -2 B (-0.00% ) 40.6 kB
Tabs -- 85.3 kB ▲ +2 B (+0.01% ) 27.1 kB
@material-ui/core -- 347 kB ▼ -1 B (-0.00% ) 95.1 kB
Avatar -- 62.7 kB ▲ +1 B (+0.01% ) 19.6 kB
BottomNavigation -- 62.4 kB ▲ +1 B (+0.01% ) 19.5 kB
Box -- 70.8 kB ▲ +1 B (0.00% ) 21.4 kB
Breadcrumbs -- 68 kB ▲ +1 B (0.00% ) 21.3 kB
Button -- 79.3 kB ▲ +1 B (0.00% ) 24.5 kB
ButtonGroup -- 64.2 kB ▲ +1 B (+0.01% ) 20 kB
Card -- 62.9 kB ▲ +1 B (+0.01% ) 19.6 kB
CardActionArea -- 74.9 kB ▲ +1 B (0.00% ) 23.6 kB
CardActions -- 62 kB ▲ +1 B (+0.01% ) 19.3 kB
CardContent -- 62 kB ▲ +1 B (+0.01% ) 19.3 kB
CardHeader -- 65.1 kB ▲ +1 B (0.00% ) 20.4 kB
CardMedia -- 62.4 kB ▲ +1 B (+0.01% ) 19.5 kB
Checkbox -- 81.6 kB ▲ +1 B (0.00% ) 25.6 kB
CircularProgress -- 64.1 kB ▲ +1 B (0.00% ) 20.1 kB
Container -- 63.1 kB ▲ +1 B (+0.01% ) 19.6 kB
Dialog -- 82.5 kB ▲ +1 B (0.00% ) 25.6 kB
DialogContentText -- 64 kB ▲ +1 B (0.00% ) 20 kB
DialogTitle -- 64.3 kB ▲ +1 B (0.00% ) 20.1 kB
ExpansionPanelActions -- 62.1 kB ▲ +1 B (+0.01% ) 19.4 kB
ExpansionPanelSummary -- 77.9 kB ▲ +1 B (0.00% ) 24.5 kB
FilledInput -- 72.9 kB ▼ -1 B (-0.00% ) 22.6 kB
FormControl -- 64.3 kB ▲ +1 B (+0.01% ) 19.9 kB
FormControlLabel -- 65.5 kB ▲ +1 B (0.00% ) 20.5 kB
FormGroup -- 62 kB ▲ +1 B (+0.01% ) 19.3 kB
FormHelperText -- 63.3 kB ▲ +1 B (+0.01% ) 19.7 kB
FormLabel -- 63.3 kB ▲ +1 B (+0.01% ) 19.5 kB
Grid -- 65.1 kB ▲ +1 B (0.00% ) 20.3 kB
GridList -- 62.5 kB ▲ +1 B (+0.01% ) 19.5 kB
GridListTile -- 63.7 kB ▲ +1 B (+0.01% ) 19.9 kB
GridListTileBar -- 63.2 kB ▲ +1 B (+0.01% ) 19.7 kB
Hidden -- 66.1 kB ▲ +1 B (0.00% ) 20.6 kB
Icon -- 62.8 kB ▲ +1 B (+0.01% ) 19.6 kB
Input -- 72 kB ▼ -1 B (-0.00% ) 22.4 kB
InputAdornment -- 65.1 kB ▲ +1 B (0.00% ) 20.4 kB
InputLabel -- 65.1 kB ▲ +1 B (0.00% ) 20.2 kB
LinearProgress -- 65.3 kB ▲ +1 B (0.00% ) 20.3 kB
List -- 62.4 kB ▲ +1 B (+0.01% ) 19.3 kB
ListItem -- 77 kB ▼ -1 B (-0.00% ) 24 kB
ListItemAvatar -- 62.1 kB ▲ +1 B (+0.01% ) 19.4 kB
ListItemIcon -- 62.2 kB ▲ +1 B (+0.01% ) 19.4 kB
ListItemText -- 65 kB ▲ +1 B (0.00% ) 20.4 kB
ListSubheader -- 62.8 kB ▲ +1 B (+0.01% ) 19.6 kB
Menu -- 88.3 kB ▲ +1 B (0.00% ) 27.6 kB
MobileStepper -- 67.7 kB ▲ +1 B (0.00% ) 21.1 kB
NativeSelect -- 76.4 kB ▲ +1 B (0.00% ) 24 kB
OutlinedInput -- 73.5 kB ▼ -1 B (-0.00% ) 22.8 kB
Paper -- 62.4 kB ▲ +1 B (+0.01% ) 19.3 kB
Popover -- 82.6 kB ▼ -1 B (-0.00% ) 25.4 kB
Radio -- 82.5 kB ▲ +1 B (0.00% ) 25.9 kB
RadioGroup -- 63.2 kB ▲ +1 B (+0.01% ) 19.7 kB
Rating -- 69.8 kB ▲ +1 B (0.00% ) 22.2 kB
RootRef -- 4.43 kB ▲ +1 B (+0.06% ) 1.67 kB
Select -- 113 kB ▼ -1 B (-0.00% ) 33.5 kB
Skeleton -- 62.5 kB ▲ +1 B (+0.01% ) 19.6 kB
Slider -- 75.3 kB ▲ +1 B (0.00% ) 23.7 kB
Step -- 62.6 kB ▲ +1 B (+0.01% ) 19.6 kB
StepButton -- 82.1 kB ▲ +1 B (0.00% ) 25.8 kB
StepContent -- 69 kB ▲ +1 B (0.00% ) 21.4 kB
Stepper -- 64.9 kB ▲ +1 B (0.00% ) 20.3 kB
Switch -- 80.8 kB ▲ +1 B (0.00% ) 25.1 kB
Tab -- 76.2 kB ▲ +1 B (0.00% ) 24.1 kB
Table -- 62.6 kB ▲ +1 B (+0.01% ) 19.5 kB
TableBody -- 62.1 kB ▲ +1 B (+0.01% ) 19.3 kB
TableCell -- 64.1 kB ▲ +1 B (0.00% ) 20.1 kB
TableFooter -- 62.1 kB ▲ +1 B (+0.01% ) 19.3 kB
TableHead -- 62.1 kB ▲ +1 B (+0.01% ) 19.3 kB
TableRow -- 62.5 kB ▲ +1 B (+0.01% ) 19.5 kB
TableSortLabel -- 77.2 kB ▲ +1 B (0.00% ) 24.4 kB
TextField -- 121 kB ▼ -1 B (-0.00% ) 35.4 kB
ToggleButton -- 76 kB ▲ +1 B (0.00% ) 23.9 kB
ToggleButtonGroup -- 63.2 kB ▲ +1 B (+0.01% ) 19.8 kB
Tooltip -- 99.1 kB ▲ +1 B (0.00% ) 31.4 kB
TreeItem -- 73.4 kB ▲ +1 B (0.00% ) 23.1 kB
TreeView -- 66 kB ▲ +1 B (0.00% ) 20.6 kB
Typography -- 63.7 kB ▲ +1 B (+0.01% ) 19.8 kB
@material-ui/core[umd] -- 306 kB -- 88.1 kB
@material-ui/lab -- 145 kB -- 45 kB
@material-ui/styles -- 51.8 kB -- 15.6 kB
@material-ui/system -- 15.7 kB -- 4.37 kB
AppBar -- 63.9 kB -- 19.9 kB
Backdrop -- 67.7 kB -- 20.9 kB
Badge -- 65.4 kB -- 20.2 kB
Chip -- 70.6 kB -- 21.8 kB
ClickAwayListener -- 3.85 kB -- 1.55 kB
colorManipulator -- 3.83 kB -- 1.52 kB
CssBaseline -- 57.6 kB -- 18 kB
DialogActions -- 62.1 kB -- 19.4 kB
DialogContent -- 62.2 kB -- 19.4 kB
Divider -- 62.6 kB -- 19.6 kB
docs.landing -- 54.5 kB -- 14.4 kB
docs.main -- 598 kB -- 191 kB
Drawer -- 84.3 kB -- 26 kB
ExpansionPanel -- 71.1 kB -- 22.1 kB
ExpansionPanelDetails -- 61.9 kB -- 19.3 kB
Fade -- 23.1 kB -- 8.05 kB
Grow -- 23.7 kB -- 8.17 kB
Link -- 66.6 kB -- 21 kB
ListItemSecondaryAction -- 62 kB -- 19.3 kB
MenuList -- 66 kB -- 20.6 kB
Modal -- 14.3 kB -- 4.96 kB
NoSsr -- 2.19 kB -- 1.04 kB
Popper -- 28.3 kB -- 10.2 kB
Portal -- 2.87 kB -- 1.29 kB
Slide -- 25.1 kB -- 8.68 kB
Snackbar -- 77.1 kB -- 24 kB
SpeedDialAction -- 115 kB -- 36.4 kB
SpeedDialIcon -- 64.6 kB -- 20.2 kB
StepLabel -- 68.6 kB -- 21.4 kB
styles/createMuiTheme -- 16.3 kB -- 5.79 kB
TextareaAutosize -- 5.06 kB -- 2.11 kB
useMediaQuery -- 2.49 kB -- 1.05 kB
Zoom -- 23.1 kB -- 8.06 kB

Generated by 🚫 dangerJS against 8df0d58

Copy link
Member

@eps1lon eps1lon left a comment

Choose a reason for hiding this comment

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

Thanks. You need to run yarn docs:api locally to see changes to the API docs and pass CI.

packages/material-ui/src/utils/focusVisible.js Outdated Show resolved Hide resolved
@eps1lon eps1lon added component: link This is the name of the generic UI component, not the React module! docs Improvements or additions to the documentation labels Oct 10, 2019
@eps1lon eps1lon changed the title fixed Link.js [Link] Warn when using plain function component in component Oct 10, 2019
@eps1lon
Copy link
Member

eps1lon commented Oct 11, 2019

@Nikhil-Pavan-Sai Please run yarn docs:api and commit these changes.

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.

I have reverted the new throw error as the discussion in #16454 didn't reach a consensus that it was justified. Sebastian had concerned about it. With hindsight, I'm not sure either it's the best path forward. I suspect it's related to #17119 (comment) but I think that we should better understand what's going on before add this defensive check.

@@ -32,7 +32,6 @@ describe('<Link />', () => {
inheritComponent: Typography,
mount,
refInstanceof: window.HTMLAnchorElement,
skip: ['componentProp'],
Copy link
Member

Choose a reason for hiding this comment

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

It's green.

@@ -142,7 +143,7 @@ Link.propTypes = {
* The component used for the root node.
* Either a string to use a DOM element or a component.
*/
component: PropTypes.elementType,
component: elementTypeAcceptingRef,
Copy link
Member

Choose a reason for hiding this comment

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

@eps1lon eps1lon merged commit eec6e43 into mui:master Oct 14, 2019
@eps1lon
Copy link
Member

eps1lon commented Oct 14, 2019

@Nikhil-Pavan-Sai Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
component: link This is the name of the generic UI component, not the React module! docs Improvements or additions to the documentation
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Link] TypeError: Cannot read property 'addEventListener' of undefined
4 participants