Skip to content

I2I: Allow amp-list to render from amp-state initially #26473

@samouri

Description

@samouri

summary

Initially proposed in #15647, this I2I is about allowing amp-list to render from amp-state for its first render, instead of only subsequent ones. In order to support this, we can create a new uri scheme, amp-state:. The path that follows would then refer to an amp-state path.

For example,

<amp-list src="amp-state:data.path">...</amp-list>

In the above example, we would expect the value at data.path to contain the exact same json that a properly configured server would have returned. This means json with an array at items, as well as an optional load-more-src. Note that both of those required keys would still be configurable via amp-list attributes (items, and load-more-bookmark respectively).

motivation

  • Reduces the amount of effort required for publishers to show stale data, since they don't need to duplicate the template rendering logic on the server.

prototyping status
See #26284, for a prototype of this feature behind a flag.

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions