jsii-reflect 1.89.0 → 1.90.0

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.
@@ -11,6 +11,7 @@ export declare class TypeSystem {
11
11
  */
12
12
  readonly roots: Assembly[];
13
13
  private readonly _assemblyLookup;
14
+ private readonly _cachedClasses;
14
15
  /**
15
16
  * All assemblies in this type system.
16
17
  */
@@ -16,6 +16,7 @@ class TypeSystem {
16
16
  */
17
17
  this.roots = new Array();
18
18
  this._assemblyLookup = new Map();
19
+ this._cachedClasses = new Map();
19
20
  }
20
21
  /**
21
22
  * All assemblies in this type system.
@@ -214,7 +215,12 @@ class TypeSystem {
214
215
  get classes() {
215
216
  const out = new Array();
216
217
  this.assemblies.forEach((a) => {
217
- out.push(...collectTypes(a, (item) => item.classes));
218
+ // Cache the class list for each assembly. We can't use @memoized for this method since new
219
+ // assemblies can be added between calls, via loadModule().
220
+ if (!this._cachedClasses.has(a)) {
221
+ this._cachedClasses.set(a, collectTypes(a, (item) => item.classes));
222
+ }
223
+ out.push(...this._cachedClasses.get(a));
218
224
  });
219
225
  return out;
220
226
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "jsii-reflect",
3
- "version": "1.89.0",
3
+ "version": "1.90.0",
4
4
  "description": "strongly-typed reflection library and tools for jsii",
5
5
  "license": "Apache-2.0",
6
6
  "author": {
@@ -34,18 +34,18 @@
34
34
  "package": "package-js"
35
35
  },
36
36
  "dependencies": {
37
- "@jsii/check-node": "1.89.0",
38
- "@jsii/spec": "^1.89.0",
37
+ "@jsii/check-node": "1.90.0",
38
+ "@jsii/spec": "^1.90.0",
39
39
  "chalk": "^4",
40
40
  "fs-extra": "^10.1.0",
41
- "oo-ascii-tree": "^1.89.0",
41
+ "oo-ascii-tree": "^1.90.0",
42
42
  "yargs": "^16.2.0"
43
43
  },
44
44
  "devDependencies": {
45
- "@scope/jsii-calc-lib": "^1.89.0",
45
+ "@scope/jsii-calc-lib": "^1.90.0",
46
46
  "@types/fs-extra": "^9.0.13",
47
- "jsii": "^1.89.0",
48
- "jsii-build-tools": "^1.89.0",
47
+ "jsii": "^1.90.0",
48
+ "jsii-build-tools": "^1.90.0",
49
49
  "jsii-calc": "^3.20.120"
50
50
  }
51
51
  }