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

Simplify the warnings (PROD_WARNING->WARNING, DEV_WARNING->ERROR). #1051

Merged
merged 1 commit into from
Dec 3, 2015
Merged

Simplify the warnings (PROD_WARNING->WARNING, DEV_WARNING->ERROR). #1051

merged 1 commit into from
Dec 3, 2015

Conversation

powdercloud
Copy link
Contributor

Instead of distinguishing PROD_WARNING, DEV_WARNING and interpreting
those as WARNING or ERROR depending on the mode in which the
validator runs (this Javascript implementation was always in dev mode),
just make it ERROR or WARNING in the first place. This puts to rest
the complicated scheme which I introduced a while ago,
#174 (comment),
which for the most part treated the development tag on the top-level
html attribute. But since #development=1 has been introduced, suppressing
this error is less important.

Practical changes:
The development attribute: Now always ERROR, even here in Javascript.
So, putting this attribute will make validation fail, but the error
is descriptive and also, the #development=1 alternative is
available.
A11Y errors: These are errors, but they're only implemented in Javascript
thus far and were already errors.
Deprecation: These are warnings, both in Javascript and C++. What changes
is the Javascript, these used to be marked as errors in DEV mode; now
they're warnings, just like in production. I think this is more
straight-forward.

Instead of distinguishing PROD_WARNING, DEV_WARNING and interpreting
those as WARNING or ERROR depending on the mode in which the
validator runs (this Javascript implementation was always in dev mode),
just make it ERROR or WARNING in the first place. This puts to rest
the complicated scheme which I introduced a while ago,
#174 (comment),
which for the most part treated the development tag on the top-level
html attribute. But since #development=1 has been introduced, suppressing
this error is less important.

Practical changes:
The development attribute: Now always ERROR, even here in Javascript.
So, putting this attribute will make validation fail, but the error
is descriptive and also, the #development=1 alternative is
available.
A11Y errors: These are errors, but they're only implemented in Javascript
thus far and were already errors.
Deprecation: These are warnings, both in Javascript and C++. What changes
is the Javascript, these used to be marked as errors in DEV mode; now
they're warnings, just like in production. I think this is more
straight-forward.
@dvoytenko
Copy link
Contributor

LGTM

@dvoytenko dvoytenko self-assigned this Dec 3, 2015
dvoytenko added a commit that referenced this pull request Dec 3, 2015
Simplify the warnings (PROD_WARNING->WARNING, DEV_WARNING->ERROR).
@dvoytenko dvoytenko merged commit 4980e19 into ampproject:master Dec 3, 2015
@powdercloud powdercloud deleted the simplify-warnings branch April 8, 2016 22:13
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.

2 participants