Skip to content

Commit d4ff7ff

Browse files
committed
Remove deprecated code
1 parent 296c8e1 commit d4ff7ff

File tree

5 files changed

+35
-717
lines changed

5 files changed

+35
-717
lines changed

compiler/src/model/metamodel.ts

Lines changed: 1 addition & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -126,11 +126,9 @@ export class Property {
126126
description?: string
127127
docUrl?: string
128128
docId?: string
129-
since?: string
130129
serverDefault?: boolean | string | number | string[] | number[]
131130
deprecation?: Deprecation
132131
availability?: Availabilities
133-
stability?: Stability
134132
/**
135133
* If specified takes precedence over `name` when generating code. `name` is always the value
136134
* to be sent over the wire
@@ -237,7 +235,7 @@ export class Interface extends BaseType {
237235
*/
238236
generics?: TypeName[]
239237
inherits?: Inherits
240-
implements?: Inherits[]
238+
implements?: Inherits[] // Unused!
241239

242240
/**
243241
* Behaviors directly implemented by this interface
@@ -344,7 +342,6 @@ export class EnumMember {
344342
codegenName?: string
345343
description?: string
346344
deprecation?: Deprecation
347-
since?: string
348345
availability?: Availabilities
349346
}
350347

@@ -429,14 +426,6 @@ export class Endpoint {
429426

430427
urls: UrlTemplate[]
431428

432-
/**
433-
* The version when this endpoint reached its current stability level.
434-
* Missing data means "forever", i.e. before any of the target client versions produced from this spec.
435-
*/
436-
since?: string
437-
stability?: Stability
438-
visibility?: Visibility
439-
featureFlag?: string
440429
requestMediaType?: string[]
441430
responseMediaType?: string[]
442431
privileges?: {

compiler/src/model/utils.ts

Lines changed: 0 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -695,22 +695,6 @@ export function hoistRequestAnnotations (
695695
// Apply the availabilities to the Endpoint.
696696
for (const [availabilityName, availabilityValue] of Object.entries(availabilities)) {
697697
endpoint.availability[availabilityName] = availabilityValue
698-
699-
// Backfilling deprecated fields on an endpoint.
700-
if (availabilityName === 'stack') {
701-
if (availabilityValue.since !== undefined) {
702-
endpoint.since = availabilityValue.since
703-
}
704-
if (availabilityValue.stability !== undefined) {
705-
endpoint.stability = availabilityValue.stability
706-
}
707-
if (availabilityValue.visibility !== undefined) {
708-
endpoint.visibility = availabilityValue.visibility
709-
}
710-
if (availabilityValue.featureFlag !== undefined) {
711-
endpoint.featureFlag = availabilityValue.featureFlag
712-
}
713-
}
714698
}
715699
} else {
716700
assert(jsDocs, false, `Unhandled tag: '${tag}' with value: '${value}' on request ${request.name.name}`)
@@ -813,16 +797,6 @@ function hoistPropertyAnnotations (property: model.Property, jsDocs: JSDoc[]): v
813797
property.availability = {}
814798
for (const [availabilityName, availabilityValue] of Object.entries(availabilities)) {
815799
property.availability[availabilityName] = availabilityValue
816-
817-
// Backfilling deprecated fields on a property.
818-
if (availabilityName === 'stack') {
819-
if (availabilityValue.since !== undefined) {
820-
property.since = availabilityValue.since
821-
}
822-
if (availabilityValue.stability !== undefined) {
823-
property.stability = availabilityValue.stability
824-
}
825-
}
826800
}
827801
} else if (tag === 'doc_id') {
828802
assert(jsDocs, value.trim() !== '', `Property ${property.name}'s @doc_id is cannot be empty`)
@@ -924,13 +898,6 @@ function hoistEnumMemberAnnotations (member: model.EnumMember, jsDocs: JSDoc[]):
924898
member.availability = {}
925899
for (const [availabilityName, availabilityValue] of Object.entries(availabilities)) {
926900
member.availability[availabilityName] = availabilityValue
927-
928-
// Backfilling deprecated fields on a property.
929-
if (availabilityName === 'stack') {
930-
if (availabilityValue.since !== undefined) {
931-
member.since = availabilityValue.since
932-
}
933-
}
934901
}
935902
} else {
936903
assert(jsDocs, false, `Unhandled tag: '${tag}' with value: '${value}' on enum member ${member.name}`)

compiler/test/request-availability/test.ts

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -35,9 +35,4 @@ test('Request @availability can fulfill all the fields', t => {
3535
stack: { stability: 'beta', visibility: 'feature_flag', featureFlag: 'abc', since: '1.2.3' },
3636
serverless: { visibility: 'private', stability: 'experimental' }
3737
});
38-
// Assert backfilled values are correct
39-
t.true(endpoint?.visibility === 'feature_flag');
40-
t.true(endpoint?.stability === 'beta');
41-
t.true(endpoint?.featureFlag === 'abc');
42-
t.true(endpoint?.since === '1.2.3');
4338
})

0 commit comments

Comments
 (0)