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