Add origin experiments check for amp-list#20592
Merged
cathyxz merged 7 commits intoampproject:masterfrom Jan 31, 2019
Merged
Conversation
|
Drive by comment on a WIP PR, but while we're in a refactor-y mood maybe we should split up amp-list which is 1K+ LOC already. 😄 |
9aa66fe to
3481b52
Compare
Contributor
Author
|
I've moved about 300 LOC related to the load-more feature out of |
aghassemi
reviewed
Jan 31, 2019
extensions/amp-list/0.1/amp-list.js
Outdated
| this.ssrTemplateHelper_ = new SsrTemplateHelper( | ||
| TAG, viewer, this.templates_); | ||
|
|
||
| const originTrialPromise = originExperimentsForDoc(this.getAmpDoc()) |
Contributor
There was a problem hiding this comment.
discussed offline but we want short-circuit and promise.resolve immediately if no load-more
| @@ -0,0 +1,251 @@ | |||
| /** | |||
aghassemi
approved these changes
Jan 31, 2019
nbeloglazov
pushed a commit
to nbeloglazov/amphtml
that referenced
this pull request
Feb 12, 2019
* Check for origin trial experiments in amp-list * Fix type check on origin-experiments-impl * Whitelist origin experiments dependency check * Refactor load more creation and show/hide logic out of amp-list * Fix incorrect variable * Stub getAmpDoc on the AmpDocService prototype * Short circuit origin trial logic if no amp-list-load-more attribute
noranazmy
pushed a commit
to noranazmy/amphtml
that referenced
this pull request
Mar 22, 2019
* Check for origin trial experiments in amp-list * Fix type check on origin-experiments-impl * Whitelist origin experiments dependency check * Refactor load more creation and show/hide logic out of amp-list * Fix incorrect variable * Stub getAmpDoc on the AmpDocService prototype * Short circuit origin trial logic if no amp-list-load-more attribute
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Adds a check to see if
amp-list-load-moreis within the set of origin experiments enabled for this given page. Some refactoring happened due to the fact that this check returns a promise and not a direct boolean. I debated adding a piece of code that would automatically use toggleExperiment to turn on all experiments in origin trial during runtime, but decided against this as it could inadvertently enabled experiments for all users who had once visited an origin trial page. I think a more ideal solution would be to implement a check forisOriginExperimentOnper @choumx 's original design, but I'm not sure that was ever implemented or where it should go (given the current async loading oforigin-experiments-impl.jsetc).