-
-
Notifications
You must be signed in to change notification settings - Fork 32.4k
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
[docs] Inherited props are not documented #3172
Comments
Alas, I've just found out that |
@leesei Yeah honestly I can't think of a good reason why it isn't already documented. It's even documented in other components. Even though we're investigating including it in #3068 and #3079, the react-tap-event-plugin is a prerequisite for material-ui. Feel free to open up a PR to add the prop for us! 😄 Thanks! |
onTouchTap()
for buttons not documented
It's because it's one of the props that are forwarded. We really have to document those props that are passed down with |
Oh, you mean to passed to |
I would like to know if it is desirable to hide Otherwise it is better to add |
@leesei That also works, except that some of the props are intercepted. so not all props are passed down, and not all props are inherited from |
Then it's better to manually trace the props for each class and document what props will eventually be handled. Or we can still add doc for |
@leesei That can also work, but exposing internal components scares me O.o Although it might not be a bad idea to have an internal section for this purpose and tell users not to directly use these components O.o @oliviertassinari @newoga @mbrookes I would like to hear your insight on this too. thanks ^_^ |
My philosophy too is to hide implementation details. Library users have a tendency to abuse them if there is an easy way to get that info. |
True that 😅 😅 |
There's a related issue: #2940 I don't know the right answer - @alitaheri hit the nail on the head: #3172 (comment) So just exposing EnhancedButton in the docs doesn't solve the problem. |
I feel like this is our best option. We should only document our public API, we can't predict how properties will be passed down to internal components.
That's a really interesting problem. The Date Picker, is special. We are not only exposing |
I think what @oliviertassinari is proposing is our best option 👍 👍 |
So also related to #2973 which must be done manually. @heetvachhani has started on that one. I feel an umbrella issue coming on. 😄 |
@mbrookes : Have we reached an understanding about not exposing the internal components in the docs? Can we close this? |
We do still need to document inherited props, but it's a manual effort, and hasn't been tackled yet. We also sort of have the opposite problem, in that we document some event props that bubble up from underlying components / elements, for example We typically only document the ones we have intercepted (e.g. to set style related state), and passed up, so the list of props documented on any particular component varies, even though the full list of DOM events should be available. For However I'm now wondering if we should be documenting those props at all (it's DOM documentation not MUI documentation), or if so, whether we should just document the most useful ones in one place, and link to that from the props docs. This would reduce the clutter and repetition across the component prop docs. |
You raised a good point! I like this idea. What's the point of documenting standard DOM properties?
I like the idea of not documenting them at all. Still having them working and tested. We could remove them from the docs site and keep them from the |
While the DOM properties fall through to an underlying element much of the time, components don't always apply Personally, I would prefer that all relevant DOM properties get documented on each component, not just the ones that are intercepted. Maybe it should be in an "inherited properties" section of the documentation, but showing that a |
Obviously if there are inconsistencies, they would either need to be fixed, or, if intentional, documented.
That would be one crazy big list, you wouldn't be able to see the wood for the trees. (Type |
As a total newbie with material-ui (literally day one) I've hit this. My newbie goal was to create an AppBar with a couple of links in, as a simple test of how easy the components are to work with. Things that surprised me:
Those are my day one observations: I hope they're useful. Thanks! |
This was opened over a year ago, what is holding up documenting your APIs? |
@leesei In fact, |
Any chance the TypeScript definitions could be updated to reflect all this as well? |
@atrauzzi As far as I know, they already are on v1-beta. |
As I mention in the other ticket, I'm not sure that's of any help until it's out of beta. For those of us using |
Yah, it sucks but they have been clear they are not working on 0.x issues
because they trust themselves to fix everything single issue in 1.0 that is
brought up in the meantime...even though they close the issues.
…On Sat, Dec 30, 2017, 9:44 PM Alexander Trauzzi ***@***.***> wrote:
As I mention in the other ticket, I'm not sure that's of any help until
it's out of beta. For those of us using 0.x, we're stuck with a false
error that won't go away.
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#3172 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AD4v2Yn7hERSonRR8QlMTP0-XNdQ1FVAks5tFx86gaJpZM4HTI1Q>
.
|
@avaragado I understand what you mean, but event handler props like @mbrookes I think @avaragado has a good point |
@jedwards1211 The API pages already link to demo pages. So we actually have a link from the Button API page to the Button demo with Also: The search is actually pretty good. Type The only thing I'm missing is that google displays the anchor links in the search result. |
@eps1lon I understand that, but the idea to search for |
You can go ahead and open a PR so that I can understand where a link is currently missing. Just want to note that linking to the FAQ from the API is not very helpful since the user would still have to click another link to the demo page that is already linked from the API. The API pages should only be for interface docs. Usage should be located in the demos.
I don't dictate what is merged or not. This is a team effort. A PR is helpful here over theorizing it because it provides a deploy preview. Discussing this in a closed and somewhat unrelated issue doesn't help its visibility. |
This is how 80% of the people should be able to find the content they are looking for: Algolia. If it's working, then we are optimizing for the 20%, it's not important. Still, we can always improve it. It's also important to consider that too much documentation can harm as much as too little. |
I was talking about keeping the link in the demo page and adding the same link somewhere to the API page, for instance in the description of
I ask if something is likely to get merged to protect my valuable time, because I've had a PR I worked hard on here and refined during repeated discussion arbitrarily gutted into something that completely missed the original point of the PR at the last minute, and I really regretted how much time I had spent on it. |
@jedwards1211 Do you plan on updating the API of material-ui-popup-state to support hooks? :) |
@oliviertassinari Yes, I would like to, once hooks are out of alpha/beta stage |
Many components uses
EnhancedButton
and hence supportonTouchTap()
attribute (by passing through{...others}
)onTouchTap()
is crucial to handling click/tap for buttons, however this was not documented in:Same with:
Is this intentional?
The text was updated successfully, but these errors were encountered: