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
amp-list: Attribute to control amp-bind interaction #16833
amp-list: Attribute to control amp-bind interaction #16833
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.
validation lgtm after value
change
@@ -42,6 +42,10 @@ tags: { # <amp-list> with mandatory src attr | |||
html_format: EXPERIMENTAL | |||
tag_name: "AMP-LIST" | |||
requires_extension: "amp-list" | |||
attrs: { | |||
name: "binding" | |||
value: "always|refresh|no" |
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.
value
is now a repeated
field, so this can listed as
value: "always"
value: "no"
value: "refresh"
Same below
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 for the tip.
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.
Codecov Report
@@ Coverage Diff @@
## master #16833 +/- ##
==========================================
- Coverage 78.13% 78.12% -0.02%
==========================================
Files 560 560
Lines 40641 40645 +4
==========================================
- Hits 31756 31752 -4
- Misses 8885 8893 +8
Continue to review full report at Codecov.
|
2f29911
to
e52f638
Compare
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.
validation changes look good.
/to @aghassemi @cathyxz Ali and I briefly discussed this awhile back but let me know if you'd like me to bring it to design review. |
extensions/amp-list/0.1/amp-list.js
Outdated
const binding = this.element.getAttribute('binding'); | ||
// "no": Always skip binding update. | ||
if (binding === 'no' || | ||
isExperimentOn(this.win, 'amp-list-binding-no')) { |
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.
replace disable-faster-amp-list
in experiments.js
with this?
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.
Removed that defunct experiment.
These experiments are mostly for private testing, but I think I can just add the binding
attribute via devtools instead. Removed these too.
extensions/amp-list/0.1/amp-list.js
Outdated
// "refresh": Do _not_ block on retrieval of the Bind service before the | ||
// first mutation (AMP.setState). | ||
if (binding === 'refresh' || | ||
isExperimentOn(this.win, 'amp-list-binding-refresh')) { |
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.
is the ideal of these experiments to allow doc-level/origin trial optin?
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.
No, I wanted to test if some existing prod pages would benefit from this. Removed per comment above.
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.
.md
changes when in prod?
👍 |
Partial for #15272.
Add new amp-list attribute
binding="always|refresh|no"
to control whether rendered children are scanned for bindings and evaluated.always
is default and status quo.refresh
is same asalways
except it skips the initial render.no
disables this functionality entirely.TODO: Documentation updates.