-
Notifications
You must be signed in to change notification settings - Fork 197
Rename open-closed to open-pseudo
#3435
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
Conversation
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 guess we should have a pretty good idea about the -pseudo versus -pseudo-class suggestion discussed in #3436 (comment) before proceeding. Otherwise, I like this.
| compat_features: | ||
| - css.selectors.open | ||
| kind: moved | ||
| redirect_target: open-pseudo |
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.
@ddbeck just a thought (not blocking here): what happens if we later decide to change the ID again? Perhaps to open-pseudo-class? Would we just change this value to avoid multiple chained redirects? And if so, do we have an automated check for this kind of things (to avoid chained redirects)?
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.
@ddbeck just a thought (not blocking here): what happens if we later decide to change the ID again? Perhaps to open-pseudo-class? Would we just change this value to avoid multiple chained redirects?
Yes, that's correct. In the documentation, we promise to consumers that redirects aren't chained and do not create cycles.
And if so, do we have an automated check for this kind of things (to avoid chained redirects)?
Yes, we guard against this here:
Lines 4 to 13 in b9d34ba
| /** | |
| * Assert that a reference from one feature to another is an ordinary feature | |
| * reference (i.e., it's defined and not some kind of redirect). | |
| * | |
| * @export | |
| * @param {string} sourceId The feature that is referencing another feature | |
| * @param {string} targetId The feature being referenced | |
| * @param {WebFeaturesData["features"]} features Feature data | |
| */ | |
| export function assertValidFeatureReference( |
Lines 220 to 232 in b9d34ba
| case "feature": | |
| for (const alternative of feature.discouraged?.alternatives ?? []) { | |
| assertValidFeatureReference(id, alternative, features) | |
| } | |
| break; | |
| case "moved": | |
| assertValidFeatureReference(id, feature.redirect_target, features); | |
| break; | |
| case "split": | |
| for (const target of feature.redirect_targets) { | |
| assertValidFeatureReference(id, target, features); | |
| } | |
| break; |
|
This looks mergeable. @foolip are there any changes you'd like to make before we merge? |
open-closed to open-pseudo
Fixes #3239.