-
Notifications
You must be signed in to change notification settings - Fork 3.9k
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
validator.js stopped working #36067
Comments
This is a planned deprecation of the native JavaScript validator (validator.js). It has been replaced with a WebAssembly JavaScript validator(validator_wasm.js). This has already been updated in tooling such as the validator NPM package, #development=1, validator Web UI, and others listed here. It was rolled back yesterday to give some developers an opportunity to update their tooling. We plan to roll it forward within one to two weeks. Please update tooling to use validator_wasm.js instead. The deprecated validator.js does return messaging within the exported methods that tooling needs to be updated. To your specific questions:
Yes, and yes.
We'd recommend using and updating the NPM package to stay current rather than using validator.js directly. There was an I2D for previous NPM packages that were using validator.js and those were deprecated. 1.0.35 currently uses validator_wasm.js.
This is required if the tooling requires using the JavaScript file directly from the Google AMP Cache.
The numeric codes come from the proto file for the validator. From that link the mapping can be seen from string to numeric. There isn't a plan to use the strings within validator_wasm.js but you're welcome to file an issue requesting it. |
@MadisonMiner Also, I wanted to apologize that this caused a disruption to your tooling and workflow. Those working on AMP validation can be reached on |
@honeybadgerdontcare, thanks for the response, and the link to validator.proto, that will make migration easier. |
We will be publishing a new validator_wasm.js this week that will return the named error codes instead of the numeric. I'll provide an update once this is launched. |
Awesome! That will save us a lot of time. Thank you. |
@MadisonMiner validator_wasm.js is now returning the string representation for error code. |
Please see #36110 for Intent-to-Deprecate and add any questions or concerns there. |
@honeybadgerdontcare , thanks again! The string error codes helped. We are migrated to validator_wasm.js |
Description
We use the evergreen validator.js to validate AMPs before publishing, and to automatically correct errors in AMP pages.
Yesterday (9/13/21), from roughly 4:30pm to 7:15pm PT, the https://cdn.ampproject.org/v0/validator.js script file was replaced with a temporary version that did not perform validation. During this time our system was unable to update AMP pages.
Few questions:
error.code == "DISALLOWED_ATTR
, however validator_wasm.js. returns numeric codes, ie:error.code == 3
. Is it possible to update validator_wasm.js to use the string codes, to retain backwards compatibility? If not, is there a map or dictionary for the new numeric codes?Thank you,
Reproduction Steps
No longer reproducible.
Relevant Logs
No response
Browser(s) Affected
Chrome, Firefox, Safari, Edge, UC Browser
OS(s) Affected
All
Device(s) Affected
All
AMP Version Affected
No response
The text was updated successfully, but these errors were encountered: