The new warning takes this pattern
The tag 'TAG_HERE' is missing or incorrect, but required by the 'TAG_HERE extension .js script'. This will soon be an error. (see https://www.ampproject.org/docs/reference/extended/TAG_HERE.html)
Firstly, none of my tags or incorrect. I know this because the tag type it warns me about is no where on the page. That means it must be missing. I think this should be a separate warning as they are very different issues.
Secondly, this is a pretty serious change and the documentation provided neither has a date for this upgrade to error nor details explaining what exactly the change is. It just has the standard custom element documentation (for example)
From what I've ascertained, the issue is that I've included a custom element script and then never created an instance of that custom element tag.
This is inconvenient, as it means developers must know every piece of content on the page before render time and then choose to only dynamically import the custom element scripts that will occur on the page.
I understand and accept that developer convenience is not a driving principle of AMP, but we must at least be given an explanation of the change and a date of deprecation/error-upgrade before such an intense warning is given so that we may have ample time to update our applications.
This update would cause every single AMP page our site currently serves to start error'ing (10s of thousands), not just a select few like usual with upgrades. We currently have nearly every AMP page showing this warning.
When is this going into effect?
Is my understanding of the warning correct?
http://www.refinery29.com/amp/japanese-decora#development=1
You can view the console and see these warnings about the element being missing after the script being imported. This never used to be the case.
More abstractly
<amp-anim> on page)<amp-anim>All
Current, which is 1483661191373
Agreed. I'll soon be changing the error message to (using youtube as an example):
The extension 'amp-youtube extension .js script' was found on this page, but is unused (no 'amp-youtube' tag seen). This may become an error in the future.
@Gregable That's definitely a big improvement. That way devs know exactly what the issue is without further investigations on their end.
Are there notes anywhere on when the future will be for warnings like this? Is this outlined in a schedule somewhere so that I can make sure we allot development time to silence those warnings before they become errors?
There is currently no schedule for this. If we converted this to an error, it would be with significant announcement lead time.
The reason we want to do this is that unused javascript like this has a negative performance impact for your page. As a result, you may choose to do this earlier simply for the performance improvements that you'd get.
@Gregable Update definitely makes sense. Unused JS scripts are always bad news.
Extremely relieved to hear that there will be ample lead up time to the update with an announcement. Thank you so much! I'm at ease knowing that and the fact that the warning will become less cryptic soon :)
Thank you for your quick help!
@Gregable Thanks for the information. Our system is having the same problem: Every AMP on our site is valid except for this new warning, so it's nice to know there will be plenty of time to fix this if it really does become an error.
I started a topic about this in Google Groups, and Guilherme mentioned the cache could simply remove unneeded extension scripts and serve the page without them.
Any idea about whether you're gonna do that instead? I'm just a little concerned about whether this warning really will become an error - we could update our system to dynamically check the extension scripts and only include the needed ones, but in our case that would probably be worse for performance, not better, due to the architecture of our system (we use Java Server Pages, and currently the head of an AMP is always rendered before the body).
Fixed in https://github.com/ampproject/amphtml/pull/7023/commits/795ccdab2fdcab1e250c12a80fd04f7e6dc77409
Hopefully will be able to get this released quickly, but not yet.
This is now live. If you're still seeing the old error message then it's because the validator code is currently cached in your browser.
Most helpful comment
Agreed. I'll soon be changing the error message to (using youtube as an example):
The extension 'amp-youtube extension .js script' was found on this page, but is unused (no 'amp-youtube' tag seen). This may become an error in the future.