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

[Autocomplete] Remove debug in favor of open and dev tools #23377

Merged
merged 3 commits into from
Nov 6, 2020

Conversation

eps1lon
Copy link
Member

@eps1lon eps1lon commented Nov 3, 2020

Breaking changes

  • [Autocomplete] Remove debug prop
    There are a couple of simpler alternatives: open={true}, Chrome devtools "Emulate focused", or React devtools props.

With recent react-devtools updates editing props is fairly straight forward and more powerful than a non-descriptive debug prop that is even part of the prod bundle.

screen recording of forcing the devtools open

The uncontrolled case isn't as straight forward but you can always switch to controlled in your codebase

@eps1lon eps1lon added breaking change component: autocomplete This is the name of the generic UI component, not the React module! labels Nov 3, 2020
@mui-pr-bot
Copy link

mui-pr-bot commented Nov 3, 2020

Details of bundle changes

Generated by 🚫 dangerJS against 8815e90

@oliviertassinari
Copy link
Member

oliviertassinari commented Nov 3, 2020

The prop is most often used to customize the rendering of the popup, the CSS, or the elements themselves. During such a session, the solution needs to support fast refresh and likely hard reload. I would be cautious with a React dev-tools or a Chrome Devtool only solution because it has a short lifespan. One downside of the debug prop is its upside: it's persistent, it can end-up in production 😆. What do you think?

@eps1lon
Copy link
Member Author

eps1lon commented Nov 5, 2020

During such a session, the solution needs to support fast refresh and likely hard reload.

Set open={true} instead of debug then like you would with any other popup-like ui? It's about unifying the debug experience which should not be a footgun. debug ending up in production is highly problematic.

debug is a misleading term at the moment considering to what it applies.

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.

Yeah ok, I will use open in the future. Great alternative! I originally got the idea from https://docsearch.algolia.com/docs/styling/#debugging.

I have added a diff for the next release changelog in the PR's description. What do you think about it? Could we include something in the v5 migration guide?

@oliviertassinari oliviertassinari merged commit dd352d0 into mui:next Nov 6, 2020
@oliviertassinari oliviertassinari changed the title [Autocomplete] Remove debug in favor of react-devtools [Autocomplete] Remove debug in favor of open and dev tools Nov 14, 2020
@eps1lon eps1lon deleted the feat/Autocomplete/debug branch August 18, 2021 21:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
breaking change component: autocomplete 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.

3 participants