From 33d60b9382beb5f4ac76a68d527b2e2b9c024005 Mon Sep 17 00:00:00 2001 From: Brian Kim Date: Tue, 9 Jan 2024 13:49:17 -0800 Subject: [PATCH] tweak comments --- src/crank.ts | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/src/crank.ts b/src/crank.ts index aa41439e..fd94d959 100644 --- a/src/crank.ts +++ b/src/crank.ts @@ -186,7 +186,7 @@ export interface Element { tag: TTag; /** - * An object containing the “properties” of an element. These correspond to + * An object containing the "properties" of an element. These correspond to * the attribute syntax from JSX. */ props: TagProps; @@ -351,7 +351,7 @@ function narrow(value: Children): NarrowedChild { * * @template TNode - The node type for the element provided by the renderer. * - * When asking the question, what is the “value” of a specific element, the + * When asking the question, what is the "value" of a specific element, the * answer varies depending on the tag: * * For host elements, the value is the nodes created for the element. @@ -848,6 +848,8 @@ function diffChildren( let childrenByKey: Map> | undefined; let seenKeys: Set | undefined; let isAsync = false; + // When hydrating, sibling element trees must be rendered in order, because + // we do not know how many DOM nodes an element will render. let hydrationBlock: Promise | undefined; let oi = 0; let oldLength = oldRetained.length; @@ -1429,11 +1431,11 @@ const PropsAvailable = 1 << 5; /** * A flag which is set when a component errors. * - * NOTE: This is mainly used to prevent some false positives in component - * yields or returns undefined warnings. The reason we’re using this versus - * IsUnmounted is a very troubling test (cascades sync generator parent and - * sync generator child) where synchronous code causes a stack overflow error - * in a non-deterministic way. Deeply disturbing stuff. + * This is mainly used to prevent some false positives in "component yields or + * returns undefined" warnings. The reason we’re using this versus IsUnmounted + * is a very troubling test (cascades sync generator parent and sync generator + * child) where synchronous code causes a stack overflow error in a + * non-deterministic way. Deeply disturbing stuff. */ const IsErrored = 1 << 6;