ngx-json-render 0.7.7 → 0.7.8

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "ngx-json-render",
3
- "version": "0.7.7",
3
+ "version": "0.7.8",
4
4
  "description": "Angular renderer for json-render — stream AI-generated JSON specs into real Angular components with signals.",
5
5
  "keywords": [
6
6
  "angular",
@@ -628,7 +628,16 @@ declare class JrElement {
628
628
  private readonly repeatScope;
629
629
  private readonly parentPath;
630
630
  private readonly devtoolsActive;
631
- /** The raw (unresolved) element from the spec. */
631
+ /**
632
+ * The raw (unresolved) element from the spec.
633
+ *
634
+ * Compared by content, not identity. A streamed patch shares every element
635
+ * it did not touch, and the identity check settles those at once; but a
636
+ * spec can also arrive as all-new objects — a whole-spec part, a host that
637
+ * fetches it again, `buildSpecFromParts` replaying a message — and then an
638
+ * element whose content is unchanged would resolve, and every container
639
+ * with a fresh `children` array re-render, for nothing.
640
+ */
632
641
  readonly rawElement: Signal<UIElement<string, Record<string, unknown>> | undefined>;
633
642
  /**
634
643
  * The state paths this element's expressions can read, or null when the
@@ -662,21 +671,30 @@ declare class JrElement {
662
671
  private readonly resolutionCtx;
663
672
  protected readonly visible: Signal<boolean>;
664
673
  /**
665
- * The element with all prop expressions resolved.
674
+ * How many state writes have touched a path this element is two-way bound
675
+ * to. See {@link resolution} for why those writes count on their own.
676
+ */
677
+ private readonly boundWrites;
678
+ /**
679
+ * The element with all prop expressions resolved, and the bound writes it
680
+ * was resolved after.
666
681
  *
667
- * Resolving builds a new props object on every state write, whatever the
668
- * write touched. Handing that on as a change would re-run every catalog
669
- * template in the tree for one keystroke, so a result that holds the same
670
- * values as the last one counts as unchanged and keeps the old object.
682
+ * Resolving builds a new props object every time, so a result that holds
683
+ * the same values as the last one counts as unchanged and keeps the old
684
+ * object; otherwise one keystroke would re-run every catalog template that
685
+ * happened to resolve.
671
686
  *
672
- * Two-way bound elements are the exception, and keep treating every
673
- * resolution as a change. Their component writes the user's input into the
674
- * DOM before it reaches state, so the DOM can differ from a prop whose
675
- * value never did: typing and a `clearStatePath` in the same turn take
676
- * the prop from '' through 'milk' back to '' with nobody reading 'milk'.
677
- * The README tells catalog authors to sync such inputs with an effect on
678
- * props, and that effect only gets to put the DOM right if it runs.
687
+ * A write to a path the element is bound to always counts, though. Its
688
+ * component writes the user's input into the DOM before it reaches state,
689
+ * so the DOM can differ from a prop whose value never did: typing and a
690
+ * `clearStatePath` in the same turn take the prop from '' through 'milk'
691
+ * back to '' with nobody reading 'milk'. The README tells catalog authors
692
+ * to sync such inputs with an effect on props, and that effect only gets to
693
+ * put the DOM right if it runs. Writes anywhere else compare by value, like
694
+ * any element's.
679
695
  */
696
+ private readonly resolution;
697
+ /** The element with all prop expressions resolved. */
680
698
  readonly resolvedElement: Signal<UIElement<string, Record<string, unknown>> | undefined>;
681
699
  /** Two-way binding paths ($bindState / $bindItem) by prop name. */
682
700
  readonly bindings: Signal<Record<string, string> | undefined>;