ampproject / ampproject/amphtml

[amp story shopping] Remove attachment templates when far from active page

Open
#37,517 2 comments 0 reactions 1 assignee Claimed by @processprocess View on GitHub
Component: amp-story-shopping P2: Soon Stale Type: Feature Request WG: stories
Dominant language
JavaScript
Stars
14.9k
Forks
4.1k
PR merge metrics
No merged PRs in 30d

Description

### Description

Attachment templates can potentially build a lot of dom that may not be necessary if the user navigates far away from them.
They should be removed from the dom at a certain distance and can be re-built if the user goes back.

### Alternatives Considered

Leave them in the dom.
It's okay to leave them but it keeps lots of un-needed dom in the document, which may slow down the experience.

### Additional Context

Distance can be read using a pattern used in [panning-media](https://github.com/processprocess/amphtml/blob/main/extensions/amp-story-panning-media/0.1/amp-story-panning-media.js#L153-L160)

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.