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

[Docs] [DropDownMenu] [Composable] Migrate to new standard #2565

Merged
merged 4 commits into from
Dec 17, 2015

Conversation

alitaheri
Copy link
Member

@oliviertassinari @newoga @ajsharp @mbrookes

Closes #1487

Guys please take a look at this. I've deprecated, removed, and messed up the code.

@oliviertassinari I'll fix the prop description, tell me how it is so far.

@ajsharp I think this addressed your issue as well
Closes #2554.

I should change the entire docs, select field and a lot more. It's 4AM here, so tomorrow 😅 😴

P.S. @oliviertassinari Please go through the commits. I kept the history a bit clean to follow. I've removed some code that was in the way and had no effect what so ever! This PR will need a lot of discussion and a lot of review. Please take your time. this is a huge change, ( a lot more to come)

@alitaheri alitaheri added the docs Improvements or additions to the documentation label Dec 17, 2015
@alitaheri alitaheri added this to the Improve the documentation milestone Dec 17, 2015
## Drop Down Menu

To find out more about the `DropDownMenu` component please visit the Material Design's
specifications **WHERE IS IT IN THE SPEC?!**.
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@oliviertassinari What is the reference? I couldn't find it 😁

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There isn't one I don't think, just the second-last animation here: https://www.google.com/design/spec/components/menus.html#menus-usage (Textfield dropdown).

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yup, I agree with @mbrookes. Unfortunately the spec isn't very clear on this type of component and a lot has to be inferred based on screenshots from the menu and text field sections. I wish the spec was more explicit with some of the controls 😞

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Indeed, the spec isn't breaking thing too much into component.
But I'm wondering, what's the difference between the DropDownMenu and the SelectField?
I may be wrong, but I feel like the SelectField is enought.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@oliviertassinari Yes I've wondered the same thing since I started using this library. In fact, the only think select field does is wrap DropDownMenu. We'll have to address this after #2555 in my opinion

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You are right, #2416 makes a lot of sense 👍.
Let's wait 0.14 before taking care of it.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@mbrookes I'm gonna use the link you gave. thanks 👍

@newoga
Copy link
Contributor

newoga commented Dec 17, 2015

@subjectix I gave it a quick review and I like what's been done so far 👍 . I'm sure you have more changes in stow so I'll leave a few comments on the lines of code and keep tuned!

},

_setSelectedIndex(index) {
if (process.env.NODE_ENV !== 'production') {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we can remove this production check since the warning package does it for us.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yes, indeed! on it!

@alitaheri
Copy link
Member Author

Still a work in progress. I patched up the feedbacks. Ignore all the deprecation warnings in the docs site. I'm working on a lot of things 😬

@alitaheri
Copy link
Member Author

@oliviertassinari Are you ok with the descriptions?

@oliviertassinari
Copy link
Member

@subjectix Yes, I'm.
I have noticed a bug. In the DropDownMenuLongMenuExample, the popover top position is wrong (I can give you a gif of the issue if needed).

@alitaheri
Copy link
Member Author

@oliviertassinari Possibly because your screen can't fit it. Please see if this fixes it

@oliviertassinari
Copy link
Member

@subjectix It's ok now 👍

@alitaheri
Copy link
Member Author

@oliviertassinari Thanks for the feedback 👍 😄

@alitaheri alitaheri changed the title [WIP] [Docs] [DropDownMenu] [Composable] Migrate to new standard [Docs] [DropDownMenu] [Composable] Migrate to new standard Dec 17, 2015
@alitaheri
Copy link
Member Author

This is final.

@oliviertassinari @newoga @mbrookes Please take a final look, before I squash and merge ^_^

@alitaheri alitaheri force-pushed the composable-drop-down-menu branch from cb79abe to a83dbee Compare December 17, 2015 21:17
@alitaheri
Copy link
Member Author

Sorry had to squash, for the merge conflict

It was a pain rebasing them to this clean history -_-

* **DEPRECATED** `DropDownMenu` will use this member to display
* the name of the item on the label.
*/
labelMember: React.PropTypes.string,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@oliviertassinari @subjectix Since we merged #2562, maybe we could use that deprecatedProp utility function that was added. Thoughts?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We have to do it for many other. And it's still not mature enough. I'd say wait a PR or two before we fully migrate to using that. I want to improve the doc generation in 2-3 ways. for functions, deprecated, and categorization.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sounds good to me!

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I want to improve the doc generation in 2-3 ways. for functions, deprecated, and categorization.

I agree, there is room for improvement. For instance by using the deprecatedPropType we could add more than just adding DEPRECATED to the doc description.
We could automatically add what to do instead (this is the warning that would be thrown if the property is used.

@newoga
Copy link
Contributor

newoga commented Dec 17, 2015

@subjectix Looking good! I made a couple of additional small comments that I'd be curious to get your feedback on. Otherwise I think it's good to go 👍

@subjectix @oliviertassinari
On separate note: When do you think we should start switching some of these components to use muiThemeable?

Also, now that we've been naming things properly, I'm tempted to do another pull request naming mui-themeable.js to muiThemeable.js and mui-theme-provider.js to MuiThemeProvider.jsx

@alitaheri
Copy link
Member Author

@newoga Yes please do that 👍 👍 👍 Thanks 😁

@alitaheri
Copy link
Member Author

what do you think @newoga ? 😁


render() {

const items = longMenuItems.map((item, index) => (
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You can move this part outside the render method, no need for extra work.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this isn't what makes it slow, it's the rendering. this extra work is pure js, and the iterations are only 100, this won't make much different, yet I think this is more expressive.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Well, my point is, we can save 100 class memory allocation each time the value change.
But yes, it may be insignificant, I haven't any perf measurement to share 😁

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

doesn't matter following your fix did make it look cooler, so I followed :D

@oliviertassinari
Copy link
Member

@subjectix That's such an epic PR, great work 🎉.
I have just made one comment (and squash down some of the commit, maybe not all of them), otherwise, let's merge it!

@newoga
Copy link
Contributor

newoga commented Dec 17, 2015

@subjectix Yup, I'm happy with this as well! 🎉 Good work!

@alitaheri alitaheri force-pushed the composable-drop-down-menu branch from c70a32d to da4a685 Compare December 17, 2015 22:59
@alitaheri
Copy link
Member Author

@oliviertassinari @newoga Thanks for all your review and feedbacks 👍 👍 😄

alitaheri added a commit that referenced this pull request Dec 17, 2015
[Docs] [DropDownMenu] [Composable] Migrate to new standard
@alitaheri alitaheri merged commit 73daef7 into mui:master Dec 17, 2015
@alitaheri alitaheri deleted the composable-drop-down-menu branch December 17, 2015 23:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
docs Improvements or additions to the documentation
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants