You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: keps/sig-architecture/4330-compatibility-versions/README.md
+70-1Lines changed: 70 additions & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -324,8 +324,9 @@ compatibility version support.
324
324
#### Feature gating changes
325
325
326
326
In order to preserve the behavior of in-development features across multiple releases,
327
-
feature implementations may also be gated by version number.
327
+
feature implementation history should also be preserved in the code base.
328
328
329
+
Naively, the feature implementations can be gated by version number.
329
330
For example, if `FeatureA` is partially implemented in 1.28 and additional functionality
330
331
is added in 1.29, the feature developer is expected to gate the functionality by version.
331
332
E.g.:
@@ -335,6 +336,74 @@ if feature_gate.Enabled(FeatureA) && feature_gate.CompatibilityVersion() <= "1.2
335
336
if feature_gate.Enabled(FeatureA) && feature_gate.CompatibilityVersion() >= "1.29" {implementation 2}
336
337
```
337
338
339
+
A better way might be to define a `featureOptions` struct constructed based on the the feature gate, and have the `featureOptions` control the main code flow, so that the main code is version agnostic.
0 commit comments