@tscircuit/core 0.0.1340 → 0.0.1341

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/index.d.ts CHANGED
@@ -1715,6 +1715,15 @@ declare abstract class PrimitiveComponent<ZodProps extends ZodType = any> extend
1715
1715
  getGroup(): IGroup | null;
1716
1716
  doInitialAssignNameToUnnamedComponents(): void;
1717
1717
  doInitialOptimizeSelectorCache(): void;
1718
+ /**
1719
+ * The selector caches memoize results assuming the component tree is stable.
1720
+ * When the tree changes after the cache is first built (e.g. a connector adds
1721
+ * its ports asynchronously once a parts-engine fetch resolves), this phase is
1722
+ * re-marked dirty via _markDirty and re-runs as an update. Drop the stale
1723
+ * memoized results so later queries see the current tree, then re-warm the
1724
+ * subcircuit cache.
1725
+ */
1726
+ updateOptimizeSelectorCache(): void;
1718
1727
  _cachedSelectAllQueries: Map<string, PrimitiveComponent[]>;
1719
1728
  selectAll<T extends PrimitiveComponent = PrimitiveComponent>(selectorRaw: string): T[];
1720
1729
  _cachedSelectOneQueries: Map<string, PrimitiveComponent | null>;
package/dist/index.js CHANGED
@@ -2039,6 +2039,19 @@ var PrimitiveComponent2 = class extends Renderable {
2039
2039
  }
2040
2040
  }
2041
2041
  }
2042
+ /**
2043
+ * The selector caches memoize results assuming the component tree is stable.
2044
+ * When the tree changes after the cache is first built (e.g. a connector adds
2045
+ * its ports asynchronously once a parts-engine fetch resolves), this phase is
2046
+ * re-marked dirty via _markDirty and re-runs as an update. Drop the stale
2047
+ * memoized results so later queries see the current tree, then re-warm the
2048
+ * subcircuit cache.
2049
+ */
2050
+ updateOptimizeSelectorCache() {
2051
+ this._cachedSelectAllQueries.clear();
2052
+ this._cachedSelectOneQueries.clear();
2053
+ this.doInitialOptimizeSelectorCache();
2054
+ }
2042
2055
  _cachedSelectAllQueries = /* @__PURE__ */ new Map();
2043
2056
  selectAll(selectorRaw) {
2044
2057
  if (this._cachedSelectAllQueries.has(selectorRaw)) {
@@ -24034,7 +24047,7 @@ import { identity as identity5 } from "transformation-matrix";
24034
24047
  var package_default = {
24035
24048
  name: "@tscircuit/core",
24036
24049
  type: "module",
24037
- version: "0.0.1339",
24050
+ version: "0.0.1340",
24038
24051
  types: "dist/index.d.ts",
24039
24052
  main: "dist/index.js",
24040
24053
  module: "dist/index.js",
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@tscircuit/core",
3
3
  "type": "module",
4
- "version": "0.0.1340",
4
+ "version": "0.0.1341",
5
5
  "types": "dist/index.d.ts",
6
6
  "main": "dist/index.js",
7
7
  "module": "dist/index.js",