-
Notifications
You must be signed in to change notification settings - Fork 4.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
DataViews: Type all the filters components #61795
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -20,17 +20,6 @@ export function sanitizeOperators< Item extends AnyItem >( | |
operators = [ OPERATOR_IS_ANY, OPERATOR_IS_NONE ]; | ||
} | ||
|
||
// Transform legacy in, notIn operators to is, isNot. | ||
// To be removed in the future. | ||
if ( operators.includes( 'in' ) ) { | ||
operators = operators.filter( ( operator ) => operator !== 'is' ); | ||
operators.push( 'is' ); | ||
} | ||
if ( operators.includes( 'notIn' ) ) { | ||
operators = operators.filter( ( operator ) => operator !== 'notIn' ); | ||
operators.push( 'isNot' ); | ||
} | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I had confirmed previously with @oandregal that these are not used anymore. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I've prepared a PR that adds a changelog note about this, to let consumers of the package know about the breaking changes: #62013 |
||
|
||
// Make sure only valid operators are used. | ||
operators = operators.filter( ( operator ) => | ||
ALL_OPERATORS.includes( operator ) | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I wrote a big comment about how we can rely more on the type system and make a lot of these constants irrelevant without sacrificing clarity or readability (in my opinion).
Instead of writing the comment, I pushed a change that implements that idea. Please feel free to keep it or revert it, but it's a powerful concept and a compelling way to rely on the information the type system provides.