Skip to content

Latest commit

 

History

History
117 lines (84 loc) · 7.8 KB

DEVELOPING.md

File metadata and controls

117 lines (84 loc) · 7.8 KB

Developing in AMP

How to get started

Before you start developing in AMP, check out these resources:

Guidelines & Style

Before you start writing code, consult these resources for guidance and guidelines on:

Testing

For most developers, the instructions in the Getting Started Quick Start Guide will be sufficient for building/running/testing during development.

For detailed information on testing, see TESTING.md.

Repository Layout

  3p/             - Implementation of third party sandbox iframes.
  ads/            - Modules implementing specific ad networks used in 
  build/          - (generated) intermediate generated files
  build-system/   - build infrastructure
  builtins/       - tags built into the core AMP runtime
      *.md        - documentation for use of the builtin
      *.js        - source code for builtin tag
  contributing/   - docs for people contributing to AMP
  css/            - default css
  dist/           - (generated) main JS binaries are created here. This is what
                    gets deployed to cdn.ampproject.org.
  dist.3p/        - (generated) JS binaries and HTML files for 3p embeds and ads
                    This is what gets deployed to 3p.ampproject.net.
  examples/       - example AMP HTML files and corresponding assets
  extensions/     - plugins which extend the AMP HTML runtime's core set of tags
  spec/           - The AMP HTML Specification files
  src/            - source code for the AMP runtime
  test/           - tests for the AMP runtime and builtins
  testing/        - testing infrastructure
  third_party/    - third party code used in AMP
  tools/          - code for AMP related tools
  validator/      - AMP Validator runners and tools

Supported browsers

In general we support the 2 latest versions of major browsers like Chrome, Firefox, Edge, Safari, Opera, and UC Browser. We support desktop, phone, tablet and the web view version of these respective browsers. For iOS we support the latest 2 major versions which covers about 2 years.

Beyond that the core AMP library and builtin elements should aim for very wide browser support and we accept fixes for all browsers with market share greater than 1 percent.

In particular, we try to maintain "it might not be perfect but isn't broken"-support for IE 11, iOS 8, the Android 4.0 system browser and Chrome 41.

Eng docs

We also recommend scanning the spec. The non-element part should help understand some of the design aspects.

Builds and releases

  • The AMP buildcop helps ensure that AMP's builds remain green (i.e. everything builds and all of the tests pass). If you run into issues with builds that seem unrelated to your changes see if the issue is present on Travis and send a message to the #contributing channel on Slack (sign up for Slack).
  • Understanding the AMP release process is useful for understanding when a change in AMP will make it into production and what to do if things go wrong during the rollout of a change.

Opting in to pre-release channels

Developers and users of AMP can have their browser request AMP JS files from the pre-release channels (beta, experimental, and nightly) for all requests, using an opt-in mechanism.

To opt your browser into the a pre-release channel, go to the AMP experiments page and activate the experiment channel of your choice (see Beta/Experimental and Nightly channels in the release process document for description of these channels). Please subscribe to our low-volume announcements mailing list to get notified about important/breaking changes about AMP.

Notes:

  • When you opt into a pre-release channel via the cookie mechanism, you are only affecting the AMP JS libraries in your browser.
  • An alternative to using cookies to opt a page into these pre-release channels is adding ?optin=experimental/?optin=beta to the URL of the AMP runtime (e.g., https://cdn.ampproject.org/v0.js?optin=beta).
    • URL-based opt-in should only be used for development purposes.
    • Doing so will cause the AMP validator to flag your page as invalid, and prevent it from being included in AMP caches.
    • There is no valid-AMP way to force visitors to your site to use the AMP Experimental/Beta Channel version of AMP.

If you find an issue that appears to only occur in the Experimental/Beta Channel version of AMP:

  • please file an issue with a description of the problem
    • include a note that the problem is new to the Experimental/Beta Channel build so that it can be properly prioritized
    • include a URL to a page that reproduces the problem
  • ping the AMP Slack #release channel (sign up for Slack) with the issue you filed so we can delay the push of the Experimental/Beta Channel version to production if needed