-
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
I2I: Introduce PREVIEW
visibility state
#37129
Comments
Thank you for this initial design! To comment on your numeric list:
This sounds good to me. I can think of a few instances that will allow PREVIEW but not PRERENDER (e.g. non first story pages), so that'll work.
To call it out specifically, current This list looks correct! But they should all NOT allow
The correct order, with the ways viewers are implemented today, would be cc @ampproject/wg-stories |
@rcebulko is there a way for us to track the work for each of the milestones, given that this effort spans across multiple working groups? This list of features SGTM, but I don't have great visibility into how or when this work is planned |
With the general approach validated, I'll work on putting together a clearer project plan in the new year. |
@newmuis Updated description with milestone checkboxes for now, though it doesn't currently include anything about consumers of the feature (since that doesn't really live in AMP) |
My understanding was that PRERENDER is currently privacy preserving. |
Launched |
AMP
PREVIEW
visibility stateOverview
First step in enabling an auto-play preview mode for AMP stories, as described in #12815.
PREVIEW
mode should default toPRERENDER
mode in most cases, but must be privacy-preserving. This means any external resource loading must either happen through the serving domain (ex. via cache rewrite of<amp-video>
target) or by delaying loading the component entirely if there's no viable substitute (ex.<amp-analytics>
).Auto-play should be addressed separately while utilizing preview mode. This is to separate the set of preview-related concerns (primarily privacy and loading of external resources) from auto-play functionality (which may have more nuanced changes on how components function).
Approach
PREVIEW
visibility-state enum. AddpreviewAllowed
method toBaseElement
which defaults to returningprerenderAllowed
. This change makes thePREVIEW
visibility-state available and equivalent toPRERENDER
.preact/base-element.js
(prerenderAllowed
),resource.js
(prerenderAllowed
),scheduler.js
(maybeBuild
),resource-impl.js
(isLayoutAllowed_
), and any remaining runtime+test files to handle new state.false
frompreviewAllowed
for any components which may load external resources, blocking them in preview for now; later, their implementation can be adjusted to handle preview specifically. Non-AMP tags such as<img>
will require special handling (ex. cache rewrite) to avoid external resources, which will be the responsibility of the code/page presenting the story preview. An initial pass-through found the following tags requiring external loads, which should be initially disabled in preview:<amp-analytics>
<amp-audio>
<amp-gist>
<amp-img>
<amp-install-serviceworker>
<amp-list>
<amp-live-list>
<amp-pixel>
<amp-story-360>
<amp-story-auto-analytics>
<amp-story-interactive-binary-poll>
<amp-story-interactive-poll>
<amp-story-interactive-quiz>
<amp-story-interactive-results>
<amp-story-panning-media>
<amp-twitter>
<amp-video>
<image>
<img>
<source>
<svg>
<track>
@wg-stories
and@wg-components
can separately prioritize updating the listed components to support preview visibility. This may include logic for visibility state changes from hidden --> preview --> prerender --> visible.Milestones:
previewAllowed
toBaseElement
These steps put us in a place where client code can start to display privacy-previews of stories, which a blocklist of unsupported elements.
@newmuis Does this all seem reasonable? It looks to be fairly straightforward, if I'm not missing too much.
The text was updated successfully, but these errors were encountered: