Skip to content
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

Publish code to compute Baseline status for BCD #544

Open
foolip opened this issue Jan 26, 2024 · 3 comments
Open

Publish code to compute Baseline status for BCD #544

foolip opened this issue Jan 26, 2024 · 3 comments

Comments

@foolip
Copy link
Collaborator

foolip commented Jan 26, 2024

There's code in https://github.com/ddbeck/strict-browser-compat-data which we should publish as an NPM package for the benefit of @LeoMcA and other consumers.

We'll maintain it in this repo but publish it as a separate NPM package called compute-baseline.

It should export one method with a signature a bit like this:

function computeBaseline({
  bcd, /* required */
  key, /* required for now, could be optional if a compat object is passed */
  browsers, /* default to core browser set */
}) {}
@foolip
Copy link
Collaborator Author

foolip commented Jan 26, 2024

We should return something like:

{
  baseline: "low" | "high" | false,
  baseline_low_date: "string",
  baseline_high_date: "string",
  support: object /* TBD, depends on what the code does */
}

@captainbrosset
Copy link
Contributor

At our Baseline WebDX CG call yesterday, we quickly talked about this, and one point that came up is the fact that consumers will, over time, likely have a wide range of programming language needs. Forcing people to use a JS function might not always work. One way would be to make the algorithm clear, and document it.

Another way could be, and this is me thinking out loud, to just generate all individual feature baseline statuses in our package. After all, this would just be a build step, not something we maintain. Our package would contain the baseline status for all of the logical web feature groups we create and baseline status for all of the indivudal bcd keys.

@foolip
Copy link
Collaborator Author

foolip commented Jan 29, 2024

Simply publishing a bunch of JSON was the first thing that @ddbeck and I considered, and we'll want to do that eventually, but publishing the code has some benefits. In particular, it avoids this package from having to be co-versioned with BCD. If you already depend on BCD (for example in https://github.com/mdn/yari) then you don't need to worry about contradictions between BCD and Baseline data derived from BCD.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants