vpusher / paper-tree

Browsable tree of nodes with expandable/collapsible capabilities and actions menu
MIT License
27 stars 24 forks source link

Polymer 2.0 #6

Open nicolasr75 opened 7 years ago

nicolasr75 commented 7 years ago

Hello, great work! Are there any plans to port this to 2.0? I am not an expert but from looking at the code and Polymers upgrade guide there seems not to be too much to change.

Or is it usable in Polymer 2.0 as it is? I think I can not simply get it via bower because of the 1.* dependencies which conflict with my 2.0 project.

Nicolas

vpusher commented 7 years ago

@nicolasr75 Polymer 2.0 has this hybrid element feature that would ease the transition and make possible the use of 1.x elements in the 2.0 runtime. It would be interesting to give a try with the code asis. Nevertheless, please feel free to PR the 2.0 implementation.

See https://www.polymer-project.org/2.0/docs/devguide/hybrid-elements

nicolasr75 commented 7 years ago

@vpusher Ok, I gave it a try but only locally, no PR yet (actually I'm not yet that experienced with GitHub and would have to learn how to do PRs etc.).

I think I have converted everything successfully except for the actions menu. The problem is that there currently is no hybrid mode version of paper-menu. Have a look here:

https://github.com/PolymerElements/paper-menu/issues/110

What do you think?

Btw, I have not yet tested paper-tree in hybrid mode.

vpusher commented 7 years ago

@nicolasr75 so let's wait for Polymer 2 first release.

nicolasr75 commented 7 years ago

@vpusher paper-menu is declared deprecated https://github.com/PolymerElements/paper-menu/pull/112#issuecomment-294560068

vpusher commented 7 years ago

Then we should move to paper-listbox

guss77 commented 7 years ago

I would really like to understand how (hopefully with examples) to use paper-listbox in place of paper-menu, because it looks like the paper-listbox repository didn't get the memo about it being a replacement for paper-menu - see, for example, https://github.com/PolymerElements/paper-listbox/issues/7

vpusher commented 7 years ago

@guss77 From the <paper-menu-button> README:

<paper-menu-button>
  <paper-icon-button icon="menu" slot="dropdown-trigger"></paper-icon-button>
  <paper-listbox slot="dropdown-content">
    <paper-item>Share</paper-item>
    <paper-item>Settings</paper-item>
    <paper-item>Help</paper-item>
  </paper-listbox>
</paper-menu-button>
chisholmd commented 6 years ago

I tried to use this in my 2.0 project and ran into all sorts of issues. But I don't think they are too much to sort out. To my untrained eye it looked like it mostly had to do with moving to app-layout.

nicolasr75 commented 6 years ago

You may want to try my fork for 2.0 (the preview 2.0 branch!) https://github.com/nicolasr75/paper-tree This is incomplete though! It does not yet support the actions menu and I have not tested it thoroughly.

chisholmd commented 6 years ago

Thanks and I will do that :)

chisholmd commented 6 years ago

The problem I am having with both versions is that when I install paper-menu it asks me to select versions of about 3 or 4 other dependencies and I never know which to choose so I just choose the latest. Then when it finishes installing my app is all messed up. I have to reinstall all my bower components except paper-menu.

nicolasr75 commented 6 years ago

Where does the dependency on paper-menu come from in your project? Since the Polymer team is not going to port paper-menu to 2.0 I did not include it in my 2.0 preview in the first place (that's why the actions menu is currently missing).

chisholmd commented 6 years ago

Ugh I downloaded wrong branch...