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

RFC: Add ignore strategies #109

Closed
wants to merge 4 commits into from

Conversation

KevinBatdorf
Copy link
Contributor

Would resolve #90

Just a concept for how we could handle not showing some components, or not loading at all.

Since you don't necessarily bundle Alpine, or the functions Alpine uses, identifying production mode doesn't seem possible.

We could just leave it up to the user to manage visibility.

@HugoDF
Copy link
Collaborator

HugoDF commented Dec 5, 2020

I wonder if the "production mode" is useful.

At the end of the day, the devtools don't load unless you inspect the page. Since we're client-side, switching a global variable before opening devtools seems easy enough (so if some did have production mode on, you can switch off trivially)

About the devtools-ignore directive I wonder about the education piece, devtools aren't really meant to have docs, they should just give you a UI that allows you to inspect your components. Anything that you can't guide users to with the UI is going to be difficult to gain traction on.

I still think adding a way to hide the components from the panel is going to give the best outcome in terms of ease of use, education/discoverability and implementation.

We could even persist which components are hidden across refreshes/reloads using https://developer.chrome.com/extensions/storage (which we already request permission for)

@KevinBatdorf
Copy link
Contributor Author

We could also do both and just not document it. Anyone curious enough would probably end up here via a Google search. I'm ok if we don't though. maybe let's see if anyone ends up here and comments on it. I can open a discussion post this week about it.

One advantage of disabling it all together though is it doesn't initialize anything. Or does Chrome wait until the tab has focus?

I do think we should add the filtering regardless. It's a big project though I think.

@HugoDF
Copy link
Collaborator

HugoDF commented Dec 5, 2020

We could also do both and just not document it. Anyone curious enough would probably end up here via a Google search. I'm ok if we don't though. maybe let's see if anyone ends up here and comments on it. I can open a discussion post this week about it.

One advantage of disabling it all together though is it doesn't initialize anything. Or does Chrome wait until the tab has focus?

I do think we should add the filtering regardless. It's a big project though I think.

Backend.js doesn't get injected until the devtools are opened so no init unless you've got devtools open.

I think we can have a default filter on devtools-ignore but it should be discoverable through the UI (with something like the React settings popup) the popup doesn't need to let you change anything maybe just mention you can ignore things with that attribute, that's probably a good compromise between where we are and where we want to go?

You can see what I'm thinking of in #111, for now we can have some text about being able to ignore components using x-devtools-ignore or whatever and down the line we can switch out the icon and make it a setting panel

@HugoDF
Copy link
Collaborator

HugoDF commented Dec 5, 2020

🤔 the above answer about how the extension works probably should go into a contributing.md

@HugoDF HugoDF mentioned this pull request Dec 6, 2020
@HugoDF HugoDF deleted the feature/add-options-to-not-load-devtools branch March 15, 2021 16:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Ignore specific components
2 participants