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

[breaking] Add support for ISO standards, add JPEG XL ISO/IEC spec #1192

Merged
merged 2 commits into from
Feb 6, 2024

Conversation

tidoust
Copy link
Member

@tidoust tidoust commented Feb 5, 2024

To add ISO/IEC standards related to JPEG XL (see #1089), there needs to be a way to add an entry in browser-specs that has a canonical URL but no actual nightly URL, because ISO standards are not public (see also #1191).

This update amends the code to allow and create entries without a nightly property when needed (only for ISO standards for now). The code also retrieves the name of the group that develops an ISO standard.

This is a BREAKING CHANGE because the nightly property used to be mandatory. Projects that expect to find a nightly.url property need to be updated to only look at the root url property or to skip the entry altogether.

First ISO spec added to the list is JPEG XL, which will appear as:

{
  "url": "https://www.iso.org/standard/85253.html",
  "seriesComposition": "full",
  "shortname": "iso18181-2",
  "series": {
    "shortname": "iso18181-2",
    "currentSpecification": "iso18181-2",
    "title": "Information technology — JPEG XL image coding system — Part 2: File format",
    "shortTitle": "JPEG XL: File Format"
  },
  "shortTitle": "JPEG XL: File Format",
  "organization": "ISO/IEC",
  "groups": [
    {
      "name": "ISO/IEC JTC 1/SC 29",
      "url": "https://www.iso.org/committee/45316.html"
    }
  ],
  "title": "Information technology — JPEG XL image coding system — Part 2: File format",
  "source": "specref",
  "categories": [
    "browser"
  ],
  "standing": "good"
}

Worth noting: the absence of a nightly property means that there is no place to store the status of the spec, which could in theory be "Under development" or "Published" for ISO specs (there are additional stages in the ISO process but they are probably not worth capturing in any case). An alternative would be to have a nightly.status property, but that seems clumsy.

To add ISO/IEC standards related to JPEG XL (see #1089), there needs to be a
way to add an entry in browser-specs that has a canonical URL but no actual
nightly URL, because ISO standards are not public (see also #1191).

This update amends the code to allow and create entries without a `nightly`
property when needed (only for ISO standards for now). The code also retrieves
the name of the group that develops an ISO standard.

This is a BREAKING CHANGE because the `nightly` property used to be mandatory.
Projects that expect to find a `nightly.url` property need to be updated to
only look at the root `url` property or to skip the entry altogether.

First ISO spec added to the list is JPEG XL, which will appear as:

```json
{
  "url": "https://www.iso.org/standard/85253.html",
  "seriesComposition": "full",
  "shortname": "iso18181-2",
  "series": {
    "shortname": "iso18181-2",
    "currentSpecification": "iso18181-2",
    "title": "Information technology — JPEG XL image coding system — Part 2: File format",
    "shortTitle": "JPEG XL: File Format"
  },
  "shortTitle": "JPEG XL: File Format",
  "organization": "ISO/IEC",
  "groups": [
    {
      "name": "ISO/IEC JTC 1/SC 29",
      "url": "https://www.iso.org/committee/45316.html"
    }
  ],
  "title": "Information technology — JPEG XL image coding system — Part 2: File format",
  "source": "specref",
  "categories": [
    "browser"
  ],
  "standing": "good"
}
```

Worth noting: the absence of a `nightly` property means that there is no place
to store the status of the spec, which could in theory be "Under development"
or "Published" for ISO specs (there are additional stages in the ISO process
but they are probably not worth capturing in any case). An alternative would be
to have a `nightly.status` property, but that seems clumsy.
const info = await fetchInfo([spec]);
assert.ok(info[spec.shortname]);
assert.equal(info[spec.shortname].source, "spec");
assert.equal(info[spec.shortname].title, "Textiles — Identification of some animal fibres by DNA analysis method — Cashmere, wool, yak and their blends");
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

😂

throw new Error(`Could not retrieve ISO page ${spec.url}, status code is ${res.status}`);
}
const html = await res.text();
let startPos = html.indexOf('<h3>General information</h3>');
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

😭

@tidoust tidoust merged commit 003c904 into main Feb 6, 2024
1 check passed
@tidoust tidoust deleted the iso-jpegxl branch February 6, 2024 08:07
jyasskin added a commit to speced/spec-maintenance that referenced this pull request Feb 8, 2024
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

Successfully merging this pull request may close these issues.

None yet

2 participants