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

Use deprecation flag from BCD #2138

Closed
saschanaz opened this issue Dec 14, 2020 · 16 comments
Closed

Use deprecation flag from BCD #2138

saschanaz opened this issue Dec 14, 2020 · 16 comments
Labels
browser-compat issues related to the browser compatibility data tables (BCD) macros tracking issues related to kumascript macros p3 We don't have visibility when this will be addressed.

Comments

@saschanaz
Copy link
Contributor

saschanaz commented Dec 14, 2020

Currently MDN has a separate deprecation tag and the header. Could it use the deprecated flag from BCD and autogenerate such header, so that there won't be two separate source of truth?

(BTW, is the Deprecated tag still a thing in Yari? I don't see it rendered anywhere, except the header.)

@ghost
Copy link

ghost commented Dec 14, 2020

I did not understand if you intend to pass the data in query string from the links of the BCD to the next page or fetching 2 times the data of the BCD, 1 time for the page and 1 time for the table.

But does the BCD have any services? Where does the data come from?

@saschanaz
Copy link
Contributor Author

Where does the data come from?

It's from:

"@mdn/browser-compat-data": "3.0.0",

@ghost
Copy link

ghost commented Dec 20, 2020

Intresting issue for do matching things, keys, address in JSON from location of HTML.

So... Should be intresting a little <table> on top of the page for status key.

https://github.com/mdn/browser-compat-data/blob/4c50bfdf43261a67d00b830fb0cd3a316a286400/api/HTMLMarqueeElement.json#L46

Status

Key 0 Key two words Key 2
false ❌ true 👍 true 👍

See JSON file that contains this object of this table on GitHub

@ghost
Copy link

ghost commented Dec 20, 2020

Ok.
Is possibile and everytimes defined that You can access these 3 booleans knowing only the page URI and the main import of the dependency in the package.json?

@saschanaz
Copy link
Contributor Author

saschanaz commented Dec 20, 2020

Yes, it's fairly straightforward. Say the URI is /API/Foo/Bar, the corresponding BCD item is in api.Foo.Bar.

Edit: Maybe this should be a macro like Compat(). (... or should it?)

@ghost
Copy link

ghost commented Dec 21, 2020

I like to rename things.

However, I think that by referring to the page some function should return the JSON file and then from there export either the initial div with the status or the BCD in order not to replicate the logic of the mapping between repositories.

I also think about additional services on the feature URL that return fractions of JSON.

API/Foo/Bar/status > returns an object
API/Foo/Bar/status/deprecated > returns a true or false JSON content type.

In any case I can't put comments on the Kumascript linked macro but only on the PRs.

Does BCT data be deployed as is so I can use fetch API?

@saschanaz
Copy link
Contributor Author

@ghost
Copy link

ghost commented Dec 21, 2020

Questionable because we see that it was born for compatibility (support) and has more status and there is also something that speaks of HTML h3 of 6 titles 🤔

I imagine something similar but slightly revised to represent the page and therefore also the support table as a child of a big feature object.

Feature.method()

Status

... a table from an object ...

Content

...

Support

... a table from an object ...

@ghost
Copy link

ghost commented Dec 21, 2020

Could this data pass via some meta before going to the article?

https://developer.mozilla.org/en-US/docs/Web/HTML/Element/meta

@saschanaz
Copy link
Contributor Author

I think fetching twice is okay as the response will be cached.

@ghost
Copy link

ghost commented Dec 21, 2020

Draft of a PR

// We are in some lifecyle hook
fetch(Object.assign(new URL("https://developer.mozilla.org/en-US/docs/Web/API/CanvasRenderingContext2D/drawWidgetAsOnScreen/bcd.json"), {
// Something known in the global scope like properties from an URL object constructed from location
})
.then(response=>response.json())
.then(body=>{
 // Todo update the state of the component with the status Key and some if statments here or in the template 
this.status = body.status // Is here or more in depth?
})

This should be done in the Component or at App level and passed down via props.

(I can't PR or assign this issue to me just comment, I'm sorry).

@schalkneethling
Copy link
Contributor

@ddbeck Thoughts? Close?

@ddbeck
Copy link
Contributor

ddbeck commented Nov 5, 2021

@schalkneethling There's a bit to unpack here. This discussion captures some of the issues involved: https://github.com/mdn/content/discussions/5549. That said, the underlying idea—drive this stuff from BCD—is a good idea. But there's two distinct tasks that would come from this:

  • Generate usage ("traffic light") banners based on support and statuses (standard track, experimental, and deprecated). This would be a bit of a content/design/engineering effort.
  • Remove existing macros and tags. A content effort, after the previous step.

Not sure if we should open separate issues, hijack this one, or what. Also related: #1400 (comment)

@schalkneethling
Copy link
Contributor

schalkneethling commented Nov 8, 2021

@ddbeck Almost sounds like creating 2 separate issues with a clear definition of work makes more sense. We can the prioritise them along with all of the other items we have. Not sure who the best person is to create those but, I have a suspicion it might be you 😄

@github-actions github-actions bot added the 🐌 idle Issues and PRs without recent activity. Flagged for maintainer follow-up. label Dec 15, 2021
@schalkneethling schalkneethling added needs triage Triage needed by staff and/or partners. Automatically applied when an issue is opened. and removed needs: triage labels Mar 8, 2022
@github-actions github-actions bot added the idle label Apr 15, 2022
@caugner caugner added macros tracking issues related to kumascript macros browser-compat issues related to the browser compatibility data tables (BCD) p3 We don't have visibility when this will be addressed. and removed 🐌 idle Issues and PRs without recent activity. Flagged for maintainer follow-up. needs triage Triage needed by staff and/or partners. Automatically applied when an issue is opened. labels Nov 14, 2022
@caugner
Copy link
Contributor

caugner commented Nov 15, 2022

Closing in favor of duplicate #3929.

@caugner caugner closed this as not planned Won't fix, can't repro, duplicate, stale Nov 15, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
browser-compat issues related to the browser compatibility data tables (BCD) macros tracking issues related to kumascript macros p3 We don't have visibility when this will be addressed.
Projects
Development

No branches or pull requests

5 participants