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

[Tooltip] Save a few bytes #34853

Merged
merged 2 commits into from Oct 26, 2022

Conversation

oliviertassinari
Copy link
Member

@oliviertassinari oliviertassinari commented Oct 22, 2022

This is a follow-up on #34289, I'm giving up on the idea of having title !== '' && title !== node an invalid value. We can be less opinionated about the best practice. Instead:

  1. I believe we can shorten the logic
  2. While I am at it, I'm continuing the migration to use screen as much as possible that Sebastian started. It's supposed to be simpler to work with.

@oliviertassinari oliviertassinari added component: tooltip This is the name of the generic UI component, not the React module! core Infrastructure work going on behind the scenes labels Oct 22, 2022
@mui-bot
Copy link

mui-bot commented Oct 22, 2022

Messages
📖 Netlify deploy preview: https://deploy-preview-34853--material-ui.netlify.app/

Details of bundle changes

Generated by 🚫 dangerJS against 019683a

@michaldudak
Copy link
Member

What's the rationale behind using screen in favor of render result methods?

@oliviertassinari
Copy link
Member Author

What's the rationale behind using screen in favor of render result methods?

@michaldudak The rationale was that it's easier to work with, meaning when you write a new test, it's easier to access a global variable than to go up to the render() to get your helper, and then go down to use it. This problem alone could be solved by writing something like const mountingPoint = render( but we never mount two components at the same time (I assume nor will we ever need to), so why not move this even one scope further up?

@eps1lon Does it match with the value you envision?

I can revert the changes in the tests if we are not comfortable with them.

@eps1lon
Copy link
Member

eps1lon commented Oct 24, 2022

What's the rationale behind using screen in favor of render result methods?

render results will break once you introduce a Portal. screen is easier to c&p around.

@michaldudak
Copy link
Member

👍 I'm fine with this change. My only concern is that it doesn't really fall into the "Save a few bytes" label. Could we make it a separate PR?

@michaldudak michaldudak changed the title [core] Save a few bytes [Tooltip] Save a few bytes Oct 26, 2022
@oliviertassinari oliviertassinari merged commit da4d400 into mui:master Oct 26, 2022
@oliviertassinari oliviertassinari deleted the fix-tooltip-regression branch October 26, 2022 11:35
daniel-rabe pushed a commit to daniel-rabe/material-ui that referenced this pull request Nov 29, 2022
feliperli pushed a commit to jesrodri/material-ui that referenced this pull request Dec 6, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
component: tooltip This is the name of the generic UI component, not the React module! core Infrastructure work going on behind the scenes performance
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants