@mintjamsinc/ichigojs 0.1.45 → 0.1.46

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/dist/ichigo.cjs CHANGED
@@ -12626,7 +12626,7 @@
12626
12626
  #initializeBindings() {
12627
12627
  // Create bindings with change tracking
12628
12628
  this.#bindings = new VBindings({
12629
- onChange: (identifier) => {
12629
+ onChange: () => {
12630
12630
  this.#scheduleUpdate();
12631
12631
  },
12632
12632
  vApplication: this
@@ -12804,17 +12804,20 @@
12804
12804
  processing.add(key);
12805
12805
  // Get the dependencies for this computed property
12806
12806
  const deps = this.#computedDependencies[key] || [];
12807
- // If none of the dependencies have changed, skip recomputation (unless it's initialization)
12808
- if (!isInitialization && !deps.some(dep => allChanges.has(dep))) {
12809
- computed.add(key);
12810
- return;
12811
- }
12812
- // First, recursively compute any dependent computed properties
12807
+ // First, recursively compute any dependent computed properties.
12808
+ // This must happen before the change check so that computed→computed
12809
+ // dependency chains are resolved and allChanges is up-to-date.
12813
12810
  for (const dep of deps) {
12814
12811
  if (this.#options.computed[dep]) {
12815
12812
  compute(dep);
12816
12813
  }
12817
12814
  }
12815
+ // If none of the dependencies have changed, skip recomputation (unless it's initialization).
12816
+ // Checked after recursive computation to detect transitive changes through computed properties.
12817
+ if (!isInitialization && !deps.some(dep => allChanges.has(dep))) {
12818
+ computed.add(key);
12819
+ return;
12820
+ }
12818
12821
  // Now compute this property
12819
12822
  const computedFn = this.#options.computed[key];
12820
12823
  try {
@@ -12856,13 +12859,10 @@
12856
12859
  computed.add(key);
12857
12860
  processing.delete(key);
12858
12861
  };
12859
- // Find all computed properties that need to be recomputed
12860
- for (const [key, deps] of Object.entries(this.#computedDependencies)) {
12861
- // During initialization, compute all properties
12862
- // Otherwise, check if any dependency has changed
12863
- if (isInitialization || deps.some(dep => allChanges.has(dep))) {
12864
- compute(key);
12865
- }
12862
+ // Compute all properties; the recursive logic inside compute() handles
12863
+ // dependency ordering and skips properties whose dependencies did not change.
12864
+ for (const key of Object.keys(this.#computedDependencies)) {
12865
+ compute(key);
12866
12866
  }
12867
12867
  }
12868
12868
  /**