The first problem I see lacking in Custom Elements is the data flow between components.
Evan You
121

The data flow issue I think is orthogonal to Custom Elements / Web Components. JSX, data binding, etc. are all doing the same thing essentially: working around the lack of object passing in HTML attributes. That doesn’t mean that you have to throw away the component model because HTML is missing this feature. That seems like throwing out the baby with the bathwater. You can write a vanilla Custom Element and then use it with whatever data flow system you’d like: JSX, diffhtml, Polymer’s data binding, etc.

Regarding your 2nd point, authors are free to use whatever libraries they wish inside of Custom Elements to make the authoring practice easier. I’ll talk about this a bit more in Part 2, but diffhtml is an example library that can be used inside Custom Elements to let you write JSX-like syntax if that’s how you prefer to work. https://github.com/tbranyen/diffhtml#html and there are adapters for JSX itself that will also work inside CEs. https://component.kitchen/blog/posts/using-react-app-techniques-at-the-web-component-level-with-redux-virtual-dom-and-jsx

Really you’re free to author the internals of the element however you wish. The nice thing is by being standards based you can bundle it up into an interoperable element and folks using it can ignore the implementation details.

Show your support

Clapping shows how much you appreciated Rob Dodson’s story.