Skip to content

Commit 33d60b9

Browse files
author
Brian Kim
committed
tweak comments
1 parent 3f120f8 commit 33d60b9

File tree

1 file changed

+9
-7
lines changed

1 file changed

+9
-7
lines changed

src/crank.ts

+9-7
Original file line numberDiff line numberDiff line change
@@ -186,7 +186,7 @@ export interface Element<TTag extends Tag = Tag> {
186186
tag: TTag;
187187

188188
/**
189-
* An object containing the properties of an element. These correspond to
189+
* An object containing the "properties" of an element. These correspond to
190190
* the attribute syntax from JSX.
191191
*/
192192
props: TagProps<TTag>;
@@ -351,7 +351,7 @@ function narrow(value: Children): NarrowedChild {
351351
*
352352
* @template TNode - The node type for the element provided by the renderer.
353353
*
354-
* When asking the question, what is the value of a specific element, the
354+
* When asking the question, what is the "value" of a specific element, the
355355
* answer varies depending on the tag:
356356
*
357357
* For host elements, the value is the nodes created for the element.
@@ -848,6 +848,8 @@ function diffChildren<TNode, TScope, TRoot extends TNode, TResult>(
848848
let childrenByKey: Map<Key, Retainer<TNode>> | undefined;
849849
let seenKeys: Set<Key> | undefined;
850850
let isAsync = false;
851+
// When hydrating, sibling element trees must be rendered in order, because
852+
// we do not know how many DOM nodes an element will render.
851853
let hydrationBlock: Promise<unknown> | undefined;
852854
let oi = 0;
853855
let oldLength = oldRetained.length;
@@ -1429,11 +1431,11 @@ const PropsAvailable = 1 << 5;
14291431
/**
14301432
* A flag which is set when a component errors.
14311433
*
1432-
* NOTE: This is mainly used to prevent some false positives in component
1433-
* yields or returns undefined warnings. The reason we’re using this versus
1434-
* IsUnmounted is a very troubling test (cascades sync generator parent and
1435-
* sync generator child) where synchronous code causes a stack overflow error
1436-
* in a non-deterministic way. Deeply disturbing stuff.
1434+
* This is mainly used to prevent some false positives in "component yields or
1435+
* returns undefined" warnings. The reason we’re using this versus IsUnmounted
1436+
* is a very troubling test (cascades sync generator parent and sync generator
1437+
* child) where synchronous code causes a stack overflow error in a
1438+
* non-deterministic way. Deeply disturbing stuff.
14371439
*/
14381440
const IsErrored = 1 << 6;
14391441

0 commit comments

Comments
 (0)