Skip to content

Commit

Permalink
feat(baseline): hide banner if discouraged (#64)
Browse files Browse the repository at this point in the history
* feat(baseline): hide banner if discouraged

web-platform-dx/web-features#2388

* cargo fmt
  • Loading branch information
LeoMcA authored Dec 19, 2024
1 parent 1a81e3e commit bdfdb23
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions crates/rari-data/src/baseline.rs
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,9 @@ impl WebFeatures {
.iter()
.any(|key| key == bcd_key)
{
if feature_data.discouraged.is_some() {
return None;
}
if let Some(by_key) = &status.by_compat_key {
if let Some(key_status) = by_key.get(bcd_key) {
if key_status.baseline == status.baseline {
Expand Down Expand Up @@ -107,6 +110,9 @@ pub struct FeatureData {
skip_serializing_if = "Vec::is_empty"
)]
pub snapshot: Vec<String>,
/** Whether developers are formally discouraged from using this feature */
#[serde(skip_serializing_if = "Option::is_none")]
pub discouraged: Option<Value>,
}

#[derive(Deserialize, Serialize, Clone, Copy, Debug, Hash, PartialEq, Eq, PartialOrd, Ord)]
Expand Down

0 comments on commit bdfdb23

Please sign in to comment.