5 ms·
I really hope that web components take off, because I'm getting pretty tired of having to learn different ways of building components every damned year. Most c
by ravenstine 8y ago
I really hope that web components take off, because I'm getting pretty tired of having to learn different ways of building components every damned year. Most components don't need blazing-fast rendering engines, the templating engine of the now, or even two-way bindings out of the box, and thus I'd like to use components that can live on their own but also be easily wrapped into whatever framework I'm using.
I'd like frameworks to be a lot closer to scaffolds, or actually be frameworks, as opposed to what most of them are now which is reimplementations of application units. The web components standard can help make it possible for tools to become interoperable between frameworks(okay, and view libraries), that would be wonderful.
- nevir 8y agoWeb components work very well in isolation, and/or within a homogenous web component framework/library. However, it is still pretty challenging to pass data throughout web components (in a way that allows you to build a complete application). HTML attributes are not great for data transfer (string serialization for everything). JS properties are a bit opaque (not represented by markup). And everyone ends up wanting some sort of property binding system, which may be unrealistic to standardize. I think there will always be a place for some amount of framework/library support necessary for application builders.
- ravenstine 8y agoOh I definitely agree. I'm not at all proposing that components make frameworks obsolete. It's just that I would like a future where the Web Component standard becomes the first answer to the frontend development question before moving on to more specialized solutions. Existing frameworks and Web Components would go hand in hand.
- tdumitrescu 8y agoYeah, the way we use web components at Mixpanel involves sticking to the vanilla APIs for lifecycle management, but we still need libraries to handle inter-component communication, state and rendering (see my discussion at https://engineering.mixpanel.com/2018/06/12/making-web-components-work/ https://engineering.mixpanel.com/2018/06/12/making-web-compo... and https://github.com/mixpanel/panel https://github.com/mixpanel/panel). I do hope some of these concerns eventually get addressed in the standards though.
- spankalee 8y agoIt's quite easy to pass properties between elements and build entire apps out of Web Components. Many have been doing it for years. Yes, it requires not just using plain markup - but template systems or JSX+VDOM are really good at this, and there's a huge choice in libraries. SkateJS is a library that allows you to plug-in several renderers to build components. LitElement uses lit-html. Polymer, Svelte, Vue, and Angular (the last when compiled to Custom Elements) have their own... There also is a chance at standardization with the Template Instantiation proposal from Apple.
- petilon 8y ago> HTML attributes are not great for data transfer (string serialization for everything). You can JSX (as first introduced by React) to pass objects to Web Components. See: https://github.com/wisercoder/uibuilder https://github.com/wisercoder/uibuilder
- pjmlp 8y agoSame here, best of all if we start getting Web IDEs built on top of Web Components provinding a Delphi/VB like RAD experience. Yeah, I know there are a comple of startups attempting to get a foothold on this, but it is still very hard to gain momentum, it seems.
- tatersolid 8y agoHave you ever been an actual end user of one of those Delphi/VB RAD crapplications that were so easy to build? I think your goal is very misguided. They all sucked, and were basically no better than MS Access forms.
- pjmlp 8y agoYes I have, Borland's common controls dll were quite easy to recognize. Not everyone was doing Access style CRUD entry forms. However I have seen a couple of nasty VB.NET apps written by weekend programmers at a research lab, just because they knew a bit VBA. And while they were nasty, they still made them more productive than before, without being stuck waiting for IT support.
- tdumitrescu 8y agoI think the browser dev tools (esp. Chrome's) show some promise in that regard. For instance with Workspaces you can mess around in dev tools and save changes directly to your source files; with a tighter integration between the element inspector, source view, and js console they could achieve some real visual programming power there (for instance being able to jump from a component rendered in the UI directly to its code and representation of current state).
- dylan-m 8y agoI 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 :)
- jimmy1 8y ago> I really hope that web components take off, because I'm getting pretty tired of having to learn different ways of building components every damned year. I feel like this is a gross exaggeration. You would have had to learn a maximum of two, of which the dominate ones have been around for years now.