-
Notifications
You must be signed in to change notification settings - Fork 46
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
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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.
dontcallmedom
approved these changes
Feb 6, 2024
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"); |
There was a problem hiding this comment.
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>'); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
😭
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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 anightly.url
property need to be updated to only look at the rooturl
property or to skip the entry altogether.First ISO spec added to the list is JPEG XL, which will appear as:
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 anightly.status
property, but that seems clumsy.