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
Viewer must be trusted for ssr templates to be supported #25520
Conversation
8a0dcce
to
6239149
Compare
I just found an issue with this I need to resolve before this can go through. I don't think Edit: this was also discussed here #15609. Solution seems to be to use |
In this presubmit logs:
Should I still file a separate issue? |
Nah, you can add it directly to the source whitelist in presubmit-checks.js. |
I was able to pretty easily confirm that this doesn't break gmail by using charles proxy. I'm afraid this isn't as simple for email clients like |
bc66981
to
d8cdcf7
Compare
extensions/amp-form/0.1/amp-form.js
Outdated
msg | ||
); | ||
this.ssrTemplateHelper_.isSupported().then(supported => { | ||
userAssert( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This has changed from a sync assert (a throw) to a possibly rejected promise. You need to wait on the value.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah, I just spotted this as well. When I wrote this, I didn't know that userAssert
throws. Working on it now 👍
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
meh, my solution stinks. I'll take another look tomorrow to see if I can make it cleaner.
The fix for |
Closing this in favor of #25638 |
summary
Viewer needs to be trusted for us to allow rendering templates server-side. This means that there are now three requirements to opt-in to ssr templating: doc-level opt-in, has capability, and being a trusted viewer.
testing done
isSupported
Note: I recommend viewing this PR without whitespace.
Fixes b/142607068.