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鈥檒l occasionally send you account related emails.
Already on GitHub? Sign in to your account
馃悰 Block initial amp-story render on amp-story layout #21382
Conversation
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.
Implementation LGTM
@@ -2360,6 +2360,32 @@ export class AmpStory extends AMP.BaseElement { | |||
} | |||
} | |||
|
|||
/** @implements {../../../src/render-delaying-services.RenderDelayingService} */ | |||
class AmpStoryRender { |
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.
Should we have a separate amp-story-render.js
file?
return Promise.resolve(); | ||
} | ||
|
||
return this.storyEl_.signals().whenSignal(CommonSignals.LOAD_END); |
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 need to wait for storyEL_
to upgrade to an AMP element before calling signals()
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 hasn't been addressed.
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.
Should be addressed 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.
LGTM 馃槃 Merge once @jridgewell 's comments are addressed.
Also, thanks for taking this on! 馃挴
PTAL @jridgewell for changes to |
Could you please host a demo for this? I'd like to test it over different internet connections. If I understand correctly, it will show nothing (completely blank document), until the first page and its media are fully loaded? Some people actually like the fact that we try to show the text content + CSS before the media is loaded, cf: https://twitter.com/TappableHQ/status/1107950229335277568, they even made a video. |
Sure, I've hosted this here. I don't think we actually block on the media of the first page. We create a separate promise for what we return in amphtml/extensions/amp-story/1.0/amp-story.js Lines 851 to 856 in 1f73910
|
Co-Authored-By: newmuis <newmuis@users.noreply.github.com>
So there's good news and bad news. 馃憤 The good news is that everyone that needs to sign a CLA (the pull request submitter and all commit authors) have done so. Everything is all good there. 馃槙 The bad news is that it appears that one or more commits were authored or co-authored by someone other than the pull request submitter. We need to confirm that all authors are ok with their commits being contributed to this project. Please have them confirm that here in the pull request. Note to project maintainer: This is a terminal state, meaning the 鈩癸笍 Googlers: Go here for more info. |
A Googler has manually verified that the CLAs look good. (Googler, please make sure the reason for overriding the CLA status is clearly documented in these comments.) 鈩癸笍 Googlers: Go here for more info. |
So there's good news and bad news. 馃憤 The good news is that everyone that needs to sign a CLA (the pull request submitter and all commit authors) have done so. Everything is all good there. 馃槙 The bad news is that it appears that one or more commits were authored or co-authored by someone other than the pull request submitter. We need to confirm that all authors are ok with their commits being contributed to this project. Please have them confirm that here in the pull request. Note to project maintainer: This is a terminal state, meaning the 鈩癸笍 Googlers: Go here for more info. |
return whenUpgradedToCustomElement(storyEl).signals() | ||
return whenUpgradedToCustomElement(storyEl).then(() => { | ||
return storyEl.signals().whenSignal(CommonSignals.LOAD_END); | ||
}) | ||
.whenSignal(CommonSignals.LOAD_END); |
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.
Auto suggest bug. 馃槵
@@ -39,6 +39,7 @@ import {getServicePromise} from './service'; | |||
const SERVICES = { | |||
'amp-dynamic-css-classes': '[custom-element=amp-dynamic-css-classes]', | |||
'variant': 'amp-experiment', | |||
'amp-story-render': 'amp-story[standalone]', |
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.
The validator team will need to update our list of render-blocking extensions so that this one is injected with a link-preload when necessary.
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.
/cc @Gregable is that something you can do? I'm not sure if it's already there; amp-story previously had a definition that was just broken.
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.
Internally we have b/77581738 filed which is about being able to remove the boilerplate for amp-story
and not including a preload link. @newmuis Would the preload link be for all of amp-story (I don't see an amp-story-render-0.1.js being served from the cdn)?
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.
Right now, yes: all of amp-story. We could take it as a separate project to divide amp-story into what's render-blocking vs. what's not, but we're a while away from that.
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.
Filed b/129863998
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.
Annnnd, this is already being done. Apologies for the noise. If you're not seeing a preload please let me know.
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.
Thanks @honeybadgerdontcare!
A Googler has manually verified that the CLAs look good. (Googler, please make sure the reason for overriding the CLA status is clearly documented in these comments.) 鈩癸笍 Googlers: Go here for more info. |
Followup to #21193. This fixes the previously-broken definition for amp-story, so that it may block on it's
layoutCallback
before rendering.Fixes #21349