5 ms·
I was trying Polymer as a components library along with React (with react-polymer, and a bunch of glue code). That way the React code amounts, indeed, to a laye
by dylan-m 8y ago
I was trying Polymer as a components library along with React (with react-polymer, and a bunch of glue code). That way the React code amounts, indeed, to a layer of scaffolding saying "render this component here with this data from here." It was wonderful, since to me it felt much more like working with a real UI toolkit, and the only part of React I needed to deal with was the part of it that's actually good. The thing is we already have that abstraction with all of the HTML form widgets, even mirrored in React proper, so _why not_ provide a similar interface around dialogs, progress bars, buttons and menus instead of spitting out gobs of div tags everywhere?
There is a bit of trouble here where different components don't always have a consistent interface, which kind of ruins the "yay, I don't need to think about how buttons are implemented!" thing, but sticking within Google's core library was mostly working out okay. Not sure how it would have panned out in the future, but my sense at the time was we just need some richer widget libraries that include layout components and it'll end up feeling pretty slick.
Alas, nobody else on the team was all that interested in reinventing the wheel, so it's a normal React app again. (This is a good thing, really). But I thought it was a nice taste of the sort of cleanliness we could get with web components.
Edit: Here's where I got, in a now-orphaned commit: https://github.com/pg-irc/pathways-frontend/tree/80fd61cf1f96ac57ef7ede596f5acea3bd76eee1 https://github.com/pg-irc/pathways-frontend/tree/80fd61cf1f9.... It was the wrong direction, but I thought it was pretty cool :) (And, incidentally, that there is a really cool open source project if anyone's looking for something warm and fuzzy to contribute to).
- ravenstine 8y agoI took a look at your code, particularly the src/js/ui-components/LinkButton, and that's a lot like what I've been doing in an Ember project, only using a mixture of Polymer and Material Components Web. Why do you say it was the wrong direction? Just curious. Is it because you ended up using React Native?
- dylan-m 8y agoOh, I was happy with it technically, and I'm glad you're doing something similar with some success! It was just the wrong direction there because it added some friction, building new things where we don't need to build new things. For a personal project, I would still be doing it that way :)