Commit 17bf498
authored
fix(jsii-reflect): statically guarantee JsiiFeature subset (#4956)
When new a tool is using `jsii-reflect` to read a jsii assembly, it must declare what JSII features it supports. If the assembly uses new features that the tool doesn't support yet, the load will fail.
However, `jsii-reflect` *itself* must also support those features, so the set of features that the tool declares must be a subset of the set of features that `jsii-reflect` itself supports.
This used to be checked dynamically, but that is easy to get wrong. We can lift this information into the TypeScript type system, so that it becomes a type error to call `jsii-reflect` with features that it doesn't know about yet.
---
By submitting this pull request, I confirm that my contribution is made under the terms of the [Apache 2.0 license].
[Apache 2.0 license]: https://www.apache.org/licenses/LICENSE-2.01 parent 4fa0a4b commit 17bf498
1 file changed
+7
-1
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
26 | 26 | | |
27 | 27 | | |
28 | 28 | | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
29 | 35 | | |
30 | 36 | | |
31 | 37 | | |
| |||
368 | 374 | | |
369 | 375 | | |
370 | 376 | | |
371 | | - | |
| 377 | + | |
372 | 378 | | |
373 | 379 | | |
374 | 380 | | |
| |||
0 commit comments