Closed theengineear closed 5 years ago
@klebba ran into this one recently and did a lot of head-scratching before I realized what was going on. I think there are two options:
console.error
when not connected (hate this idea, we're not doing this)I'm sort of leaning towards (1). We can still do everything synchronously, but we just do a little less during construction, preferring to wait until connectedCallback
.
In particular, any reservations to deferring property analysis until first connected callback?
^^ I went ahead and made this change locally. It's much, much better. One side effect here is that we can see previously-hidden setup errors in demos again 🥇. Additionally, it's possible to test for these errors in /test
🥈.
Currently, our pattern is to call
.dispatchError
such that some integrator can do.addEventListener('error', () => { /* .. */ })
and listen to errors from children. However, errors can happen during connection.We need to do something different here since we're missing signals about errors which can cause silent failures.