Nested components: slots (different! Also always need closing tags)
, , and `
Nested components: render props, connect(), etc
Unusually difficult to achieve. You can always operate on the component object before passing to define(), but you can't pass complex data types through as props. (Dynamic props are also difficult, but mostly because we're used to passing them through the template, rather than writing a function that returns define()). This makes refactoring into logic/presentation components awkward at best.
Store: as a plain object with store.get(id)
Store: as a DOM component with parent()
Store: with connect()
Was hoping to make unit testing easier by separating store-ful logic from an otherwise dumb component
Difficultly adding dynamic props to a component
connect() seemed rather forced
Events
Persistence
get()/set()/connect() hard to get right
Refactoring so easy
Testing
Shadow DOM
Unit testing
Forms
The bizarrely cool children() helper
Problem: if property is unused by child's render() fn, the listening parent node won't get updated.
Got excited about custom validation without abstractions, but Hybrids does not provide a way to interact directly with the class declaration to add static formAssociated = true, attachInternals(), etc. This and having zero lifecycles does seem to force awkward solutions when I need to access the class.
Pros
One of the few web component libraries that is functional-friendly and feels similar to React's functional style
Easily get reference to store or DOM by ID. It's just an object or a DOM node. Which means you can easily inspect those values.
Low-level, unopinionated, flexible API's let you write in different styles
Computed props like Vue are delightfully easy to write, but pure unlike Vue
Need a store or context? You can define a store component wrapper like React
Named slots are wonderful, reminds me of Vue but it's the actual web
Lots of functions and explicit arguments like host makes refactoring so darn easy
Writing HTML feels just like writing JSX in React. No custom for-loop or if...else constructs, no directives. It's just JavaScript or HTML
You can pass down a handler like React, or emit a custom event like Vue or Angular. Your choice! It's flexible.
Cons
Abstraction makes impossible to do the handful of cases where dealing directly with DOM/lifecycles makes perfect sense. I found the framework getting in my way particularly when building forms, setting up storage, and side effects in general.
Defining props feels a little clumsy, particularly if they are primitives
html util feels like it's doing too much. There's html.resolve(), html.css(), etc. These interfaces feel a little faddy/fragile.
Community seems rather small. Not much going on in social media, forums, and API documentation could be much more detailed
No great way to do dynamic props like React's spread operator
No good "two-way" data packaging (aka. v-model in Vue, or a packaged getter/setter)
Not sure/outstanding questions
This framework brings its own mini-paradigms around the concepts of the store and component refactoring. It has some elegant ways to accomplish these, but feels awkward once you impose other patterns (complex/dynamic props, higher order components) on it.
Referring to object/DOM ID's is both interesting and weird, but it's at least vanilla!