Skip to content

Commit 20507e6

Browse files
authored
feat(jsii): Propagate stability to members (#522)
The JSII compiler now propagates an entity's own stability to it's members that are not decorated with an explicit stability. Un-annotated types get the stability of the assembly, un-annotated type members (methods, properties, constructors, ...) get the stability of their declaring type. Note: Overridden members do not derogate! It is the responsibility of the overriding entity to ensure an appropriate stability is used.
1 parent 28241cd commit 20507e6

File tree

323 files changed

+8553
-232
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

323 files changed

+8553
-232
lines changed

packages/jsii-calc-lib/test/assembly.jsii

Lines changed: 41 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -122,6 +122,7 @@
122122
"@scope/jsii-calc-lib.EnumFromScopedModule": {
123123
"assembly": "@scope/jsii-calc-lib",
124124
"docs": {
125+
"stability": "deprecated",
125126
"summary": "Check that enums from \\@scoped packages can be references. See awslabs/jsii#138."
126127
},
127128
"fqn": "@scope/jsii-calc-lib.EnumFromScopedModule",
@@ -132,9 +133,15 @@
132133
},
133134
"members": [
134135
{
136+
"docs": {
137+
"stability": "deprecated"
138+
},
135139
"name": "Value1"
136140
},
137141
{
142+
"docs": {
143+
"stability": "deprecated"
144+
},
138145
"name": "Value2"
139146
}
140147
],
@@ -143,6 +150,7 @@
143150
"@scope/jsii-calc-lib.IDoublable": {
144151
"assembly": "@scope/jsii-calc-lib",
145152
"docs": {
153+
"stability": "deprecated",
146154
"summary": "The general contract for a concrete number."
147155
},
148156
"fqn": "@scope/jsii-calc-lib.IDoublable",
@@ -155,6 +163,9 @@
155163
"properties": [
156164
{
157165
"abstract": true,
166+
"docs": {
167+
"stability": "deprecated"
168+
},
158169
"immutable": true,
159170
"locationInModule": {
160171
"filename": "lib/index.ts",
@@ -171,6 +182,7 @@
171182
"assembly": "@scope/jsii-calc-lib",
172183
"docs": {
173184
"remarks": "These classes can be greeted with\na \"hello\" or \"goodbye\" blessing and they will respond back in a fun and friendly manner.",
185+
"stability": "deprecated",
174186
"summary": "Applies to classes that are considered friendly."
175187
},
176188
"fqn": "@scope/jsii-calc-lib.IFriendly",
@@ -183,6 +195,7 @@
183195
{
184196
"abstract": true,
185197
"docs": {
198+
"stability": "deprecated",
186199
"summary": "Say hello!"
187200
},
188201
"locationInModule": {
@@ -203,6 +216,7 @@
203216
"assembly": "@scope/jsii-calc-lib",
204217
"docs": {
205218
"remarks": "Their presence validates that .NET/Java/jsii-reflect can track all fields\nfar enough up the tree.",
219+
"stability": "deprecated",
206220
"summary": "Interface that inherits from packages 2 levels up the tree."
207221
},
208222
"fqn": "@scope/jsii-calc-lib.IThreeLevelsInterface",
@@ -217,6 +231,9 @@
217231
"methods": [
218232
{
219233
"abstract": true,
234+
"docs": {
235+
"stability": "deprecated"
236+
},
220237
"locationInModule": {
221238
"filename": "lib/index.ts",
222239
"line": 109
@@ -230,6 +247,7 @@
230247
"assembly": "@scope/jsii-calc-lib",
231248
"datatype": true,
232249
"docs": {
250+
"stability": "deprecated",
233251
"summary": "This is the first struct we have created in jsii."
234252
},
235253
"fqn": "@scope/jsii-calc-lib.MyFirstStruct",
@@ -243,6 +261,7 @@
243261
{
244262
"abstract": true,
245263
"docs": {
264+
"stability": "deprecated",
246265
"summary": "An awesome number value."
247266
},
248267
"immutable": true,
@@ -258,6 +277,7 @@
258277
{
259278
"abstract": true,
260279
"docs": {
280+
"stability": "deprecated",
261281
"summary": "A string value."
262282
},
263283
"immutable": true,
@@ -272,6 +292,9 @@
272292
},
273293
{
274294
"abstract": true,
295+
"docs": {
296+
"stability": "deprecated"
297+
},
275298
"immutable": true,
276299
"locationInModule": {
277300
"filename": "lib/index.ts",
@@ -294,11 +317,13 @@
294317
"assembly": "@scope/jsii-calc-lib",
295318
"base": "@scope/jsii-calc-lib.Value",
296319
"docs": {
320+
"stability": "deprecated",
297321
"summary": "Represents a concrete number."
298322
},
299323
"fqn": "@scope/jsii-calc-lib.Number",
300324
"initializer": {
301325
"docs": {
326+
"stability": "deprecated",
302327
"summary": "Creates a Number object."
303328
},
304329
"parameters": [
@@ -325,6 +350,7 @@
325350
"properties": [
326351
{
327352
"docs": {
353+
"stability": "deprecated",
328354
"summary": "The number multiplied by 2."
329355
},
330356
"immutable": true,
@@ -340,6 +366,7 @@
340366
},
341367
{
342368
"docs": {
369+
"stability": "deprecated",
343370
"summary": "The number."
344371
},
345372
"immutable": true,
@@ -360,6 +387,7 @@
360387
"assembly": "@scope/jsii-calc-lib",
361388
"base": "@scope/jsii-calc-lib.Value",
362389
"docs": {
390+
"stability": "deprecated",
363391
"summary": "Represents an operation on values."
364392
},
365393
"fqn": "@scope/jsii-calc-lib.Operation",
@@ -373,6 +401,7 @@
373401
{
374402
"abstract": true,
375403
"docs": {
404+
"stability": "deprecated",
376405
"summary": "String representation of the value."
377406
},
378407
"locationInModule": {
@@ -394,6 +423,7 @@
394423
"assembly": "@scope/jsii-calc-lib",
395424
"datatype": true,
396425
"docs": {
426+
"stability": "deprecated",
397427
"summary": "This is a struct with only optional properties."
398428
},
399429
"fqn": "@scope/jsii-calc-lib.StructWithOnlyOptionals",
@@ -407,6 +437,7 @@
407437
{
408438
"abstract": true,
409439
"docs": {
440+
"stability": "deprecated",
410441
"summary": "The first optional!"
411442
},
412443
"immutable": true,
@@ -422,6 +453,9 @@
422453
},
423454
{
424455
"abstract": true,
456+
"docs": {
457+
"stability": "deprecated"
458+
},
425459
"immutable": true,
426460
"locationInModule": {
427461
"filename": "lib/index.ts",
@@ -435,6 +469,9 @@
435469
},
436470
{
437471
"abstract": true,
472+
"docs": {
473+
"stability": "deprecated"
474+
},
438475
"immutable": true,
439476
"locationInModule": {
440477
"filename": "lib/index.ts",
@@ -453,6 +490,7 @@
453490
"assembly": "@scope/jsii-calc-lib",
454491
"base": "@scope/jsii-calc-base.Base",
455492
"docs": {
493+
"stability": "deprecated",
456494
"summary": "Abstract class which represents a numeric value."
457495
},
458496
"fqn": "@scope/jsii-calc-lib.Value",
@@ -465,6 +503,7 @@
465503
"methods": [
466504
{
467505
"docs": {
506+
"stability": "deprecated",
468507
"summary": "String representation of the value."
469508
},
470509
"locationInModule": {
@@ -484,6 +523,7 @@
484523
{
485524
"abstract": true,
486525
"docs": {
526+
"stability": "deprecated",
487527
"summary": "The value."
488528
},
489529
"immutable": true,
@@ -500,5 +540,5 @@
500540
}
501541
},
502542
"version": "0.11.0",
503-
"fingerprint": "x/BbPdAJTYB6QY83ucqo0CNLa2NoLebqPMbMY7BsyR4="
543+
"fingerprint": "ysbOu5OVvyznNc3J8nCmLW9NRtZwUTw4YgeMb8c+OPA="
504544
}

0 commit comments

Comments
 (0)