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

Implement requires_extension. #9742

Merged
merged 1 commit into from Jun 6, 2017
Merged

Implement requires_extension. #9742

merged 1 commit into from Jun 6, 2017

Conversation

Gregable
Copy link
Member

@Gregable Gregable commented Jun 6, 2017

Implement requires_extension to replace more generic satisfies/requires for the common case of an amp tag requiring an amp extension script tag.

Prior to this, extension and tag specs would have pairs of satisfies/requires fields referring to each other. Now, we replace this with a requires_extension: field on the non-extension tagspec. The validator becomes aware of how these requirements work, and enforces both the need to include an extension script and the need to not have unused extensions. This also reduces more of the boilerplate in the protoascii, including having all of the spec urls automatically computed.

The error messages improve as well. The error strings are more specific (they talk about extensions). The errors are not all at the end of the file (since once we've hit the body, we know that no more extensions will be found). We remove document URLs for unused extension warnings, since the reference material isn't related to this error.

Implement requires_extension to replace more generic satisfies/requires
for
the common case of an amp tag requiring an amp extension script tag.

Prior to this, extension and tag specs would have pairs of
satisfies/requires
fields referring to each other. Now, we replace this with a
requires_extension:
field on the non-extension tagspec. The validator becomes aware of how
these
requirements work, and enforces both the need to include an extension
script
and the need to not have unused extensions. This also reduces more of
the
boilerplate in the protoascii, including having all of the spec urls
automatically computed.

The error messages improve as well. The error strings are more specific
(they
talk about extensions). The errors are not all at the end of the file
(since
once we've hit the body, we know that no more extensions will be found).
We
remove document URLs for unused extension warnings, since the reference
material isn't related to this error.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants