@mintjamsinc/ichigojs 0.1.70 → 0.1.71

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.
@@ -13757,7 +13757,8 @@
13757
13757
  this.#logManager = new VLogManager(options.logLevel);
13758
13758
  this.#logger = this.#logManager.getLogger('VApplication');
13759
13759
  // Analyze function dependencies
13760
- this.#functionDependencies = ExpressionUtils.analyzeFunctionDependencies(options.methods || {});
13760
+ const methods = (options.methods || {});
13761
+ this.#functionDependencies = ExpressionUtils.analyzeFunctionDependencies(methods);
13761
13762
  // Analyze computed dependencies based on getter functions only.
13762
13763
  // Writable computeds (defined as { get, set }) contribute their getter for dependency analysis.
13763
13764
  const computedGetters = {};
@@ -13766,7 +13767,23 @@
13766
13767
  computedGetters[key] = VApplication.#getComputedGetter(def);
13767
13768
  }
13768
13769
  }
13769
- this.#computedDependencies = ExpressionUtils.analyzeFunctionDependencies(computedGetters);
13770
+ // Resolve computed dependencies against BOTH the computed getters AND the methods, so a
13771
+ // computed that delegates to a method inherits that method's reactive dependencies. A
13772
+ // computed whose only reactive reads happen inside a called method (e.g. a reactive i18n
13773
+ // `t()` helper that reads `this.localization`) would otherwise never be invalidated, leaving
13774
+ // its binding stale on a dependency change. Analyzing the combined set flattens every
13775
+ // computed→method (and computed→computed, method→method) edge down to the underlying
13776
+ // reactive paths — the same expansion that template-expression analysis already performs for
13777
+ // method calls (see ExpressionUtils.extractIdentifiers). We then keep only the computed
13778
+ // entries, since #computedDependencies must be keyed by computed name alone.
13779
+ const combinedDependencies = ExpressionUtils.analyzeFunctionDependencies({
13780
+ ...methods,
13781
+ ...computedGetters,
13782
+ });
13783
+ this.#computedDependencies = {};
13784
+ for (const key of Object.keys(computedGetters)) {
13785
+ this.#computedDependencies[key] = combinedDependencies[key] || [];
13786
+ }
13770
13787
  // Initialize watcher manager
13771
13788
  this.#watcher = new VWatcher(this.#logger);
13772
13789
  // Initialize bindings from data, computed, and methods
@@ -14120,10 +14137,10 @@
14120
14137
  }
14121
14138
  /**
14122
14139
  * Marks computed properties as dirty (pull-based invalidation) when a dependency changes.
14123
- * Uses the statically analyzed dependency graph; because computed→computed dependencies are
14124
- * flattened to their underlying reactive paths during analysis, a single change marks every
14125
- * transitively dependent computed dirty in one pass. The actual recomputation is deferred until
14126
- * the value is read (see #recomputeOne).
14140
+ * Uses the statically analyzed dependency graph; because computed→computed and computed→method
14141
+ * dependencies are flattened to their underlying reactive paths during analysis, a single change
14142
+ * marks every transitively dependent computed dirty in one pass. The actual recomputation is
14143
+ * deferred until the value is read (see #recomputeOne).
14127
14144
  * @param identifier The changed identifier reported by the bindings change tracker.
14128
14145
  */
14129
14146
  #markDirtyComputeds(identifier) {