Re: [w3c/webcomponents] How to define APIs only for custom element authors (#758)

@annevk I should have addressed those better, sorry! 

Here are my concerns with the those approaches (I count only two, really - the first alternative is just to use `ShadowRoot`):

- Either way, we'll have to create a new type which is simply an empty object with [`AccessibilityRole`](https://www.w3.org/TR/wai-aria-1.2/#AccessibilityRole) and [`AriaAttributes`](https://www.w3.org/TR/wai-aria-1.2/#AriaAttributes) mixed in, which is kind of awkward. 
- The "con" noted for the `new Something(element)` option seems like a deal breaker to me (that anyone can construct one for an element which doesn't already have one) - it's the opposite of encapsulation, which is what we're aiming for. (Presumably constructing a `Something` for a built-in element would be forbidden). Do authors need to construct a new `Something` defensively whenever they create a custom element, for all possible values of `Something` (if many APIs use this strategy)?
- The lifecycle callback option is probably the one I would be least uncomfortable with, but I think it implies having a single object named something like `ElementConfiguration` which can grow to hold all of these various objects (`ElementStates`, `HTMLElementPrimitives`, etc.) which is passed in in a single lifecycle event. Otherwise, it seems like either each new API has to create a new lifecycle event (?) or else the `createdCallback` ends up with a mess of arguments.
 

-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/w3c/webcomponents/issues/758#issuecomment-409858983

Received on Thursday, 2 August 2018 09:07:03 UTC