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-iframe guideline to prefer existing components #7264

Merged
merged 4 commits into from Jan 31, 2017

Conversation

ericlindley-g
Copy link
Contributor

Thought it would be good to document this somewhere, but want to make sure it's accurate and useful. Not sure who is the best person to review, but /to @cramforce as a first guess, given the component history

`amp-iframe` should be considered a fallback if the required user experience is not possible by other means in AMP. This is because there are many benefits to using a component tailored for a specific use-case instead, such as

- Better resource management and performance
- Increased loading priority (`amp-iframe` loads last, because AMP doesn't know what's inside of it)
Copy link
Member

Choose a reason for hiding this comment

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

Not correct

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Got it—is there anything we can say around better loading priority for specific components v. amp-iframe, or should this line just be deleted?

Copy link
Member

Choose a reason for hiding this comment

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

Just delete it.

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

- Better resource management and performance
- Increased loading priority (`amp-iframe` loads last, because AMP doesn't know what's inside of it)
- Custom components can provide built-in placeholder images in some cases. This means getting, say, the right video thumbnail before a video loads, and reduces the coding effort to add a placeholder manually.
- Built-in resize requests. This means that iframe content with unpredictable size can more often appear to the user as if it were native to the page, rather than in a scrollable frame
Copy link
Member

Choose a reason for hiding this comment

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

Built-in resizing.

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

@@ -208,3 +208,13 @@ Iframes are identified as tracking/analytics iframes if they appear to serve no
## Validation

See [amp-iframe rules](https://github.com/ampproject/amphtml/blob/master/extensions/amp-iframe/0.1/validator-amp-iframe.protoascii) in the AMP validator specification.

## Guideline: prefer existing AMP components to `amp-iframe`
Copy link
Member

Choose a reason for hiding this comment

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

s/existing/specific

Please add link to list of components.

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

@ericlindley-g
Copy link
Contributor Author

Thanks for the feedback—should be updated to address the comments now

@@ -208,3 +208,12 @@ Iframes are identified as tracking/analytics iframes if they appear to serve no
## Validation

See [amp-iframe rules](https://github.com/ampproject/amphtml/blob/master/extensions/amp-iframe/0.1/validator-amp-iframe.protoascii) in the AMP validator specification.

## Guideline: prefer [specific AMP components](https://github.com/ampproject/amphtml/tree/master/extensions) to `amp-iframe`
Copy link
Member

Choose a reason for hiding this comment

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

When this goes into the docs site, please check that the link there points to the right destination. CC @pbakaus

@cramforce cramforce merged commit bba72a8 into master Jan 31, 2017
@cramforce cramforce deleted the ericlindley-g-patch-9 branch January 31, 2017 17:22
torch2424 pushed a commit to torch2424/amphtml that referenced this pull request Feb 14, 2017
mrjoro pushed a commit to mrjoro/amphtml that referenced this pull request Apr 28, 2017
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.

None yet

2 participants