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

🏗📖 Cap line length of Markdown files #26365

Closed
wants to merge 2 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
26 changes: 19 additions & 7 deletions .github/ISSUE_TEMPLATE.md
Original file line number Diff line number Diff line change
@@ -1,32 +1,44 @@
**Please only file bugs/feature requests for AMP here.**

- If you have questions about how to use AMP or other general questions about AMP please ask them on Stack Overflow under the AMP HTML tag instead of filing an issue here: http://stackoverflow.com/questions/tagged/amp-html
- If you have questions/issues related to Google Search please ask them in Google's AMP forum instead of filing an issue here: https://goo.gl/utQ1KZ
- If you have questions about how to use AMP or other general questions about
AMP please ask them on Stack Overflow under the AMP HTML tag instead of filing
an issue here: http://stackoverflow.com/questions/tagged/amp-html
- If you have questions/issues related to Google Search please ask them in
Google's AMP forum instead of filing an issue here: https://goo.gl/utQ1KZ

If you have a bug or feature request for AMP please fill in the following template. Delete everything except the headers (including this text).
If you have a bug or feature request for AMP please fill in the following
template. Delete everything except the headers (including this text).

## What's the issue?

Briefly describe the bug/feature request.

## How do we reproduce the issue?

If this is a bug please provide a public URL and ideally a reduced test case (e.g. on jsbin.com, codepen.io, or glitch.com) that exhibits only your issue and nothing else. Then provide step-by-step instructions for reproducing the issue:
If this is a bug please provide a public URL and ideally a reduced test case
(e.g. on jsbin.com, codepen.io, or glitch.com) that exhibits only your issue and
nothing else. Then provide step-by-step instructions for reproducing the issue:

1. Step 1 to reproduce
2. Step 2 to reproduce
3. …

If this is a feature request you can use this section to point to a prototype/mockup that will help us understand the request.
If this is a feature request you can use this section to point to a
prototype/mockup that will help us understand the request.

### Tips on Rendering Bugs

If you're reporting a bug that's the result of rendering data from an endpoint (e.g. with `<amp-list>` or `<amp-form>`), it's helpful to include sample JSON data from your endpoint. [JSONPlaceholder](https://jsonplaceholder.typicode.com/) is great for providing publicly accessible sample endpoint as well as dummy json endpoints.
If you're reporting a bug that's the result of rendering data from an endpoint
(e.g. with `<amp-list>` or `<amp-form>`), it's helpful to include sample JSON
data from your endpoint.
[JSONPlaceholder](https://jsonplaceholder.typicode.com/) is great for providing
publicly accessible sample endpoint as well as dummy json endpoints.

## What browsers are affected?

All browsers? Some specific browser? What device type?

## Which AMP version is affected?

Is this a new issue? Or was it always broken? Paste your AMP version. You can find it in the browser dev tools.
Is this a new issue? Or was it always broken? Paste your AMP version. You can
find it in the browser dev tools.
6 changes: 5 additions & 1 deletion .prettierrc
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,11 @@
},
{
"files": "*.md",
"options": {"parser": "markdown"}
"options": {
"proseWrap": "always",
"printWidth": 80,
"parser": "markdown"
}
},
{
"files": [".eslintrc", ".prettierrc", ".renovaterc.json", "*.json"],
Expand Down
112 changes: 79 additions & 33 deletions 3p/README.md
Original file line number Diff line number Diff line change
@@ -1,70 +1,116 @@
# Inclusion of third party software, embeds, and services into AMP

In general all inclusions are subject to [CONTRIBUTING.md](../CONTRIBUTING.md). This files outlines specific rules for certain types of external embed and other software inclusions.
In general all inclusions are subject to [CONTRIBUTING.md](../CONTRIBUTING.md).
This files outlines specific rules for certain types of external embed and other
software inclusions.

In order to qualify for inclusion, an extended component that integrates a third-party service must generally meet the notability requirements of the English Wikipedia, and is in common use in Internet publishing. As a rough rule of thumb, it should be used or requested by 5% of the top 10,000 websites as noted on builtwith.com, or already integrated into [oEmbed](http://oembed.com/).
In order to qualify for inclusion, an extended component that integrates a
third-party service must generally meet the notability requirements of the
English Wikipedia, and is in common use in Internet publishing. As a rough rule
of thumb, it should be used or requested by 5% of the top 10,000 websites as
noted on builtwith.com, or already integrated into [oEmbed](http://oembed.com/).

We highly prefer integrations that do not use iframes. JSONP cannot be used for security reasons, but CORS requests are perfectly fine.
We highly prefer integrations that do not use iframes. JSONP cannot be used for
security reasons, but CORS requests are perfectly fine.

## Embeds

Examples: Youtube, Vimeo videos; Tweets, Instagrams; comment systems; polls; quizzes; document viewers
Examples: Youtube, Vimeo videos; Tweets, Instagrams; comment systems; polls;
quizzes; document viewers

- Our intent is to provide first class support for all embeds that fulfill the notability guidelines laid out in [CONTRIBUTING.md](../CONTRIBUTING.md).
- Consider whether a iframe-with-placeholder solution fits your use case where iframe generation is not done immediately (can be done before user action for instant loading of iframe).
- Consider whether all that is needed is some documentation for how to use the embed with `amp-iframe`.
- Our intent is to provide first class support for all embeds that fulfill the
notability guidelines laid out in [CONTRIBUTING.md](../CONTRIBUTING.md).
- Consider whether a iframe-with-placeholder solution fits your use case where
iframe generation is not done immediately (can be done before user action for
instant loading of iframe).
- Consider whether all that is needed is some documentation for how to use the
embed with `amp-iframe`.
- Iframes and all sub resources must be served from HTTPS.
- Avoid client side rendering of iframe content.
- If your use of iframes is for style isolation, consider that AMP might provide an iframe-free alternative.
- If you can make it not-iframe-based that is much better. (See e.g. the pinterest embed). We will always ask to do this first. E.g. adding a CORS endpoint to your server might make this possible.
- Must play well within [AMP's sizing framework](https://github.com/ampproject/amphtml/blob/master/spec/amp-html-layout.md).
- If your use of iframes is for style isolation, consider that AMP might provide
an iframe-free alternative.
- If you can make it not-iframe-based that is much better. (See e.g. the
pinterest embed). We will always ask to do this first. E.g. adding a CORS
endpoint to your server might make this possible.
- Must play well within
[AMP's sizing framework](https://github.com/ampproject/amphtml/blob/master/spec/amp-html-layout.md).
- All JS on container page must be open source and bundled with AMP.
- JavaScript loaded into iframe should be reasonable with respect to functionality.
- JavaScript loaded into iframe should be reasonable with respect to
functionality.
- Use the `sandbox` attribute on iframe if possible.
- Provide unit and [integration tests](#adding-proper-integration-tests).
- Embeds that require browser plugins, such as Flash, Java, ActiveX, Silverlight, etc. are disallowed unless necessary. Special review required. We cannot currently see a reason why these should be allowed.
- Embeds that require browser plugins, such as Flash, Java, ActiveX,
Silverlight, etc. are disallowed unless necessary. Special review required. We
cannot currently see a reason why these should be allowed.

## Ads

- We welcome pull requests by all ad networks for inclusion into AMP.
- All ads and all sub resources must be served from HTTPS.
- Must play well within [AMP's sizing framework](https://github.com/ampproject/amphtml/blob/master/spec/amp-html-layout.md).
- For display ads support, always implement amp-ad and instruct your client to use your amp-ad implementation instead of using amp-iframe. Althought amp-iframe will render the ad, ad clicks will break and viewability information is not available.
- Must play well within
[AMP's sizing framework](https://github.com/ampproject/amphtml/blob/master/spec/amp-html-layout.md).
- For display ads support, always implement amp-ad and instruct your client to
use your amp-ad implementation instead of using amp-iframe. Althought
amp-iframe will render the ad, ad clicks will break and viewability
information is not available.
- Providing an optional image only zero-iframe embed is appreciated.
- Support viewability and other metrics/instrumentation as supplied by AMP (via postMessage API)
- Support viewability and other metrics/instrumentation as supplied by AMP (via
postMessage API)
- Try to keep overall iframe count at one per ad. Explain why more are needed.
- Share JS between iframes on the same page.
- Provide unit and [integration tests](#adding-proper-integration-tests).
- Provide test accounts for inclusion in our open source repository for integration tests.

The following aren't hard requirements, but are performance optimizations we should strive to incorporate. Please provide a timeline as to when you expect to follow these guidelines:

- Support pause and play APIs to turn animations on and off. Ideally also to interrupt loading.
- Never block the UI thread for longer than 50ms, so that user action is never blocked for longer than that.
- Keep individual JS files small enough, so they compile in under 50ms on a 2013 Android phone.
- Provide test accounts for inclusion in our open source repository for
integration tests.

The following aren't hard requirements, but are performance optimizations we
should strive to incorporate. Please provide a timeline as to when you expect to
follow these guidelines:

- Support pause and play APIs to turn animations on and off. Ideally also to
interrupt loading.
- Never block the UI thread for longer than 50ms, so that user action is never
blocked for longer than that.
- Keep individual JS files small enough, so they compile in under 50ms on a
2013 Android phone.
- Split up other expensive work, so it can be interrupted at 50ms boundary.
- Creatives should only use animations drive by CSS animation frame.
- Creatives should only animate using CSS transforms and opacity.
- When creatives animate they should not use more than 2ms time per frame to allow for other animations to have sufficient time for concurrent animations.
- When creatives animate they should not use more than 2ms time per frame to
allow for other animations to have sufficient time for concurrent animations.

The better an ad network does on the above requirements, the earlier ads from it will be loaded into AMP. In other words: _The slower the ad loads and the more it interferes with the page, the later AMP will load it._
The better an ad network does on the above requirements, the earlier ads from it
will be loaded into AMP. In other words: _The slower the ad loads and the more
it interferes with the page, the later AMP will load it._

We are also excited to start conversations how modern web tech could improve overall ads latency, memory usage and framerate impact and how AMP's open source model could be used to inject trust through an auditable common code base into the ads ecosystem which would reduce the necessity of redundant metrics collection.
We are also excited to start conversations how modern web tech could improve
overall ads latency, memory usage and framerate impact and how AMP's open source
model could be used to inject trust through an auditable common code base into
the ads ecosystem which would reduce the necessity of redundant metrics
collection.

Review the [ads/README](../ads/README.md) for further details on ad integration.

## Fonts

- AMP allows inclusion of fonts via the `@font-face` directive.
- JavaScript can not be involved with the initiation of font loading.
- Font loading gets controlled (but not initiated) by [`<amp-font>`](https://github.com/ampproject/amphtml/issues/648).
- AMP by default does not allow inclusion of external stylesheets, but it is happy to whitelist URL prefixes of font providers for font inclusion via link tags. These link tags and their fonts must be served via HTTPS.
- If a font provider does referrer based "security" it needs to whitelist the AMP proxy origins before being included in the link tag whitelist. AMP proxy sends the appropriate referrer header such as `https://cdn.ampproject.org` and `https://amp.cloudflare.com`.
- Font loading gets controlled (but not initiated) by
[`<amp-font>`](https://github.com/ampproject/amphtml/issues/648).
- AMP by default does not allow inclusion of external stylesheets, but it is
happy to whitelist URL prefixes of font providers for font inclusion via link
tags. These link tags and their fonts must be served via HTTPS.
- If a font provider does referrer based "security" it needs to whitelist the
AMP proxy origins before being included in the link tag whitelist. AMP proxy
sends the appropriate referrer header such as `https://cdn.ampproject.org` and
`https://amp.cloudflare.com`.

# Adding proper integration tests

You should ensure there are integration tests for your extension. These should be added to the AMP
repo where it makes sense. In some cases this won't be possible because it relies on bringing up
third-party infrastructure. In these cases you should maintain testing for the extension on your
infrastructure against both production AMP and [canary](https://github.com/ampproject/amphtml/blob/master/contributing/release-schedule.md#amp-dev-channel).
Upon any monitored failures, an escalation can be raised in [regular AMP communication channel](https://github.com/ampproject/amphtml/blob/master/CONTRIBUTING.md#discussion-channels).
You should ensure there are integration tests for your extension. These should
be added to the AMP repo where it makes sense. In some cases this won't be
possible because it relies on bringing up third-party infrastructure. In these
cases you should maintain testing for the extension on your infrastructure
against both production AMP and
[canary](https://github.com/ampproject/amphtml/blob/master/contributing/release-schedule.md#amp-dev-channel).
Upon any monitored failures, an escalation can be raised in
[regular AMP communication channel](https://github.com/ampproject/amphtml/blob/master/CONTRIBUTING.md#discussion-channels).
Loading