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
Fix Ampcontext variables in singlepass #19987
Conversation
this could be caught by a skipped test #16825 |
pls hold this PR for the test unmute: #16828 |
FYI, the blocking PR is merged. |
Passing the JsonObject fix the issue. PTAL. @erwinmombay please let me know if it is safe to remove the externs we have. Thanks. |
build-system/amp.extern.js
Outdated
@@ -144,6 +144,9 @@ process.env.SERVE_MODE; | |||
window.IS_AMP_ALT; | |||
|
|||
// Exposed to ads. | |||
// TODO: @erwinmombay I do believe this is safe to remove because | |||
// All are passed to ampcontext in JsonObject. While isMaster and master is | |||
// calculated in ampcontext-integration within the iframe. |
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.
you'd have to change all the reads to use bracket notation if you want to remove this
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.
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.
Asked @erwinmombay offline. We want to leave the extern for future optimization that is not related to singlepass. I removed my comment. We will need to add missing variables to the externs, or use bracket notation.
* add to extern * fix * remove comment
Since ad script within iframe can access the variables, I believe we should add the vars to externs.
Let me know if this is the correct fix.
One thing that confuses me is that does it mean we should add every var and method from ampcontext.js to the extern list.
to @erwinmombay @lannka
Closes #20002