PolymerElements / paper-dropdown-menu

A Material Design browser select element
https://www.webcomponents.org/element/PolymerElements/paper-dropdown-menu
61 stars 107 forks source link

accio paper-dropdown-light! ⚡️ #142

Closed notwaldorf closed 8 years ago

notwaldorf commented 8 years ago

Put paper-dropdown on the treadmill:

Code details to make review easier:

I think this new element and the old one should behave in almost the same way (maybe minor differences re: styling, as we're using different mixins/custom properties). I've duplicated the demo and the tests to demonstrate this.

Results: 3.5x gain (the numbers are for 1k elements) 🎉🎉🎉

screen shot 2016-04-11 at 5 26 38 pm

Sanity check it looks the same (left: paper-dropdown-menu, right paper-dropdown-menu-light. The lavender is the entire dropdown :host):

screen shot 2016-04-11 at 4 38 37 pm

/cc @cdata

valdrinkoshi commented 8 years ago

Left 1 comment, will continue reviewing tests tomorrow. Kind of scary that the new element is a copy-paste of the old one for the most part though :x

notwaldorf commented 8 years ago

Yeah, sorry, forgot to add that to the description (added now). I talked to @cdata and we decided that splitting the code into a separate behaviour wasn't good (since behaviours inspire "something you want to reuse a lot"), and this isn't it. When the inheritance branch lands, this can be all cleaned up, since paper-dropdown-menu-light is just an extension + a slightly different template, but in the meantime, i agree, this isn't great :(

miztroh-zz commented 8 years ago

So will this be renamed to and replace paper-dropdown-menu?

notwaldorf commented 8 years ago

@miztroh Only in a 2.0 release. Removing paper-input is a breaking change and needs a major version bump, so for now we're shipping it as a separate element. In the 2.0 release, paper-dropdown-menu-light will probably become paper-dropdown-menu, along with other potential breaking change improvements.

valdrinkoshi commented 8 years ago

LGTM :+1:

notwaldorf commented 8 years ago

RTL is ok too now:

screen shot 2016-04-12 at 11 51 30 am screen shot 2016-04-12 at 11 51 23 am
valdrinkoshi commented 8 years ago

Good catch!