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

[CircularProgress] Migrate to emotion #24622

Merged
merged 10 commits into from
Jan 27, 2021

Conversation

natac13
Copy link
Contributor

@natac13 natac13 commented Jan 25, 2021

#24405

Lol still not perfect.

@mui-pr-bot
Copy link

mui-pr-bot commented Jan 25, 2021

@material-ui/core: parsed: +0.39% , gzip: +0.26%
@material-ui/lab: parsed: +0.42% , gzip: +0.42%

Details of bundle changes

Generated by 🚫 dangerJS against e29d24d

@oliviertassinari oliviertassinari added the component: CircularProgress The React component label Jan 25, 2021
/* Styles applied to the `circle` svg path if `variant="indeterminate"`. */
circleIndeterminate: {
...(styleProps.variant === 'indeterminate' && {
animation: '$circular-dash 1.4s ease-in-out infinite',
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
animation: '$circular-dash 1.4s ease-in-out infinite',
animation: 'circular-dash 1.4s ease-in-out infinite',

Copy link
Member

Choose a reason for hiding this comment

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

Isn't this the correct?

/* Styles applied to the root element if `variant="indeterminate"`. */
indeterminate: {
...(styleProps.variant === 'indeterminate' && {
animation: '$circular-rotate 1.4s linear infinite',
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
animation: '$circular-rotate 1.4s linear infinite',
animation: 'circular-rotate 1.4s linear infinite',

Copy link
Member

@mnajdova mnajdova left a comment

Choose a reason for hiding this comment

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

Actually, can we follow how the keyframes are created in the TouchRipple component? https://github.com/mui-org/material-ui/blob/next/packages/material-ui/src/ButtonBase/TouchRipple.js#L14 Also note that we will have to convert the styles to the CSS syntax when using keyframes. See - https://github.com/mui-org/material-ui/blob/next/packages/material-ui/src/ButtonBase/TouchRipple.js#L62 It is unfortunate, but it is the only way we can ensure that both emotion & styled-components will work correctly. I can help out in the end to test out that both scenarios work.

@natac13
Copy link
Contributor Author

natac13 commented Jan 26, 2021

No problem. Ill make the changes. And reach out if I get stuck. 🤞🏻

@mnajdova
Copy link
Member

No problem. Ill make the changes. And reach out if I get stuck. 🤞🏻

Perfect! Thank you 🙏

@natac13
Copy link
Contributor Author

natac13 commented Jan 26, 2021

I believe I have converted styling to css successfully. However, I am still getting the last check of testRootClass from describeConformanceV5 failing.

Sorry, I am not sure why.

@mnajdova
Copy link
Member

I believe I have converted styling to css successfully. However, I am still getting the last check of testRootClass from describeConformanceV5 failing.

Sorry, I am not sure why.

Take a look on the last comments, should fix the failing test:


  1) <CircularProgress />
       Material-UI component API
         applies the root class to the root component if it has this class:
     AssertionError: expected '[object Object]' to equal null
      at Context.it (test/utils/describeConformance.js:166:85)

The CSS styles looks good from glance, will test them in more details tomorrow (sorry don't have the energy to od it right now :) ). Thanks for taking a look at this 👍

@mnajdova
Copy link
Member

@natac13 I've pushed some fixes with e6f14f3 finally it's working (tested with both emotion & styled-components) I need to also change the styles for the determinate variant not to use class name and I believe we are good to go.

@mnajdova
Copy link
Member

Ok, found the isseue, I was doing

  transition: ${({ styleProps, theme }) => styleProps.variant === 'determinate' && theme.transitions.create('transform')};

instead of

  transition: ${({ styleProps, theme }) =>
    styleProps.variant === 'determinate' ? theme.transitions.create('transform') : undefined};

Everything should be good now :)

Copy link
Member

@mnajdova mnajdova left a comment

Choose a reason for hiding this comment

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

Good job on this one, it was more tricky than the others :)

@natac13
Copy link
Contributor Author

natac13 commented Jan 27, 2021

Thanks, glad to be able to help.

transition: ${({ styleProps, theme }) =>
styleProps.variant === 'determinate' ? theme.transitions.create('transform') : undefined};

I was not sure I could do this. lol I had something like this in the start but didn't think I could leave undefined

Thanks for the help

@mnajdova mnajdova merged commit 93b6eb9 into mui:next Jan 27, 2021
xs9627 added a commit to xs9627/material-ui that referenced this pull request Jan 27, 2021
* next: (34 commits)
  [Tab] Migrate to emotion (mui#24651)
  [TextField] Migrate Input component to emotion (mui#24638)
  [ImageList] Migrate ImageListItemBar to emotion (mui#24632)
  [CircularProgress] Migrate to emotion (mui#24622)
  [DataTable] Add example in docs for data table (mui#24428)
  [Card] Migrate CardActionArea to emotion (mui#24636)
  [core] Fix `next` using stale pages (mui#24635)
  [List] Migrate ListItemIcon to emotion (mui#24630)
  [ClickAwayListener] Fix `children` and `onClickAway` types (mui#24565)
  [docs] Include in docs directive to silence `eslint` erroneous warning (mui#24644)
  [Fab] Migrate to emotion (mui#24618)
  [TextField] Migrate FilledInput to emotion (mui#24634)
  [Card] Migrate CardHeader to emotion (mui#24626)
  [Card] Migrate CardMedia to emotion (mui#24625)
  [ImageList] Migrate ImageListItem to emotion (mui#24619)
  [website] Add vision block (mui#24603)
  [docs] Add sorting section (mui#24637)
  [TextField] Prepare removal of labelWidth prop (mui#24595)
  [Dialog] Migrate DialogTitle to emotion (mui#24623)
  [ImageList] Migrate to emotion (mui#24615)
  ...
@mnajdova mnajdova mentioned this pull request Jan 28, 2021
1 task
natac13 added a commit to natac13/material-ui that referenced this pull request Jan 30, 2021
@oliviertassinari oliviertassinari added the component: progress This is the name of the generic UI component, not the React module! label Nov 28, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
component: CircularProgress The React component component: progress This is the name of the generic UI component, not the React module!
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants