@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.
@@ -12620,7 +12620,7 @@ class VApplication {
12620
12620
  #initializeBindings() {
12621
12621
  // Create bindings with change tracking
12622
12622
  this.#bindings = new VBindings({
12623
- onChange: (identifier) => {
12623
+ onChange: () => {
12624
12624
  this.#scheduleUpdate();
12625
12625
  },
12626
12626
  vApplication: this
@@ -12798,17 +12798,20 @@ class VApplication {
12798
12798
  processing.add(key);
12799
12799
  // Get the dependencies for this computed property
12800
12800
  const deps = this.#computedDependencies[key] || [];
12801
- // If none of the dependencies have changed, skip recomputation (unless it's initialization)
12802
- if (!isInitialization && !deps.some(dep => allChanges.has(dep))) {
12803
- computed.add(key);
12804
- return;
12805
- }
12806
- // First, recursively compute any dependent computed properties
12801
+ // First, recursively compute any dependent computed properties.
12802
+ // This must happen before the change check so that computed→computed
12803
+ // dependency chains are resolved and allChanges is up-to-date.
12807
12804
  for (const dep of deps) {
12808
12805
  if (this.#options.computed[dep]) {
12809
12806
  compute(dep);
12810
12807
  }
12811
12808
  }
12809
+ // If none of the dependencies have changed, skip recomputation (unless it's initialization).
12810
+ // Checked after recursive computation to detect transitive changes through computed properties.
12811
+ if (!isInitialization && !deps.some(dep => allChanges.has(dep))) {
12812
+ computed.add(key);
12813
+ return;
12814
+ }
12812
12815
  // Now compute this property
12813
12816
  const computedFn = this.#options.computed[key];
12814
12817
  try {
@@ -12850,13 +12853,10 @@ class VApplication {
12850
12853
  computed.add(key);
12851
12854
  processing.delete(key);
12852
12855
  };
12853
- // Find all computed properties that need to be recomputed
12854
- for (const [key, deps] of Object.entries(this.#computedDependencies)) {
12855
- // During initialization, compute all properties
12856
- // Otherwise, check if any dependency has changed
12857
- if (isInitialization || deps.some(dep => allChanges.has(dep))) {
12858
- compute(key);
12859
- }
12856
+ // Compute all properties; the recursive logic inside compute() handles
12857
+ // dependency ordering and skips properties whose dependencies did not change.
12858
+ for (const key of Object.keys(this.#computedDependencies)) {
12859
+ compute(key);
12860
12860
  }
12861
12861
  }
12862
12862
  /**