Skip to content

Commit f17ef77

Browse files
committed
Promote websocket rules out of 'experimental'
1 parent 2b02594 commit f17ef77

File tree

2 files changed

+12
-6
lines changed

2 files changed

+12
-6
lines changed

src/components/modify/matcher-selection.tsx

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,8 @@ import {
1616
InitialMatcher,
1717
InitialMatcherClass,
1818
getInitialMatchers,
19-
getRuleTypeFromInitialMatcher
19+
getRuleTypeFromInitialMatcher,
20+
StableRuleTypes
2021
} from '../../model/rules/rules';
2122
import {
2223
summarizeMatcherClass
@@ -74,8 +75,8 @@ export const InitialMatcherRow = React.forwardRef((p: {
7475
}, ref: React.Ref<HTMLSelectElement>) => {
7576
const availableInitialMatchers = getInitialMatchers();
7677

77-
const [httpMatchers, otherMatchers] = _.partition(availableInitialMatchers, m =>
78-
getRuleTypeFromInitialMatcher(getMatcherKey(m)!) === 'http'
78+
const [stableMatchers, experimentalMatchers] = _.partition(availableInitialMatchers, m =>
79+
StableRuleTypes.includes(getRuleTypeFromInitialMatcher(getMatcherKey(m)!))
7980
);
8081

8182
return <MatcherRow>
@@ -98,11 +99,11 @@ export const InitialMatcherRow = React.forwardRef((p: {
9899
</option>
99100
}
100101

101-
<MatcherOptions matchers={httpMatchers} />
102+
<MatcherOptions matchers={stableMatchers} />
102103

103-
{ otherMatchers.length > 0 &&
104+
{ experimentalMatchers.length > 0 &&
104105
<optgroup label='Experimental'>
105-
<MatcherOptions matchers={otherMatchers} />
106+
<MatcherOptions matchers={experimentalMatchers} />
106107
</optgroup>
107108
}
108109
</Select>

src/model/rules/rules.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -209,6 +209,11 @@ const InitialMatcherClasses = [
209209
...RTCInitialMatcherClasses
210210
];
211211

212+
export const StableRuleTypes = [
213+
'http',
214+
'websocket'
215+
];
216+
212217
export const getInitialMatchers = () => InitialMatcherClasses.filter((matcherCls) => {
213218
const matcherKey = MatcherClassKeyLookup.get(matcherCls)!;
214219
return serverSupports(PartVersionRequirements[matcherKey]);

0 commit comments

Comments
 (0)