Skip to content
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 element skeleton. #948

Merged
merged 1 commit into from
Nov 19, 2015
Merged

AMP List element skeleton. #948

merged 1 commit into from
Nov 19, 2015

Conversation

dvoytenko
Copy link
Contributor

Partial for #657.

This PR essentially brings amp-list and amp-mustache elements to a functional state. The "mustache" experiment has to be on to try it.

Some of the key outstanding questions here:

  1. Data attributes vs plain attributes? "data-src" and "data-credentials" are used in this component, but I'm wondering if it'd be better to drop "data-" here.
  2. We will need to refactor URL substitutions that feeds into amp-pixel to use it here as well
  3. This implementation is missing a fallback for when the AMP runtime refuses to change the height
  4. Some of the height change rules might need to be expanded to cover "at the footer" case where the element is within the viewport but very close to the footer.

/cc @erwinmombay

@dvoytenko
Copy link
Contributor Author

Also added URL substitutions.

}
}

AMP.registerElement('amp-list', AmpList);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

So, do we really need to special case lists?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You mean, do we need an amp-list vs a generic amp-render? If so, here are the reasons why I thought this was useful:

  1. It's actually more direct with the original request
  2. Clear how to extend it to an infinite scroll case (someone mentioned that as well)
  3. Semantics of changing height are more clear
  4. I expect as follow up we can add similar strategy to amp-carousel and such

@dvoytenko
Copy link
Contributor Author

PTAL

const assert = AMP.assert;


/**
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Add something

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done

@cramforce
Copy link
Member

LGTM

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants