Giter Site home page Giter Site logo

ampproject / amphtml Goto Github PK

View Code? Open in Web Editor NEW
14.9K 639.0 3.9K 935.11 MB

The AMP web component framework.

Home Page: https://amp.dev

License: Apache License 2.0

JavaScript 79.93% HTML 9.10% CSS 2.22% Python 0.28% Shell 0.08% Go 0.03% Yacc 0.12% Starlark 0.15% C++ 7.54% TypeScript 0.55% C 0.01%

amphtml's Introduction

AMP ⚡

⚡⚡⚡

Build Status GitHub Release Commits

Tooling

Percy Prettier Codecov Renovate

AMP is a web component framework for easily creating user-first websites, stories, ads, emails and more.

AMP is an open source project, and we'd love your help making it better!

Want to know more about AMP?

Having a problem using AMP?

Want to help make AMP better?

Other useful information

amphtml's People

Contributors

aghassemi avatar alanorozco avatar calebcordry avatar caroqliu avatar cathyxz avatar cramforce avatar cvializ avatar danielrozenberg avatar dvoytenko avatar enriqe avatar erwinmombay avatar estherkim avatar gmajoulet avatar gregable avatar honeybadgerdontcare avatar jridgewell avatar keithwrightbos avatar lannka avatar mkhatib avatar mszylkowski avatar newmuis avatar powdercloud avatar powerivq avatar processprocess avatar rcebulko avatar renovate-bot avatar renovate[bot] avatar rsimha avatar samouri avatar zhouyx avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

amphtml's Issues

Support playing videos in amp-anim

It is often more efficient to play a video than an actual GIF.

We should support the ability to provide a video src. Videos would for now never auto play. Also we should make sure that only ever one video is in play mode.

CC @dvoytenko @tjsavage

Add commit hooks

Commit hook for DO NOT SUBMIT
console.log/error, etc.
Tests passing (Can use travis CI when we are public).

Switch placeholder for amp-video to poster

Or decide the opposite.

From Taylor:
Poster would certainly be simpler/more platform aligned. The initial reasoning was to allow for more flexibility - if the author wanted to include anything more complex than an image, like a fancy splash screen with a custom play overlay that changed on hover, for example.

But certainly in favor of narrowing scope in the preview for this one and any others.

Discuss: Link protocol required in anchor tags.

The spec says about links:
Links must be relative, protocol relative or use the schemas HTTP or HTTPS.
After thinking about it some more, we should allow all protocols except those which mess with the page that's being displayed (javascript: - anything else?). Reason for allowing the others is that some links go to / open native apps, and users may want that. E.g., a link may open the mail app or some other app. In other words, for these other protocols the act of clicking is still a navigation, more like http / https, and is quite different from the javascript: protocol.
PS: Yes I understand it's also a selfish request because the validator already behaves like this. A change to the validator to make it match the spec is easy to do, but perhaps the status quo is actually better. Thanks for considering.

Improve developer mode detection in AMP runtime.

QUICK DESCRIPTION:

When loading an AMP HTML file (attached) locally with Chrome the tags report the following error:

"...connection attempt to ads.localhost was rejected..."
GET http://ads.localhost/ads/v0.html net::ERR_CONNECTION_REFUSED

This comes from the AMP runtime (https://www.gstatic.com/amphtml/v0.js):


return"localhost"!=e.location.hostname&&e.location.hostname||(t="http://ads.localhost:"+e.location.port+"/ads/v0.html"),t}Object.defineProperty(n,"__esModule",{value:!0})


It appears that I need to load the file from a host. When I host the AMP HTML sample file on...
www.googledrive.com/host/0B2EN3x884QPPMUc1eVZscFRIeDg
...both the and tags appear to work using Safari, though the appear to fail on Chrome.

STEPS TO REPRODUCE:

  1. Open the attached amp.html from the file system in the Chrome browser.

EXPECTED RESULTS:
All frames should load with content.

OBSERVED RESULTS:
See attached screenshots (pieter-amp-ad-js-failed-1.png & pieter-amp-ad-js-failed-2.png).
The ad frames do not load with valid content.

RESOLUTION:
Works fine when the file is hosted. See: www.googledrive.com/host/0B2EN3x884QPPMUc1eVZscFRIeDg

A more convenient temp host location:
https://jsbin.com/detuniticu
https://jsbin.com/detuniticu/edit?html,console,output

amp-pixel breaks the page

Git pulled on 10 sept 2015
By adding an < amp-pixel src="https://....." > the page turns blank. I'm getting the following error in Chrome's console
Uncaught Error: Layout not supported for: container
ElementProto.firstAttachedCallback_ @ viewport.js:45
ElementProto.attachedCallback @ viewport.js:22
Regards
Enrico Canardi

Improve display of components in error state

We need to unify how we do this.

The idea to show it in the DOM (at least in dev mode is great), but needs to go through a common API and should also work for asserts.

Would also be nice if our logger would take an element and one could inspect what was logged for an element.

@dvoytenko

Is amp-form avaliable?

Hi,

I have found on amp-html-components.md a doc about forms.

I have tried to use the example, but the message DISALLOWED_TAG is showed.

Are amp-input and related tags avaliable?

DISALLOWED_TAG amp-form
    (anonymous function) @ amp.js:10139
    (anonymous function) @ amp.js:10138

DISALLOWED_TAG amp-email-input
    (anonymous function) @ amp.js:10139
    (anonymous function) @ amp.js:10138

DISALLOWED_TAG amp-on
    (anonymous function) @ amp.js:10139
    (anonymous function) @ amp.js:10138

Spec: Disallow http-equiv in meta tags

I tried to make a pull request for this already:
#18

  • The existing language in the spec doesn't actually catch pages which refresh.
  • It's not clear that other values for http-equiv are worthwhile to support.
    Thanks much for considering.

<amp-video> preroll

Hi

According to the attached comment done by Taylor in the "Component Spec Document", would be possible to include the preroll attribute in the tag ?

Thank you

Taylor Savage
Perfect. I'll add a preroll attribute to the spec for the simple, built-in case. For something like IMA a pretty straightforward Extended Component should be created to enable IMA ads directly, and similar Extended Components should be created for other media ad networks.

Try to hack our layout system

Try to build a document that escapes our layout rules in as many ways as possible.

Try to add margins, padding, line-height, whatever, to make a document change size after content loaded.

CC @dvoytenko

Discuss: Maximum size validation error if the author stylesheet is larger than 20KB post gzip.

The spec currently requires a validator to compress the stylesheet with gzip.
I'd like to propose simplifying this away, e.g., say "... if the author stylesheet is larger than 50KB" (or some other value. Reasons:

  • It's inefficient to have to compress just to validate, and for Javascript I think it introduces a dependency on a pure javascript gzip compressor.
  • Compression effectiveness may be subject to specific implementations of gzip / compression levels etc., so it's not well defined.
  • Stuff that compresses super well but blows up terrible afterward can be a security problem; I think this is known as a "decompression bomb". When it's not a security problem, it's still annoying to the user because the browser will use a lot of RAM. So I think it's better to discourage effectiveness on text compression. If people can't fit their elaborate CSS, let them shorten the names,ids,labels,etc a little bit and remove the unused cruft. :-)
    Thanks much for considering.

Disallow the title attribute?

I've seen it in example docs, but the spec discourages its use including because it may be useless on mobile devices:
"Relying on the title attribute is currently discouraged as many user agents do not expose the attribute in an accessible manner as required by this specification (e.g. requiring a pointing device such as a mouse to cause a tooltip to appear, which excludes keyboard-only users and touch-only users, such as anyone with a modern phone or tablet)."
http://www.w3.org/TR/html5/single-page.html#the-title-attribute

Implement advanced resource prioritization

Current state of discussion is:

Every type of resource has a base priority (image, pixel > ads). Actual load priority is influenced by position in viewport. Highest priority for visible resources, lower priority for resources that are about to becomes visible.

For the base priority we need thresholds: Based on prerender mode we may never want to render

  • any resource
  • ads, pixels (Even though pixels are high priority during normal loading or even special enough to be out of band)

During scrolling we never want to trigger loading an ad (I think, unless that ends up not feeling good due to incremental rendering).

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.