Skip to content
This repository has been archived by the owner on Jun 26, 2020. It is now read-only.

Proposal: Dim Components with Parens in Name #676

Closed
gaearon opened this issue May 3, 2017 · 8 comments
Closed

Proposal: Dim Components with Parens in Name #676

gaearon opened this issue May 3, 2017 · 8 comments

Comments

@gaearon
Copy link
Contributor

gaearon commented May 3, 2017

Inspired by #503, I want to propose a super simple heuristic for making HOCs less prominent.

How about we just dim the components in the tree that have ( or ) in their names? These are always HOCs, as people commonly use X(Y) convention like Connect(App), Relay(FeedItem), or withStyles(Button). You can’t accidentally put parens into the name so it’s always intentional. HOCs that don’t adhere to this convention could easily adapt to it.

We wouldn’t completely hide the HOCs (at least, I’d like to start without it) because it obscures the data flow. But I think even making them dim in the tree would make a visual difference. Does anyone want to prototype this?

I don’t know if dimming will be helpful in practice or not but I’d like to experiment with it. If not, then we could add a “Hide Wrappers” checkbox that also uses ( and ) as a heuristic.

@mattvagni
Copy link

Can I take this on? I think this could feel really nice and it seems like a good first bug to get to know how the dev tools are built.

@neeharv
Copy link

neeharv commented May 3, 2017

I'd like to prototype something out, if no one else has started work on this.

I like the idea of dimming it out, but I'm worried for people new to react dev tools it might look "disabled". Let me try a few styles out and send screenshots.

@gaearon
Copy link
Contributor Author

gaearon commented May 3, 2017

Seems like @mattvagni got there first!

@gaearon
Copy link
Contributor Author

gaearon commented May 3, 2017

(But seriously, feel free to prototype and collaborate. I’m not sure if this is viable, but it may work if someone figures out a good balance.)

@mattvagni
Copy link

Initial impressions is that it works pretty well just dimmed out.

screen shot 2017-05-03 at 5 44 29 pm

However it would need some more consideration when searching:
screen shot 2017-05-03 at 5 48 08 pm

NOTE: Currently just styling the HigherOrderComponent vs. doing it properly and only matching components with () since I haven't yet found out how to change the pretend application.

@arturmuller
Copy link

I would love a "Hide Wrappers" checkbox!

mattvagni added a commit to mattvagni/react-devtools that referenced this issue May 4, 2017
Related Issue(s):
- facebook#676

As part of this:
- The test app that is used to work on the devtools now has a component which follows the common HOC naming convention of having 'HigherOrderComponent(Component)'
@iamstarkov
Copy link

related #604

@bvaughn
Copy link
Contributor

bvaughn commented Aug 19, 2019

React DevTools has been rewritten and recently launched a new version 4 UI. The source code for this rewrite was done in a separate repository and now lives in the main React repo (github.com/facebook/react).

Because version 4 was a total rewrite, and all issues in this repository are related to the old version 3 of the extension, I am closing all issues in this repository. If you can still reproduce this issue, or believe this feature request is still relevant, please open a new issue in the React repo: https://github.com/facebook/react/issues/new?labels=Component:%20Developer%20Tools

@bvaughn bvaughn closed this as completed Aug 19, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

6 participants