Polymer / shop

The Shop app
https://shop.polymer-project.org/
986 stars 494 forks source link

Routing is wack #219

Closed BastianVoigt closed 5 years ago

BastianVoigt commented 5 years ago

Your shop uses routes like:

/list/mens_underwear
/details/mens_underwear/product_xyz

Why are you moving the list vs details to the first level of the path? Every app that I built with react or angular would rather use something like

/mens_underwear                     for the list view
/mens_underwear/product_xyz         for the detail view

This is the way most people would expect it, IMHO. Because it resembles the way REST APIs are designed. But it isn't possible with app-route, right?

Come on. Did you adopt your example shop to work around the problems with app-route ? Wouldn't it be better to fix app-route and make a proper example shop?

Maybe you should look at the react-router and try to build something alike. E.g. you will need "exact" route matching, like react-router does it. And it should be possible to pass the name of a component to every route, makes it much more readable than the iron-pages are.

This is just not usable atm.

I know this is not the right place for the issue, but I think propert routing is one of the most important features.

keanulee commented 5 years ago

Agreed that paths are a little contrived to make it fit with app-route's model. The idea of routing with DOM elements probably doesn't work well with this model; perhaps writing some JavaScript logic (or using a library) to set properties on the shop-app element will be better. Not interested in implementing here given the maintenance state of this repo.