-
Notifications
You must be signed in to change notification settings - Fork 243
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Don't auto import experimental bento components
Use the bento component info published here https://amp.dev/static/bento-components.json to determine which version of a component to auto import. Fixes #1221
- Loading branch information
1 parent
86dd137
commit 3f6febe
Showing
6 changed files
with
222 additions
and
7 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,86 @@ | ||
[ | ||
{ | ||
"name": "amp-accordion", | ||
"experimental": true, | ||
"path": "/documentation/components/amp-accordion-v1.0/", | ||
"version": "1.0" | ||
}, | ||
{ | ||
"name": "amp-base-carousel", | ||
"experimental": true, | ||
"path": "/documentation/components/amp-base-carousel-v1.0/", | ||
"version": "1.0" | ||
}, | ||
{ | ||
"name": "amp-date-countdown", | ||
"experimental": true, | ||
"path": "/documentation/components/amp-date-countdown-v1.0/", | ||
"version": "1.0" | ||
}, | ||
{ | ||
"name": "amp-date-display", | ||
"experimental": false, | ||
"path": "/documentation/components/amp-date-display-v1.0/", | ||
"version": "1.0" | ||
}, | ||
{ | ||
"name": "amp-fit-text", | ||
"experimental": true, | ||
"path": "/documentation/components/amp-fit-text-v1.0/", | ||
"version": "1.0" | ||
}, | ||
{ | ||
"name": "amp-inline-gallery", | ||
"experimental": true, | ||
"path": "/documentation/components/amp-inline-gallery-v1.0/", | ||
"version": "1.0" | ||
}, | ||
{ | ||
"name": "amp-instagram", | ||
"experimental": true, | ||
"path": "/documentation/components/amp-instagram-v1.0/", | ||
"version": "1.0" | ||
}, | ||
{ | ||
"name": "amp-lightbox", | ||
"experimental": true, | ||
"path": "/documentation/components/amp-lightbox-v1.0/", | ||
"version": "1.0" | ||
}, | ||
{ | ||
"name": "amp-selector", | ||
"experimental": true, | ||
"path": "/documentation/components/amp-selector-v1.0/", | ||
"version": "1.0" | ||
}, | ||
{ | ||
"name": "amp-social-share", | ||
"experimental": true, | ||
"path": "/documentation/components/amp-social-share-v1.0/", | ||
"version": "1.0" | ||
}, | ||
{ | ||
"name": "amp-stream-gallery", | ||
"experimental": true, | ||
"path": "/documentation/components/amp-stream-gallery-v1.0/", | ||
"version": "1.0" | ||
}, | ||
{ | ||
"name": "amp-timeago", | ||
"experimental": true, | ||
"path": "/documentation/components/amp-timeago-v1.0/", | ||
"version": "1.0" | ||
}, | ||
{ | ||
"name": "amp-video", | ||
"experimental": true, | ||
"path": "/documentation/components/amp-video-v1.0/", | ||
"version": "1.0" | ||
}, | ||
{ | ||
"name": "amp-youtube", | ||
"experimental": true, | ||
"path": "/documentation/components/amp-youtube-v1.0/", | ||
"version": "1.0" | ||
} | ||
] |
26 changes: 26 additions & 0 deletions
26
...nsformers/valid/AutoExtensionImporter/uses-non-experimental-versions/expected_output.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
<!doctype html> | ||
<html ⚡> | ||
<head> | ||
<meta charset="utf-8"> | ||
<title>My AMP Page</title> | ||
<link rel="canonical" href="self.html"> | ||
<style amp-boilerplate>body{-webkit-animation:-amp-start 8s steps(1,end) 0s 1 normal both;-moz-animation:-amp-start 8s steps(1,end) 0s 1 normal both;-ms-animation:-amp-start 8s steps(1,end) 0s 1 normal both;animation:-amp-start 8s steps(1,end) 0s 1 normal both}@-webkit-keyframes -amp-start{from{visibility:hidden}to{visibility:visible}}@-moz-keyframes -amp-start{from{visibility:hidden}to{visibility:visible}}@-ms-keyframes -amp-start{from{visibility:hidden}to{visibility:visible}}@-o-keyframes -amp-start{from{visibility:hidden}to{visibility:visible}}@keyframes -amp-start{from{visibility:hidden}to{visibility:visible}}</style><noscript><style amp-boilerplate>body{-webkit-animation:none;-moz-animation:none;-ms-animation:none;animation:none}</style></noscript> | ||
<script async src="https://cdn.ampproject.org/v0.js"></script> | ||
<script async src="https://cdn.ampproject.org/v0/amp-timeago-0.1.js" custom-element="amp-timeago"></script><script async src="https://cdn.ampproject.org/v0/amp-youtube-0.1.js" custom-element="amp-youtube"></script><script async src="https://cdn.ampproject.org/v0/amp-date-display-1.0.js" custom-element="amp-date-display"></script><script async src="https://cdn.ampproject.org/v0/amp-mustache-0.2.js" custom-template="amp-mustache"></script> | ||
</head> | ||
<body> | ||
<!-- import non-bento component v0.1 instead of experimental bento v1.0 --> | ||
<amp-timeago layout="fixed" width="160" height="20" datetime="2017-04-11T00:37:33.809Z" locale="en"> | ||
Saturday 11 April 2017 00.37 | ||
</amp-timeago> | ||
<amp-youtube data-videoid="mGENRKrdoGY" layout="responsive" width="480" height="270"></amp-youtube> | ||
<!-- import non-experimental bento component v1.0 --> | ||
<amp-date-display datetime="2017-08-02T15:05:05.000" layout="fixed" width="360" height="20"> | ||
<template type="amp-mustache"> | ||
<div> | ||
{{dayName}} {{day}} {{monthName}} {{year}}{{hourTwoDigit}}:{{minuteTwoDigit}}:{{secondTwoDigit}} | ||
</div> | ||
</template> | ||
</amp-date-display> | ||
</body> | ||
</html> |
40 changes: 40 additions & 0 deletions
40
...r/spec/transformers/valid/AutoExtensionImporter/uses-non-experimental-versions/input.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
<!doctype html> | ||
<html ⚡> | ||
<head> | ||
<meta charset="utf-8"> | ||
<title>My AMP Page</title> | ||
<link rel="canonical" href="self.html"> | ||
<style amp-boilerplate>body{-webkit-animation:-amp-start 8s steps(1,end) 0s 1 normal both;-moz-animation:-amp-start 8s steps(1,end) 0s 1 normal both;-ms-animation:-amp-start 8s steps(1,end) 0s 1 normal both;animation:-amp-start 8s steps(1,end) 0s 1 normal both}@-webkit-keyframes -amp-start{from{visibility:hidden}to{visibility:visible}}@-moz-keyframes -amp-start{from{visibility:hidden}to{visibility:visible}}@-ms-keyframes -amp-start{from{visibility:hidden}to{visibility:visible}}@-o-keyframes -amp-start{from{visibility:hidden}to{visibility:visible}}@keyframes -amp-start{from{visibility:hidden}to{visibility:visible}}</style><noscript><style amp-boilerplate>body{-webkit-animation:none;-moz-animation:none;-ms-animation:none;animation:none}</style></noscript> | ||
<script async src="https://cdn.ampproject.org/v0.js"></script> | ||
</head> | ||
<body> | ||
<!-- import non-bento component v0.1 instead of experimental bento v1.0 --> | ||
<amp-timeago | ||
layout="fixed" | ||
width="160" | ||
height="20" | ||
datetime="2017-04-11T00:37:33.809Z" | ||
locale="en" | ||
> | ||
Saturday 11 April 2017 00.37 | ||
</amp-timeago> | ||
<amp-youtube | ||
data-videoid="mGENRKrdoGY" | ||
layout="responsive" | ||
width="480" | ||
height="270" | ||
></amp-youtube> | ||
<!-- import non-experimental bento component v1.0 --> | ||
<amp-date-display | ||
datetime="2017-08-02T15:05:05.000" | ||
layout="fixed" | ||
width="360" | ||
height="20" | ||
> | ||
<template type="amp-mustache"> | ||
<div> | ||
{{dayName}} {{day}} {{monthName}} {{year}}{{hourTwoDigit}}:{{minuteTwoDigit}}:{{secondTwoDigit}} </div> | ||
</template> | ||
</amp-date-display> | ||
</body> | ||
</html> |