-
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
Elaborate error message for amp-script with attribute data-ampdevmode #29457
Comments
/cc @samouri |
This seems like a bug with the extension itself. I'll track this down (or at least get in contact with the right people to track it down) |
@morsssss Are you sure it's not throwing one in console? If so, could you message me the URL? I'm getting this error on http://validator.amp.dev/ as well, so it's not just an extension issue. The source says it should always cause an error for |
Hey @honeybadgerdontcare ! Well, I get the proper warning in the Console. Here's a screenshot: If you like I can stick a sample up on codepen or the like. But I get it whenever I use I agree that it this should always cause a validation error or warning... the one shown in the Console is perfect for me. |
Hello @morsssss ! That message you're seeing in the console is not a validator error or warning. It is given by the AMP extension script, see
The validator only displays warnings and errors to the console when |
Yes... oh, I see. I don't think I understood what you were asking. Yes, of course, if I add (Is that what you were asking?) You can ignore my comment earlier about not seeing an error in the Console... throughout my testing of |
Yes, that is what I was asking. So this is working as intended. The console shows validator errors in console with |
The point of this issue is to change that error message. It's not correct. Using If the validation error message were changed to something that resembles the warning thrown by the script, we'd be all set. |
Updating subject to be more clear. Request is to change error message for specific case of It should also probably be clear that the page is still invalid AMP with that attribute. |
Perfect - thanks! |
@honeybadgerdontcare: just to confirm, is this an issue that wg-caching will take care of or should I try to prioritize it for wg-runtime? |
@samouri wg-caching is willing to review PRs from anyone =D, however note that this would be a string used internally at Google and needs to be internationalized. so a PR isn't sufficient for it as there would also need to be additional internal changes for it. for wg-caching, this is a p3 |
For Is there a path to raising the priority? |
I really do not see this as being a higher priority than a p3. It's adding nuance to an existing error message. Developers adding this attribute know that it shouldn't be on the final document as it's a developer tool. |
+ @kristoferbaxter , + @choumx to get another opinion |
or + @patrickkettner ? |
Validator errors typically don't have extension-specific language. What if we added nuance to the console warning? "JavaScript size and script hash requirements are disabled in development mode (development mode is invalid AMP)." |
I think we've backed ourselves into a bad state here, one that is confusing beyond just the error message. After reviewing this a little bit, I'm not super happy that we have two very divergent meanings for The first meaning is a validation suppression one. Specifically the semantics are: By default, just like any other The second meaning was recently added and apparently is specific to runtime. Specifically the semantics are: If and only if the attached element is The issues include:
I think
|
My concern is, if I'm new to
I will assume that I've used this attribute in a way that's illegal. In other words, I'll think I should be setting I see in the code that this string isn't specific to a certain extension, as you point out, @choumx ! But if we can indeed append an extension-specific string, I'd suggest the final message read something like this:
This isn't perfect but I think it's an improvement. |
And, @Gregable , looks like we were commenting at the same time! I was involved in the discussion in #27076, but I agree that the current state has become confusing. I'm fundamentally happy with any solution that results in the action in your option #3 above:
|
Hehe, option (3) was actually the original state -- I suppose the original source of troubles was the ambiguous reuse of "dev/development". We could just:
A long detour for renaming an attribute but lessons were learned. :) |
@choumx Does that mean you prefer option (3)? We can do a little more here and provide a very specific message for this invalid attribute, if useful. |
Yea, it seems like the best option. |
thanks, everyone! |
The naming isn't that clear. The current dev mode doesn't just skip-hash, but also skips size checks. will try to brainstorm another attribute name |
This issue has been automatically marked as stale because it has not had recent activity. It will be closed in 7 days if no further activity occurs. Thank you for your contributions. |
In #27076, we made it legal to use
data-ampdevmode
on an<amp-script>
component even if the attribute was not included on the root html node. An example:This approach works! However, it throws a validation error in the Chrome extension, even though it doesn't throw one in the Console:
The attribute 'data-ampdevmode' in tag 'amp-script' is set to the invalid value ''.
The text was updated successfully, but these errors were encountered: