-
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
initialize amp-list from amp-state, finishing touches #27180
Conversation
Hey @ampproject/wg-caching, these files were changed:
|
3c314d3
to
3d01abc
Compare
Refresh All Lists | ||
</div> | ||
|
||
<h3>Static amp-list, inlined state. |
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 can consider adding this to examples/bind/list.amp.html
. Also feel free to reorganize these example files if you'd like. They're pretty messy.
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.
It feels as though it equally belongs with amp-list
and amp-bind
, but potentially more so with amp-list
. Mind if I move all of the amp-list examples to examples/amp-list/*.html
after this PR goes through?
extensions/amp-list/amp-list.md
Outdated
@@ -220,6 +220,23 @@ In several cases, we may need the `<amp-list>` to resize on user interaction. Fo | |||
</amp-list> | |||
``` | |||
|
|||
### Initialization from amp-state | |||
|
|||
In some cases, it may be desirable to have your `<amp-list>` component initialize off of `<amp-state>` rather than from a json endpoint. |
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.
Let's be more prescriptive here to help developers do the right thing. When is this a good idea?
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.
Added some more detail, let me know if you think it can be improved further!
extensions/amp-list/amp-list.md
Outdated
} | ||
</script> | ||
</amp-state> | ||
<amp-list src="amp-state:listExample">...</amp-list> |
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.
Let's make this example as simple as possible but also complete enough to be copy/pasted.
Nit: s/listExample/localState
?
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.
Done
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.
Going to double check that this works actually (via copy/paste)
cd1a10e
to
5e92cc7
Compare
@@ -98,6 +98,7 @@ tags: { # <amp-list> with mandatory src and/or [src] attr | |||
mandatory_anyof: "['src','[src]','data-amp-bind-src']" | |||
value_url: { | |||
protocol: "https" | |||
protocol: "amp-state" |
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.
@morsssss: I submitted with all your changes included. If I missed anything or you change your mind about the wording of the docs, feel free to either ping me or open a PR and attach me as a reviewer! |
thanks @samouri ! |
* amp-list: add example for initialization from amp-state * improve example, and add amp-state to allowed protocols * add documentation * remove feature flag * unique ids * lint * format amp-list.md * remove accidental additions * address choumx feedback * revert experiments-config.js * ben rewrite
* cl/301228504 Revision bump for ampproject#27083 * cl/301306664 Revision bump for ampproject#27180 * Update validator-amp-list.out * Update validator-amp-list.out * Update validator-amp-list.out
summary
examples/
amp-list.md
amp-state:
protocol to list of allowed ones in the validator.