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

Interactivity API: Debug - Show directive names included in each Directives component on Preact’s debug tools #60049

Closed
cbravobernal opened this issue Mar 20, 2024 · 3 comments
Labels
Developer Experience Ideas about improving block and theme developer experience [Feature] Interactivity API API to add frontend interactivity to blocks. Needs Dev Ready for, and needs developer efforts [Type] Enhancement A suggestion for improvement.

Comments

@cbravobernal
Copy link
Contributor

What problem does this address?

#59829 mentions that enabling Preact Debug is possible.

However if you take a look at the tool, it seems it is not really descriptive.
Screenshot 2024-03-20 at 18 00 41

What is your proposed solution?

Adding the directive names in each Directive component should make easier to spot the different components inside the Preact Application.

@cbravobernal cbravobernal added [Type] Enhancement A suggestion for improvement. Developer Experience Ideas about improving block and theme developer experience [Feature] Interactivity API API to add frontend interactivity to blocks. labels Mar 20, 2024
@gziolo gziolo added the Needs Dev Ready for, and needs developer efforts label Mar 26, 2024
@cbravobernal
Copy link
Contributor Author

One first issue to solve is what to do if the component has more than one directive 🤔

@cbravobernal
Copy link
Contributor Author

After spending some time investigating how to do it. It seems that renaming the component is not possible, as the displayName will alway show the latest directive available in the HTML (as all components are a same function).

I tried using "key" and it works, but keys should not be used to check which directives are inside a Directive component. If the developer clicks each Component, it still appears on the right panel all the directives, it is not as quick as a first view, but it seems to be enough.

Creating our own debugging browser tool or extending the Preact one seems not to be the best option too.

I'm planning to close the PR with a won't do at the end of the week. But still, I'm happy to listen for feedback.

@cbravobernal cbravobernal closed this as not planned Won't fix, can't repro, duplicate, stale Apr 24, 2024
@luisherranz
Copy link
Member

I am going to ask the Preact team.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Developer Experience Ideas about improving block and theme developer experience [Feature] Interactivity API API to add frontend interactivity to blocks. Needs Dev Ready for, and needs developer efforts [Type] Enhancement A suggestion for improvement.
Projects
None yet
Development

No branches or pull requests

3 participants