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

Adding https://w3c.github.io/csswg-drafts/ URLs for all CSS specs? #704

Closed
sideshowbarker opened this issue Sep 9, 2022 · 8 comments
Closed

Comments

@sideshowbarker
Copy link
Contributor

https://w3c.github.io/csswg-drafts/ now exists as an alternative to https://drafts.csswg.org/, and I think it’s very likely that for BCD, we’re going to change all the existing CSS spec spec_url to the https://w3c.github.io/csswg-drafts/ equivalents.

But in order to do that for BCD, and have it work, we’d need the https://w3c.github.io/csswg-drafts/ URLs to be in browser-specs.

So I’m raising this issue to discuss how to represent this case in browser-specs. Maybe can allow the nightlyUrl value to be an array? Or else maybe add a new alternateNightlyUrl (or something)?

@plinss
Copy link
Member

plinss commented Sep 10, 2022

As stated by several, this is not a replacement for...

(additional emphasis mine)

https://w3c.github.io/csswg-drafts/ is a temporary measure (likely already no longer necessary as the server upgrades have begun and the server is already more stable) and will be either entirely dropped or replaced by redirects back to https://drafts.csswg.org as soon as the work on the draft server is complete.

No one will benefit by adding confusion as to what the canonical URLs for the CSS drafts are.

sideshowbarker added a commit to mdn/browser-compat-data that referenced this issue Sep 10, 2022
queengooborg pushed a commit to mdn/browser-compat-data that referenced this issue Sep 10, 2022
… URLs (#17747)

* Replace all drafts.csswg.org spec_url with w3c.github.io/csswg-drafts URLs

Related browser-specs PR: w3c/browser-specs#704

* Try rewriting CSS spec URLs in the linter

* Apply suggestions from code review
@tidoust
Copy link
Member

tidoust commented Sep 12, 2022

I hear disagreement on the direction to take.

I would love to see a more stable solution emerge for CSS drafts (server has been down for me in the past few hours for example) but I agree with @plinss that introducing another URL for the CSS drafts creates confusion, especially if this URL is not meant to last and not the URL that the CSS working group would like to use as a canonical URL.

For instance, the BCD update means that I need to add a bit of logic in one of my side tools that associates BCD entries back with specs in browser-specs based on spec_url. Switching to w3c.github.io URLs in browser-specs would solve the problem for BCD, but not for mapping with Chrome Platform Status, Can I Use, Webkit Status, or the W3C API that still use drafts.csswg.org URLs.

One possibility would be to track the w3c.github.io URL of CSS specs in an alternateUrls property in browser-specs. This would also be useful to track URL changes of other specs (e.g. when a spec transitions from WICG to a WG or when its shortname changes). We've managed to survive without that in browser-specs until now precisely because the platforms mentioned above (mostly) use canonical URLs in browser-specs, but if a new divergence emerges, that's easy to add.

[Edit: I only now realize that the alternateUrls idea is actually one of the options you propose, @sideshowbarker. So yes, I confirm that matches how I would approach this and I would prefer that to turning nightly.url into an array].

tidoust added a commit that referenced this issue Sep 13, 2022
This records the `w3c.github.io` URL for CSS drafts in a new `alternateUrls`
property under `nightly`. See context in #704.

That property is an array as the mechanism could be used to record nightly URLs
used by a spec throughout its development. The code automatically adds the
w3c.github.io URL for CSS drafts.

One possible question: A spec already published in /TR could get a new
shortname. Since the array is under `nightly`, this cannot really be used to
record the previous /TR URL. Should this `alternateUrls` property rather be
moved to the root (but then how to distinguish between alternate URLs for the
nightly and release versions of the spec)? Or would we add an `alternateUrls`
property under `release` as well if we ever want to track that?
@queengooborg
Copy link

queengooborg commented Sep 15, 2022

FYI: I recently merged a PR to BCD that replaced all drafts.csswg.org URLs with the w3c.github.io/csswg-drafts, so MDN Web Docs now links to the new mirror. In doing so, MDN readers, including and especially contributors, will finally be able to view the specs once again, so that our work isn't hindered and we can update MDN content involving those specs!

@andreubotella
Copy link
Member

For the record, since that PR changed MDN to link to the w3c.github.io mirror, currenty all CSS spec references are labeled as "Unknown specification" because the mirror isn't listed in browser-specs, which is not great. I proposed to work around this in yari in mdn/yari#7173.

@tidoust
Copy link
Member

tidoust commented Sep 16, 2022

So that's precisely what I was raising above. Switching the URLs is definitely good for readers, but it impacts tools that expect data to use the canonical URL. I wonder whether the switch could rather be made on MDN when the page is rendered rather than in BCD data?

@queengooborg
Copy link

So that's precisely what I was raising above. Switching the URLs is definitely good for readers, but it impacts tools that expect data to use the canonical URL. I wonder whether the switch could rather be made on MDN when the page is rendered rather than in BCD data?

We just need to remap the URL to the old link when obtaining the spec metadata. By changing the URLs in BCD, we're able to relay the new links to consumers of BCD such as CanIUse and VS Code, so that they will automatically use the new links as well, thus improving the experience for more than just MDN readers!

tidoust added a commit that referenced this issue Sep 21, 2022
This records the `w3c.github.io` URL for CSS drafts in a new `alternateUrls`
property under `nightly`. See context in #704.

That property is an array as the mechanism could be used to record nightly URLs
used by a spec throughout its development. The code automatically adds the
w3c.github.io URL for CSS drafts.
@tidoust
Copy link
Member

tidoust commented Sep 22, 2022

Browser-specs now lists https://w3c.github.io/csswg-drafts/ URLs for CSS specs under the nightly.alternateUrls.

@queengooborg
Copy link

Thank you for adding this in, @tidoust!

While attempting to adapt to the new property, I happened to notice that series.nightlyUrl doesn't have alternative URLs in the data. Is that also planned? (Alternatively, in BCD/MDN we could enforce the usage of the nightly or spec level-specific URL, but I don't think that would provide the best developer or contributor experience.)

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

5 participants