@@ -35,7 +35,7 @@ clients commit to doing the associated clean up work once a feature stabilises.
35
35
When starting work on a feature, we should create a matching feature flag:
36
36
37
37
1 . Add a new
38
- [ setting] ( https://github.com/matrix-org/matrix-react-sdk/blob/develop/src/settings/Settings.js )
38
+ [ setting] ( https://github.com/matrix-org/matrix-react-sdk/blob/develop/src/settings/Settings.ts )
39
39
of the form:
40
40
``` js
41
41
" feature_cats" : {
@@ -47,17 +47,9 @@ When starting work on a feature, we should create a matching feature flag:
47
47
```
48
48
2 . Check whether the feature is enabled as appropriate:
49
49
``` js
50
- SettingsStore .isFeatureEnabled (" feature_cats" )
50
+ SettingsStore .getValue (" feature_cats" )
51
51
```
52
- 3 . Add the feature to the set of labs on
53
- [ develop] ( https://github.com/vector-im/riot-web/blob/develop/riot.im/develop/config.json )
54
- and [ nightly] ( https://github.com/vector-im/riot-desktop/blob/develop/riot.im/nightly/config.json ) :
55
- ``` json
56
- "features" : {
57
- "feature_cats" : " labs"
58
- },
59
- ```
60
- 4 . Document the feature in the [ labs documentation] ( https://github.com/vector-im/riot-web/blob/develop/docs/labs.md )
52
+ 3 . Document the feature in the [ labs documentation] ( https://github.com/vector-im/riot-web/blob/develop/docs/labs.md )
61
53
62
54
With these steps completed, the feature is disabled by default, but can be
63
55
enabled on develop and nightly by interested users for testing.
@@ -67,69 +59,49 @@ The following lists a few common options.
67
59
68
60
## Enabling by default on develop and nightly
69
61
70
- Set the feature to ` enable ` in the
62
+ Set the feature to ` true ` in the
71
63
[ develop] ( https://github.com/vector-im/riot-web/blob/develop/riot.im/develop/config.json )
72
64
and
73
65
[ nightly] ( https://github.com/vector-im/riot-desktop/blob/develop/riot.im/nightly/config.json )
74
66
configs:
75
67
76
68
``` json
77
69
"features" : {
78
- "feature_cats" : " enable "
70
+ "feature_cats" : true
79
71
},
80
72
```
81
73
82
74
## Enabling by default on staging, app, and release
83
75
84
- Set the feature to ` enable ` in the
76
+ Set the feature to ` true ` in the
85
77
[ staging / app] ( https://github.com/vector-im/riot-web/blob/develop/riot.im/app/config.json )
86
78
and
87
79
[ release] ( https://github.com/vector-im/riot-desktop/blob/develop/riot.im/release/config.json )
88
80
configs.
89
81
90
- ** Warning:** While this does mean the feature is enabled by default for
91
- https://app.element.io and official Element Desktop builds, it will not be enabled by
92
- default for self-hosted installs, custom desktop builds, etc. To cover those
93
- cases as well, the best options at the moment are converting to a regular
94
- setting defaulted on or to remove the flag. Simply enabling the existing flag by
95
- default in ` Settings.js `
96
- [ does not work currently] ( https://github.com/vector-im/riot-web/issues/10360 ) .
82
+ ** Note:** The above will only enable the feature for https://app.element.io and official Element
83
+ Desktop builds. It will not be enabled for self-hosted installed, custom desktop builds, etc. To
84
+ cover these cases, change the setting's ` default ` in ` Settings.ts ` to ` true ` .
97
85
98
86
## Feature deployed successfully
99
87
100
- Once we're confident that a feature is working well, we should remove the flag:
88
+ Once we're confident that a feature is working well, we should remove or convert the flag.
101
89
102
- 1 . Remove the [ setting] ( https://github.com/matrix-org/matrix-react-sdk/blob/develop/src/settings/Settings.js )
103
- 2 . Remove all ` isFeatureEnabled ` lines that test for the feature's setting
90
+ If the feature is meant to be turned off/on by the user:
91
+ 1 . Remove ` isFeature ` from the [ setting] ( https://github.com/matrix-org/matrix-react-sdk/blob/develop/src/settings/Settings.ts )
92
+ 2 . Change the ` default ` to ` true ` (if desired).
104
93
3 . Remove the feature from the [ labs documentation] ( https://github.com/vector-im/riot-web/blob/develop/docs/labs.md )
105
- 4 . Remove feature state from
106
- [ develop] ( https://github.com/vector-im/riot-web/blob/develop/riot.im/develop/config.json ) ,
107
- [ nightly] ( https://github.com/vector-im/riot-desktop/blob/develop/riot.im/nightly/config.json ) ,
108
- [ staging / app] ( https://github.com/vector-im/riot-web/blob/develop/riot.im/app/config.json ) ,
109
- and
110
- [ release] ( https://github.com/vector-im/riot-desktop/blob/develop/riot.im/release/config.json )
111
- configs
112
- 5 . Celebrate! 🥳
94
+ 4 . Celebrate! 🥳
113
95
114
- ## Convert to a regular setting (optional)
115
-
116
- Sometimes we decide a feature should always be user-controllable as a setting
117
- even after it has been fully deployed. In that case, we would craft a new,
118
- regular setting:
119
-
120
- 1 . Remove the feature flag from
121
- [ settings] ( https://github.com/matrix-org/matrix-react-sdk/blob/develop/src/settings/Settings.js )
122
- and add a regular setting with the appropriate levels for your feature
123
- 2 . Replace the ` isFeatureEnabled ` lines with ` getValue ` or similar calls
124
- according to the [ settings
125
- docs] ( https://github.com/matrix-org/matrix-react-sdk/blob/develop/docs/settings.md )
126
- (checking carefully, as we may want a different mix of code paths when the
127
- feature is always present but gated by a setting)
96
+ If the feature is meant to be forced on (non-configurable):
97
+ 1 . Remove the [ setting] ( https://github.com/matrix-org/matrix-react-sdk/blob/develop/src/settings/Settings.ts )
98
+ 2 . Remove all ` getValue ` lines that test for the feature.
128
99
3 . Remove the feature from the [ labs documentation] ( https://github.com/vector-im/riot-web/blob/develop/docs/labs.md )
129
- 4 . Remove feature state from
100
+ 4 . If applicable, remove the feature state from
130
101
[ develop] ( https://github.com/vector-im/riot-web/blob/develop/riot.im/develop/config.json ) ,
131
102
[ nightly] ( https://github.com/vector-im/riot-desktop/blob/develop/riot.im/nightly/config.json ) ,
132
103
[ staging / app] ( https://github.com/vector-im/riot-web/blob/develop/riot.im/app/config.json ) ,
133
104
and
134
105
[ release] ( https://github.com/vector-im/riot-desktop/blob/develop/riot.im/release/config.json )
135
106
configs
107
+ 5 . Celebrate! 🥳
0 commit comments