DEV Community

Discussion on: SimpleWC - JSON driven web components

Collapse
 
westbrook profile image
Westbrook Johnson

This sort of configuration requisitive syntax strikes me (as a person who never used these things, so take it with a grain of salt) as very similar to React.createClass({}) and new Vue({}). Particularly, this listing of methods/callbacks/data/et al is very similar to what you get currently in Vue. It was also part of web component past in the form of Polymer during the v0 times...yes, I volunteer as tribute on that prime little code snippet. In all cases, this reliance on JSON gave way to classes and then later (or very soon, at least if the Vue RFC on it gets approved) to functional programming styles. That progression likely is saying something about capability/flexibility/maintainability that is worth listening to, even if it might not be directly pointing to "eliminat[ing] hardcore developers as a barrier".

With that as a stated goal, I'd think you'd be more likely to find a solution like matthewphillips.info/programming/d... in order to take JS out of the equation. It likely will never manage the scope of functionality you're pumping into SimpleWC, but with the amount of functionality that's packed in, hardcore developers might be a prerequisite... If you're looking to lower that barrier while also staying in the JS realm, I wonder what you think of class-based composition (like you see in the Elix project). It's not quite as explicit as what you're getting at with SimpleWC but it does has the side effect of making functionality a clear buy-in process for those "less hardcore" developers.

For my money, I want to work on the composability of web components in HTML or as close to HTML as possible (lit-html allows you a lot of flexibility there!). I think the promise of the slot API shouldn't be the end of the road, but the beginning. Combining that with pointed usage of Mutation Observers, "hardcore" developers should be able to make components that can better support others in bringing what they see in their minds into the world. And, all the while, helping us all in getting back to the beautiful ideals behind web components being the Legos of the internet.

Excited to see more research put into this part of the community, though. JS devs (generally, myself included, sadly) spend so much time being "clever" and so little time being "helpful" that it's really refreshing to see your thoughts here! Looking forward to seeing where this goes.