DEV Community

Discussion on: The Web Components journey: wrong ways, lacking parts and promising paths

Collapse
 
webpadawan profile image
Serhii Kulykov

The problem as I see it lies in choosing improper abstraction.

There is no need for such components to be in the DOM, and to query from the DOM just because we consider HTML as the only way of writing declarative code in the applications we build.

I still think that DOM should only contain the "view" layer, whereas router is better to have as JS library not necessarily tightly coupled with web components.

Collapse
 
bennypowers profile image
Benny Powers 🇮🇱🇨🇦

Thanks for the explanation. Do you think that having that model code in the DOM was error prone or insecure, or is it strictly a matter of separation of concerns?

Thread Thread
 
webpadawan profile image
Serhii Kulykov • Edited

I think both statements are valid to some extent.

Storing data (especially, when it comes to application state) in DOM is one problem, attempting to use DOM for meta programming is a different one.

Interestingly, trying to solve the first problem could sometimes result in leaning towards the second one, as we can see it when looking at github.com/google/uniflow-polymer

In my opinion, all these problems have been implied by the two way data binding system and how it affected the way of thinking of Polymer users.