diff --git a/notes.txt b/notes.txt deleted file mode 100644 index ac42667..0000000 --- a/notes.txt +++ /dev/null @@ -1,31 +0,0 @@ -* Context - * Community protocol - * Hydration timing doesn't really work - * No way to await future provided context - * Should we define global state to represent pending context requests? - * New implementation - * Requires everyone to agree on the single implementation. - * Imperative API means it can be used outside Hydrator. - * Hydrating timing alternative - * Could run `@provide()` immediately but delay `hydrate()` by a microtask. - * This would mean that reading context is done asynchronously from the initial - execution which gives an opportunity for ancestor components to hydrate and - provide that context. - * This would make `getContext()` more ergonomic in `hydrate()`, since we would be - reasonably sure any ancestors are already providing the relevant context. - * Doesn't work in practice because it would make hydration logic circular. For - `@provide()` to execute first, it needs to also get the value for that property, - which likely comes from an `@hydrate()`. To run `@hydrate()`, we need to hydrate - descendant components to support syntax like - `@hydrate('child-component', (el) => el.count)`. - * Hydrating children first means they will request context before it can be provided - by the parent. - * Even if this wasn't an issue, we can't generally assume that all ancestor - components will hydrate synchronously, since we can't assume they are all - implemented with Hydrator. - * As a result, we still run into the same problem of requiring a descendant - component to wait for context to be provided by an ancestor component. - * This approach also breaks user-space `connectedCallback()` and - `disconnectedCallback()` because they can run before hydration and nothing is - initialized. - * TL;DR: This alternative just doesn't work. \ No newline at end of file