Devographics / surveys

YAML config files for the Devographics surveys
43 stars 8 forks source link

Coordinating web-features + State Of #247

Open SachaG opened 1 month ago

SachaG commented 1 month ago

@foolip @captainbrosset I think it'd be great to start centralizing/cross-referencing some of the work we're all doing. A good initial goal would be to link to individual feature pages (such as https://web-platform-dx.github.io/web-features-explorer/features/array-by-copy/) from the survey results, similarly to what we do for MDN and CanIUse.

And ultimately it would also be nice to rely on a central source of truth instead of also having to compile our own redundant list of features: https://github.com/Devographics/entities/tree/main/entities/features

captainbrosset commented 1 month ago

@SachaG yes! Let's collaborate on creating a virtuous cycle where even more web data is linked/linkable.

A good initial goal would be to link to individual feature pages (such as https://web-platform-dx.github.io/web-features-explorer/features/array-by-copy/) from the survey results, similarly to what we do for MDN and CanIUse.

Sounds great. Though, let's keep in mind that those specific feature pages are very much a work in progress and that we don't really have a goal in mind for them. One thing I want to avoid is for them to duplicate what's already on CanIUse or MDN. I think of these pages as a hub for features, where people can easily jump to other places (like MDN, WPT, relevant surveys, bugs, etc.) In that vein of thoughts, I'd very much want to be able to link in the other direction too. What would be the best way for us to link from a feature page to a survey page?

As a sidenote, the web-features website's most obvious value is, for now, the Release notes, and the baseline low and baseline high pages. These pages provide concrete tools for web developers to keep track of what's available on the platform.

And ultimately it would also be nice to rely on a central source of truth instead of also having to compile our own redundant list of features: https://github.com/Devographics/entities/tree/main/entities/features

Totally. In order to get to this, can you provide more information about the data that you need in your own list of features? Looking quickly, I see these simple fields: id, name, mdn, caniuse. The web-features repo can provide these pretty easily. Using web-features would also allow you to display a short description of features, as well as a baseline badge. Any other data fields that you need? Also, what's the best way to list all individual features that you reference in your surveys? I'd love to create a burn down list for us to work through.

SachaG commented 1 month ago

In that vein of thoughts, I'd very much want to be able to link in the other direction too. What would be the best way for us to link from a feature page to a survey page?

The tricky part here is that features don't really have an individual page in each survey, usually they're part of a chart grouping all the features in a survey, or in a survey section.

Any other data fields that you need?

The main fields that you might not yet support that I can think of right now are:

I think everything else is pretty standard.

Also, what's the best way to list all individual features that you reference in your surveys? I'd love to create a burn down list for us to work through.

I don't have a list for all surveys, but if you want to get the contents of a specific survey you could run this query through our GraphQL API:

{
  surveys {
    state_of_css {
      css2024 {
        features {
          _items {
            id
          }
        }
      }
    }
  }
}

Or, if you want to get more metadata about each item:

{
  surveys {
    state_of_css {
      css2024 {
        features {
          _items {
            _metadata {
              id
              entity {
                name
                description
              }
            }
          }
        }
      }
    }
  }
}

If you use the GraphiQL Explorer (folder with a little "+" icon in the sidebar) you can actually see all the fields currently supported by the entity type, which features belong to (although people, sites, libraries, etc. are also considered "entities" so some of the fields such as npm or twitterName will not be relevant to features).

captainbrosset commented 1 month ago

The tricky part here is that features don't really have an individual page in each survey, usually they're part of a chart grouping all the features in a survey, or in a survey section.

I think that's ok. Being able to link a feature to a survey (or, more likely several surveys) that talks about this feature, even if it's the context of other features, is useful.

Practically speaking, I'd love it if there was a way for me, based on the data on this repo, or other, to lookup a web-features ID and get a link to a specific survey question that mentions this feature. Any idea how this could be accomplished?

captainbrosset commented 1 month ago

Regarding adding more data fields to web-features, I would be hesitant to add things like resources and code examples. There are better repos that do this, MDN is the obvious one. One of the driver for web-features is to be the source of truth for feature IDs, not to centralize all of the data about features. web-features provides a unique ID for a feature, and this ID can then be used to cross-reference surveys, compat data, docs, etc. Does that make sense?

In your case, you could rely on web-features for most of the name/description/compat/baseline info and then extend this info with your own list of code examples and other resources.

captainbrosset commented 1 month ago

Thank you for the GraphQL help. Based on my findings using the API, I've opened an issue over on the web-features repository to track adding all of the State of CSS/HTML features to the repo. See https://github.com/web-platform-dx/web-features/issues/1624

SachaG commented 1 month ago

Practically speaking, I'd love it if there was a way for me, based on the data on this repo, or other, to lookup a web-features ID and get a link to a specific survey question that mentions this feature. Any idea how this could be accomplished?

OK, I've opened an new issue to add this capability to our API: https://github.com/Devographics/Monorepo/issues/415

I would be hesitant to add things like resources and code examples. There are better repos that do this, MDN is the obvious one.

I do rely on MDN as the source for some of the code examples, but the context is a bit different (our code examples need to be very short because they're either displayed as part of the survey without any additional explanation, or inside a small popover or tooltip) so I sometimes need to tweak them.

There's also the issue of localizing the code examples (variable names, comments, etc.) but I've decided to put this off for now.

In your case, you could rely on web-features for most of the name/description/compat/baseline info and then extend this info with your own list of code examples and other resources.

Sounds good, let's do that then.

SachaG commented 1 month ago

OK, I've opened an new issue to add this capability to our API: https://github.com/Devographics/Monorepo/issues/415

Done :)