From 76522bdcf68b8dab9f5e1ac85e4881a33371dcae Mon Sep 17 00:00:00 2001 From: powerivq Date: Wed, 22 May 2024 23:37:40 -0700 Subject: [PATCH] amp optimizer to support ampjs.org (not enabled as default) --- package-lock.json | 154 ++++++------- packages/optimizer/lib/AmpConstants.js | 3 +- packages/optimizer/lib/RuntimeHostHelper.js | 4 +- packages/optimizer/lib/extensionConfig.json | 2 +- .../optimizer/lib/fetchRuntimeParameters.js | 18 +- .../lib/transformers/AddMandatoryTags.js | 216 +++++++++--------- .../transformers/AmpStoryCssTransformer.js | 4 +- .../lib/transformers/AutoExtensionImporter.js | 4 +- .../transformers/ReorderHeadTransformer.js | 2 +- .../lib/transformers/RewriteAmpUrls.js | 10 +- .../spec/helpers/validatorInstance.js | 1 + .../expected_output.html | 13 ++ .../keep-existing-tags-ampjs/input.html | 10 + .../adds_lts_ampjs/expected_output.html | 13 ++ .../RewriteAmpUrls/adds_lts_ampjs/input.html | 16 ++ .../adds_preloads_ampjs/expected_output.html | 13 ++ .../adds_preloads_ampjs/input.html | 11 + .../runtime-version/lib/RuntimeVersion.js | 7 +- 18 files changed, 293 insertions(+), 208 deletions(-) create mode 100644 packages/optimizer/spec/transformers/valid/AddMandatoryTags/keep-existing-tags-ampjs/expected_output.html create mode 100644 packages/optimizer/spec/transformers/valid/AddMandatoryTags/keep-existing-tags-ampjs/input.html create mode 100644 packages/optimizer/spec/transformers/valid/RewriteAmpUrls/adds_lts_ampjs/expected_output.html create mode 100644 packages/optimizer/spec/transformers/valid/RewriteAmpUrls/adds_lts_ampjs/input.html create mode 100644 packages/optimizer/spec/transformers/valid/RewriteAmpUrls/adds_preloads_ampjs/expected_output.html create mode 100644 packages/optimizer/spec/transformers/valid/RewriteAmpUrls/adds_preloads_ampjs/input.html diff --git a/package-lock.json b/package-lock.json index 8d5d17d6c..65878faa9 100644 --- a/package-lock.json +++ b/package-lock.json @@ -24887,15 +24887,15 @@ }, "packages/cache-list": { "name": "@ampproject/toolbox-cache-list", - "version": "2.8.0", + "version": "2.9.0", "license": "Apache-2.0", "dependencies": { - "@ampproject/toolbox-core": "^2.8.0" + "@ampproject/toolbox-core": "2.9.0" } }, "packages/cache-url": { "name": "@ampproject/toolbox-cache-url", - "version": "2.8.0", + "version": "2.9.0", "license": "Apache-2.0", "dependencies": { "punycode": "2.1.1", @@ -24904,17 +24904,17 @@ }, "packages/cli": { "name": "@ampproject/toolbox-cli", - "version": "2.8.10", + "version": "2.9.0", "license": "Apache-2.0", "dependencies": { - "@ampproject/toolbox-cache-list": "^2.8.0", - "@ampproject/toolbox-cache-url": "^2.8.0", - "@ampproject/toolbox-core": "^2.8.0", - "@ampproject/toolbox-linter": "2.8.10", - "@ampproject/toolbox-optimizer": "2.8.10", - "@ampproject/toolbox-runtime-fetch": "^2.8.0", - "@ampproject/toolbox-runtime-version": "^2.8.0", - "@ampproject/toolbox-update-cache": "^2.8.0", + "@ampproject/toolbox-cache-list": "2.9.0", + "@ampproject/toolbox-cache-url": "2.9.0", + "@ampproject/toolbox-core": "2.9.0", + "@ampproject/toolbox-linter": "2.9.0", + "@ampproject/toolbox-optimizer": "2.9.0", + "@ampproject/toolbox-runtime-fetch": "2.9.0", + "@ampproject/toolbox-runtime-version": "2.9.0", + "@ampproject/toolbox-update-cache": "2.9.0", "minimist": "1.2.6", "minimist-options": "4.1.0", "node-fetch": "2.6.7" @@ -24925,7 +24925,7 @@ }, "packages/core": { "name": "@ampproject/toolbox-core", - "version": "2.8.0", + "version": "2.9.0", "license": "Apache-2.0", "dependencies": { "cross-fetch": "3.1.5", @@ -24934,23 +24934,23 @@ }, "packages/cors": { "name": "@ampproject/toolbox-cors", - "version": "2.8.0", + "version": "2.9.0", "license": "Apache-2.0", "dependencies": { - "@ampproject/toolbox-cache-list": "^2.8.0", - "@ampproject/toolbox-cache-url": "^2.8.0", - "@ampproject/toolbox-core": "^2.8.0" + "@ampproject/toolbox-cache-list": "2.9.0", + "@ampproject/toolbox-cache-url": "2.9.0", + "@ampproject/toolbox-core": "2.9.0" } }, "packages/linter": { "name": "@ampproject/toolbox-linter", - "version": "2.8.10", + "version": "2.9.0", "license": "Apache-2.0", "dependencies": { - "@ampproject/toolbox-cache-list": "^2.8.0", - "@ampproject/toolbox-cache-url": "^2.8.0", - "@ampproject/toolbox-optimizer": "2.8.10", - "@ampproject/toolbox-validator-rules": "2.8.0", + "@ampproject/toolbox-cache-list": "2.9.0", + "@ampproject/toolbox-cache-url": "2.9.0", + "@ampproject/toolbox-optimizer": "2.9.0", + "@ampproject/toolbox-validator-rules": "2.9.0", "amphtml-validator": "1.0.35", "chalk": "4.1.0", "cheerio": "1.0.0-rc.5", @@ -25053,13 +25053,13 @@ }, "packages/optimizer": { "name": "@ampproject/toolbox-optimizer", - "version": "2.8.10", + "version": "2.9.0", "license": "Apache-2.0", "dependencies": { - "@ampproject/toolbox-core": "2.8.0", - "@ampproject/toolbox-runtime-version": "2.8.0", - "@ampproject/toolbox-script-csp": "2.8.0", - "@ampproject/toolbox-validator-rules": "2.8.0", + "@ampproject/toolbox-core": "2.9.0", + "@ampproject/toolbox-runtime-version": "2.9.0", + "@ampproject/toolbox-script-csp": "2.9.0", + "@ampproject/toolbox-validator-rules": "2.9.0", "abort-controller": "3.0.0", "cross-fetch": "3.1.5", "cssnano-simple": "2.0.0", @@ -25085,21 +25085,21 @@ }, "packages/optimizer-docker": { "name": "toolbox-optimizer-docker", - "version": "2.8.10", + "version": "2.9.0", "license": "Apache-2.0", "dependencies": { - "@ampproject/toolbox-optimizer": "2.8.10", + "@ampproject/toolbox-optimizer": "2.9.0", "prom-client": "13.1.0" } }, "packages/optimizer-express": { "name": "@ampproject/toolbox-optimizer-express", - "version": "2.8.10", + "version": "2.9.0", "license": "Apache-2.0", "dependencies": { - "@ampproject/toolbox-core": "^2.8.0", - "@ampproject/toolbox-optimizer": "2.8.10", - "@ampproject/toolbox-runtime-version": "^2.8.0", + "@ampproject/toolbox-core": "2.9.0", + "@ampproject/toolbox-optimizer": "2.9.0", + "@ampproject/toolbox-runtime-version": "2.9.0", "mime-types": "2.1.29", "whatwg-url": "8.4.0" } @@ -25207,10 +25207,10 @@ }, "packages/page-experience": { "name": "@ampproject/toolbox-page-experience", - "version": "2.8.10", + "version": "2.9.0", "license": "Apache-2.0", "dependencies": { - "@ampproject/toolbox-linter": "2.8.10", + "@ampproject/toolbox-linter": "2.9.0", "cheerio": "1.0.0-rc.5", "css-font-face-src": "1.0.0", "postcss": "8.2.8", @@ -25239,12 +25239,12 @@ }, "packages/runtime-fetch": { "name": "@ampproject/toolbox-runtime-fetch", - "version": "2.8.0", + "version": "2.9.0", "license": "Apache-2.0", "dependencies": { - "@ampproject/toolbox-cache-list": "^2.8.0", - "@ampproject/toolbox-core": "^2.8.0", - "@ampproject/toolbox-runtime-version": "^2.8.0", + "@ampproject/toolbox-cache-list": "2.9.0", + "@ampproject/toolbox-core": "2.9.0", + "@ampproject/toolbox-runtime-version": "2.9.0", "at-least-node": "1.0.0", "fs-extra": "9.1.0", "node-fetch": "2.6.7" @@ -25272,30 +25272,30 @@ }, "packages/runtime-version": { "name": "@ampproject/toolbox-runtime-version", - "version": "2.8.0", + "version": "2.9.0", "license": "Apache-2.0", "dependencies": { - "@ampproject/toolbox-core": "^2.8.0" + "@ampproject/toolbox-core": "2.9.0" } }, "packages/script-csp": { "name": "@ampproject/toolbox-script-csp", - "version": "2.8.0", + "version": "2.9.0", "license": "Apache-2.0" }, "packages/update-cache": { "name": "@ampproject/toolbox-update-cache", - "version": "2.8.0", + "version": "2.9.0", "license": "Apache-2.0", "dependencies": { - "@ampproject/toolbox-cache-list": "^2.8.0", - "@ampproject/toolbox-cache-url": "^2.8.0", + "@ampproject/toolbox-cache-list": "2.9.0", + "@ampproject/toolbox-cache-url": "2.9.0", "jsrsasign": "10.5.25" } }, "packages/validator-rules": { "name": "@ampproject/toolbox-validator-rules", - "version": "2.8.0", + "version": "2.9.0", "license": "Apache-2.0", "dependencies": { "cross-fetch": "3.1.5" @@ -25354,7 +25354,7 @@ "@ampproject/toolbox-cache-list": { "version": "file:packages/cache-list", "requires": { - "@ampproject/toolbox-core": "^2.8.0" + "@ampproject/toolbox-core": "2.9.0" } }, "@ampproject/toolbox-cache-url": { @@ -25367,14 +25367,14 @@ "@ampproject/toolbox-cli": { "version": "file:packages/cli", "requires": { - "@ampproject/toolbox-cache-list": "^2.8.0", - "@ampproject/toolbox-cache-url": "^2.8.0", - "@ampproject/toolbox-core": "^2.8.0", - "@ampproject/toolbox-linter": "2.8.10", - "@ampproject/toolbox-optimizer": "2.8.10", - "@ampproject/toolbox-runtime-fetch": "^2.8.0", - "@ampproject/toolbox-runtime-version": "^2.8.0", - "@ampproject/toolbox-update-cache": "^2.8.0", + "@ampproject/toolbox-cache-list": "2.9.0", + "@ampproject/toolbox-cache-url": "2.9.0", + "@ampproject/toolbox-core": "2.9.0", + "@ampproject/toolbox-linter": "2.9.0", + "@ampproject/toolbox-optimizer": "2.9.0", + "@ampproject/toolbox-runtime-fetch": "2.9.0", + "@ampproject/toolbox-runtime-version": "2.9.0", + "@ampproject/toolbox-update-cache": "2.9.0", "minimist": "1.2.6", "minimist-options": "4.1.0", "node-fetch": "2.6.7" @@ -25390,18 +25390,18 @@ "@ampproject/toolbox-cors": { "version": "file:packages/cors", "requires": { - "@ampproject/toolbox-cache-list": "^2.8.0", - "@ampproject/toolbox-cache-url": "^2.8.0", - "@ampproject/toolbox-core": "^2.8.0" + "@ampproject/toolbox-cache-list": "2.9.0", + "@ampproject/toolbox-cache-url": "2.9.0", + "@ampproject/toolbox-core": "2.9.0" } }, "@ampproject/toolbox-linter": { "version": "file:packages/linter", "requires": { - "@ampproject/toolbox-cache-list": "^2.8.0", - "@ampproject/toolbox-cache-url": "^2.8.0", - "@ampproject/toolbox-optimizer": "2.8.10", - "@ampproject/toolbox-validator-rules": "2.8.0", + "@ampproject/toolbox-cache-list": "2.9.0", + "@ampproject/toolbox-cache-url": "2.9.0", + "@ampproject/toolbox-optimizer": "2.9.0", + "@ampproject/toolbox-validator-rules": "2.9.0", "amphtml-validator": "1.0.35", "chalk": "4.1.0", "cheerio": "1.0.0-rc.5", @@ -25466,10 +25466,10 @@ "@ampproject/toolbox-optimizer": { "version": "file:packages/optimizer", "requires": { - "@ampproject/toolbox-core": "2.8.0", - "@ampproject/toolbox-runtime-version": "2.8.0", - "@ampproject/toolbox-script-csp": "2.8.0", - "@ampproject/toolbox-validator-rules": "2.8.0", + "@ampproject/toolbox-core": "2.9.0", + "@ampproject/toolbox-runtime-version": "2.9.0", + "@ampproject/toolbox-script-csp": "2.9.0", + "@ampproject/toolbox-validator-rules": "2.9.0", "abort-controller": "3.0.0", "cross-fetch": "3.1.5", "cssnano-simple": "2.0.0", @@ -25532,9 +25532,9 @@ "@ampproject/toolbox-optimizer-express": { "version": "file:packages/optimizer-express", "requires": { - "@ampproject/toolbox-core": "^2.8.0", - "@ampproject/toolbox-optimizer": "2.8.10", - "@ampproject/toolbox-runtime-version": "^2.8.0", + "@ampproject/toolbox-core": "2.9.0", + "@ampproject/toolbox-optimizer": "2.9.0", + "@ampproject/toolbox-runtime-version": "2.9.0", "mime-types": "2.1.29", "whatwg-url": "8.4.0" }, @@ -25561,7 +25561,7 @@ "@ampproject/toolbox-page-experience": { "version": "file:packages/page-experience", "requires": { - "@ampproject/toolbox-linter": "2.8.10", + "@ampproject/toolbox-linter": "2.9.0", "cheerio": "1.0.0-rc.5", "css-font-face-src": "1.0.0", "postcss": "8.2.8", @@ -25582,9 +25582,9 @@ "@ampproject/toolbox-runtime-fetch": { "version": "file:packages/runtime-fetch", "requires": { - "@ampproject/toolbox-cache-list": "^2.8.0", - "@ampproject/toolbox-core": "^2.8.0", - "@ampproject/toolbox-runtime-version": "^2.8.0", + "@ampproject/toolbox-cache-list": "2.9.0", + "@ampproject/toolbox-core": "2.9.0", + "@ampproject/toolbox-runtime-version": "2.9.0", "at-least-node": "1.0.0", "fs-extra": "9.1.0", "node-fetch": "2.6.7" @@ -25607,7 +25607,7 @@ "@ampproject/toolbox-runtime-version": { "version": "file:packages/runtime-version", "requires": { - "@ampproject/toolbox-core": "^2.8.0" + "@ampproject/toolbox-core": "2.9.0" } }, "@ampproject/toolbox-script-csp": { @@ -25616,8 +25616,8 @@ "@ampproject/toolbox-update-cache": { "version": "file:packages/update-cache", "requires": { - "@ampproject/toolbox-cache-list": "^2.8.0", - "@ampproject/toolbox-cache-url": "^2.8.0", + "@ampproject/toolbox-cache-list": "2.9.0", + "@ampproject/toolbox-cache-url": "2.9.0", "jsrsasign": "10.5.25" } }, @@ -42416,7 +42416,7 @@ "toolbox-optimizer-docker": { "version": "file:packages/optimizer-docker", "requires": { - "@ampproject/toolbox-optimizer": "2.8.10", + "@ampproject/toolbox-optimizer": "2.9.0", "prom-client": "13.1.0" } }, diff --git a/packages/optimizer/lib/AmpConstants.js b/packages/optimizer/lib/AmpConstants.js index e8fd740bc..b8de0b61d 100644 --- a/packages/optimizer/lib/AmpConstants.js +++ b/packages/optimizer/lib/AmpConstants.js @@ -21,7 +21,8 @@ const AMP_STORY_DVH_POLYFILL_ATTR = 'amp-story-dvh-polyfill'; module.exports = { AMP_TAGS: ['amp', '⚡', '⚡4ads', 'amp4ads', '⚡4email', 'amp4email'], - AMP_CACHE_HOST: 'https://cdn.ampproject.org', + AMP_CACHE_HOSTS: ['https://cdn.ampproject.org', 'https://ampjs.org'], + DEFAULT_AMP_CACHE_HOST: 'https://cdn.ampproject.org', AMP_VALIDATION_RULES_URL: 'https://cdn.ampproject.org/v0/validator.json', AMP_FORMATS: ['AMP', 'AMP4EMAIL', 'AMP4ADS'], AMP_RUNTIME_CSS_PATH: '/v0.css', diff --git a/packages/optimizer/lib/RuntimeHostHelper.js b/packages/optimizer/lib/RuntimeHostHelper.js index 75e6998bc..96c18d4b9 100644 --- a/packages/optimizer/lib/RuntimeHostHelper.js +++ b/packages/optimizer/lib/RuntimeHostHelper.js @@ -15,10 +15,10 @@ */ 'use strict'; -const {AMP_CACHE_HOST, appendRuntimeVersion} = require('./AmpConstants.js'); +const {DEFAULT_AMP_CACHE_HOST, appendRuntimeVersion} = require('./AmpConstants.js'); function calculateHost({ - ampUrlPrefix = AMP_CACHE_HOST, + ampUrlPrefix = DEFAULT_AMP_CACHE_HOST, ampRuntimeVersion, lts = false, rtv = false, diff --git a/packages/optimizer/lib/extensionConfig.json b/packages/optimizer/lib/extensionConfig.json index ba0f78954..84dab49f7 100644 --- a/packages/optimizer/lib/extensionConfig.json +++ b/packages/optimizer/lib/extensionConfig.json @@ -1 +1 @@ -[{"name":"amp-3d-gltf","version":"0.1","latestVersion":"0.1"},{"name":"amp-3q-player","version":"0.1","latestVersion":"0.1"},{"name":"amp-access","version":"0.1","latestVersion":"0.1","options":{"hasCss":true}},{"name":"amp-access-fewcents","version":"0.1","latestVersion":"0.1","options":{"hasCss":true}},{"name":"amp-access-laterpay","version":["0.1","0.2"],"latestVersion":"0.2","options":{"hasCss":true}},{"name":"amp-access-poool","version":"0.1","latestVersion":"0.1"},{"name":"amp-access-scroll","version":"0.1","latestVersion":"0.1","options":{"hasCss":true}},{"name":"amp-accordion","version":"0.1","latestVersion":"0.1","options":{"hasCss":true}},{"name":"amp-accordion","version":"1.0","latestVersion":"0.1","options":{"hasCss":true}},{"name":"amp-action-macro","version":"0.1","latestVersion":"0.1"},{"name":"amp-ad","version":"0.1","latestVersion":"0.1","options":{"hasCss":true}},{"name":"amp-ad-custom","version":"0.1","latestVersion":"0.1"},{"name":"amp-ad-exit","version":"0.1","latestVersion":"0.1"},{"name":"amp-ad-network-adsense-impl","version":"0.1","latestVersion":"0.1"},{"name":"amp-ad-network-adzerk-impl","version":"0.1","latestVersion":"0.1"},{"name":"amp-ad-network-dianomi-impl","version":"0.1","latestVersion":"0.1"},{"name":"amp-ad-network-doubleclick-impl","version":"0.1","latestVersion":"0.1"},{"name":"amp-ad-network-fake-impl","version":"0.1","latestVersion":"0.1"},{"name":"amp-ad-network-mgid-impl","version":"0.1","latestVersion":"0.1"},{"name":"amp-ad-network-nws-impl","version":"0.1","latestVersion":"0.1"},{"name":"amp-ad-network-smartadserver-impl","version":"0.1","latestVersion":"0.1"},{"name":"amp-ad-network-valueimpression-impl","version":"0.1","latestVersion":"0.1"},{"name":"amp-addthis","version":"0.1","latestVersion":"0.1","options":{"hasCss":true}},{"name":"amp-analytics","version":"0.1","latestVersion":"0.1"},{"name":"amp-anim","version":"0.1","latestVersion":"0.1"},{"name":"amp-animation","version":"0.1","latestVersion":"0.1"},{"name":"amp-animation-polyfill","version":"0.1","latestVersion":"0.1"},{"name":"amp-apester-media","version":"0.1","latestVersion":"0.1","options":{"hasCss":true}},{"name":"amp-app-banner","version":"0.1","latestVersion":"0.1","options":{"hasCss":true}},{"name":"amp-app-banner","version":"1.0","options":{"hasCss":true}},{"name":"amp-audio","version":"0.1","latestVersion":"0.1"},{"name":"amp-audio","version":"1.0","latestVersion":"0.1","options":{}},{"name":"amp-auto-ads","version":"0.1","latestVersion":"0.1"},{"name":"amp-auto-lightbox","version":"0.1","latestVersion":"0.1"},{"name":"amp-autocomplete","version":"0.1","latestVersion":"0.1","options":{"hasCss":true}},{"name":"amp-base-carousel","version":"0.1","latestVersion":"0.1","options":{"hasCss":true}},{"name":"amp-base-carousel","version":"1.0","latestVersion":"0.1","options":{"hasCss":true}},{"name":"amp-beopinion","version":"0.1","latestVersion":"0.1"},{"name":"amp-bind","version":"0.1","latestVersion":"0.1"},{"name":"amp-bodymovin-animation","version":"0.1","latestVersion":"0.1"},{"name":"amp-brid-player","version":"0.1","latestVersion":"0.1"},{"name":"amp-brightcove","version":"0.1","latestVersion":"0.1"},{"name":"amp-brightcove","version":"1.0","latestVersion":"0.1","options":{"hasCss":true}},{"name":"amp-byside-content","version":"0.1","latestVersion":"0.1","options":{"hasCss":true}},{"name":"amp-cache-url","version":"0.1","latestVersion":"0.1"},{"name":"amp-call-tracking","version":"0.1","latestVersion":"0.1"},{"name":"amp-carousel","version":["0.1","0.2"],"latestVersion":"0.1","options":{"hasCss":true}},{"name":"amp-connatix-player","version":"0.1","latestVersion":"0.1"},{"name":"amp-consent","version":"0.1","latestVersion":"0.1","options":{"hasCss":true}},{"name":"amp-crypto-polyfill","version":"0.1","latestVersion":"0.1"},{"name":"amp-dailymotion","version":"0.1","latestVersion":"0.1"},{"name":"amp-dailymotion","version":"1.0","latestVersion":"0.1","options":{"hasCss":true}},{"name":"amp-date-countdown","version":"0.1","latestVersion":"0.1"},{"name":"amp-date-countdown","version":"1.0","latestVersion":"0.1","options":{"hasCss":true}},{"name":"amp-date-display","version":"0.1","latestVersion":"0.1"},{"name":"amp-date-display","version":"1.0","latestVersion":"0.1","options":{"hasCss":true}},{"name":"amp-date-picker","version":"0.1","latestVersion":"0.1","options":{"hasCss":true}},{"name":"amp-date-picker","version":"1.0","latestVersion":"0.1","options":{"hasCss":true}},{"name":"amp-delight-player","version":"0.1","latestVersion":"0.1","options":{"hasCss":true}},{"name":"amp-dynamic-css-classes","version":"0.1","latestVersion":"0.1"},{"name":"amp-embedly-card","version":"0.1","latestVersion":"0.1"},{"name":"amp-embedly-card","version":"1.0","latestVersion":"0.1","options":{"hasCss":true}},{"name":"amp-experiment","version":["0.1","1.0"],"latestVersion":"0.1"},{"name":"amp-facebook","version":"0.1","latestVersion":"0.1"},{"name":"amp-facebook","version":"1.0","latestVersion":"0.1","options":{"hasCss":true}},{"name":"amp-facebook-comments","version":"0.1","latestVersion":"0.1"},{"name":"amp-facebook-like","version":"0.1","latestVersion":"0.1"},{"name":"amp-facebook-page","version":"0.1","latestVersion":"0.1"},{"name":"amp-fit-text","version":"0.1","latestVersion":"0.1","options":{"hasCss":true}},{"name":"amp-fit-text","version":"1.0","latestVersion":"0.1","options":{"hasCss":true}},{"name":"amp-font","version":"0.1","latestVersion":"0.1"},{"name":"amp-form","version":"0.1","latestVersion":"0.1","options":{"hasCss":true}},{"name":"amp-fx-collection","version":"0.1","latestVersion":"0.1"},{"name":"amp-fx-flying-carpet","version":"0.1","latestVersion":"0.1","options":{"hasCss":true}},{"name":"amp-geo","version":"0.1","latestVersion":"0.1"},{"name":"amp-gfycat","version":"0.1","latestVersion":"0.1"},{"name":"amp-gist","version":"0.1","latestVersion":"0.1"},{"name":"amp-gist","version":"1.0","options":{"hasCss":true}},{"name":"amp-google-document-embed","version":"0.1","latestVersion":"0.1"},{"name":"amp-google-read-aloud-player","version":"0.1"},{"name":"amp-gwd-animation","version":"0.1","latestVersion":"0.1","options":{"hasCss":true}},{"name":"amp-hulu","version":"0.1","latestVersion":"0.1"},{"name":"amp-iframe","version":"0.1","latestVersion":"0.1"},{"name":"amp-iframe","version":"1.0","latestVersion":"0.1","options":{"hasCss":true}},{"name":"amp-iframely","version":"0.1","latestVersion":"0.1"},{"name":"amp-ima-video","version":"0.1","latestVersion":"0.1"},{"name":"amp-image-lightbox","version":"0.1","latestVersion":"0.1","options":{"hasCss":true}},{"name":"amp-image-slider","version":"0.1","latestVersion":"0.1","options":{"hasCss":true}},{"name":"amp-image-slider","version":"1.0","latestVersion":"0.1","options":{"hasCss":true}},{"name":"amp-image-viewer","version":"0.1","latestVersion":"0.1","options":{"hasCss":true}},{"name":"amp-imgur","version":"0.1","latestVersion":"0.1"},{"name":"amp-inline-gallery","version":"0.1","latestVersion":"0.1","options":{"hasCss":true}},{"name":"amp-inline-gallery","version":"1.0","latestVersion":"0.1","options":{"hasCss":true}},{"name":"amp-inputmask","version":"0.1","latestVersion":"0.1"},{"name":"amp-instagram","version":"0.1","latestVersion":"0.1","options":{"hasCss":true}},{"name":"amp-instagram","version":"1.0","latestVersion":"0.1","options":{"hasCss":true}},{"name":"amp-install-serviceworker","version":"0.1","latestVersion":"0.1"},{"name":"amp-intersection-observer-polyfill","version":"0.1","latestVersion":"0.1"},{"name":"amp-izlesene","version":"0.1","latestVersion":"0.1"},{"name":"amp-jwplayer","version":"0.1","latestVersion":"0.1"},{"name":"amp-jwplayer","version":"1.0","latestVersion":"0.1","options":{"hasCss":true}},{"name":"amp-kaltura-player","version":"0.1","latestVersion":"0.1"},{"name":"amp-lightbox","version":"0.1","latestVersion":"0.1","options":{"hasCss":true}},{"name":"amp-lightbox","version":"1.0","latestVersion":"0.1","options":{"hasCss":true}},{"name":"amp-lightbox-gallery","version":"0.1","latestVersion":"0.1","options":{"hasCss":true}},{"name":"amp-lightbox-gallery","version":"1.0","latestVersion":"0.1","options":{"hasCss":true}},{"name":"amp-link-rewriter","version":"0.1","latestVersion":"0.1"},{"name":"amp-list","version":"0.1","latestVersion":"0.1","options":{"hasCss":true}},{"name":"amp-list","version":"1.0","options":{"hasCss":false}},{"name":"amp-live-list","version":"0.1","latestVersion":"0.1","options":{"hasCss":true}},{"name":"amp-loader","version":"0.1","latestVersion":"0.1","options":{"hasCss":true}},{"name":"amp-mathml","version":"0.1","latestVersion":"0.1","options":{"hasCss":true}},{"name":"amp-mathml","version":"1.0","latestVersion":"0.1","options":{"hasCss":true}},{"name":"amp-mega-menu","version":"0.1","latestVersion":"0.1","options":{"hasCss":true}},{"name":"amp-megaphone","version":"0.1","latestVersion":"0.1"},{"name":"amp-minute-media-player","version":"0.1","latestVersion":"0.1"},{"name":"amp-mowplayer","version":"0.1","latestVersion":"0.1"},{"name":"amp-mraid","version":"0.1","latestVersion":"0.1"},{"name":"amp-mustache","version":["0.1","0.2"],"latestVersion":"0.2"},{"name":"amp-nested-menu","version":"0.1","latestVersion":"0.1","options":{"hasCss":true}},{"name":"amp-next-page","version":["0.1","1.0"],"latestVersion":"1.0","options":{"hasCss":true}},{"name":"amp-nexxtv-player","version":"0.1","latestVersion":"0.1"},{"name":"amp-o2-player","version":"0.1","latestVersion":"0.1"},{"name":"amp-onetap-google","version":"0.1","latestVersion":"0.1","options":{"hasCss":true}},{"name":"amp-ooyala-player","version":"0.1","latestVersion":"0.1"},{"name":"amp-orientation-observer","version":"0.1","latestVersion":"0.1"},{"name":"amp-pan-zoom","version":"0.1","latestVersion":"0.1","options":{"hasCss":true}},{"name":"amp-pan-zoom","version":"1.0","options":{"hasCss":true}},{"name":"amp-pinterest","version":"0.1","latestVersion":"0.1","options":{"hasCss":true}},{"name":"amp-playbuzz","version":"0.1","latestVersion":"0.1","options":{"hasCss":true}},{"name":"amp-position-observer","version":"0.1","latestVersion":"0.1"},{"name":"amp-powr-player","version":"0.1","latestVersion":"0.1"},{"name":"amp-reach-player","version":"0.1","latestVersion":"0.1"},{"name":"amp-recaptcha-input","version":"0.1","latestVersion":"0.1","options":{"hasCss":true}},{"name":"amp-reddit","version":"0.1","latestVersion":"0.1"},{"name":"amp-render","version":"1.0","latestVersion":"1.0"},{"name":"amp-resize-observer-polyfill","version":"0.1","latestVersion":"0.1"},{"name":"amp-riddle-quiz","version":"0.1","latestVersion":"0.1"},{"name":"amp-script","version":"0.1","latestVersion":"0.1","options":{"hasCss":true}},{"name":"amp-selector","version":"0.1","latestVersion":"0.1","options":{"hasCss":true}},{"name":"amp-selector","version":"1.0","latestVersion":"0.1","options":{"hasCss":true}},{"name":"amp-shadow-dom-polyfill","version":"0.1","latestVersion":"0.1","options":{"wrapper":"none"}},{"name":"amp-sidebar","version":["0.1","0.2"],"latestVersion":"0.1","options":{"hasCss":true}},{"name":"amp-sidebar","version":"1.0","latestVersion":"0.1","options":{"hasCss":true}},{"name":"amp-skimlinks","version":"0.1","latestVersion":"0.1"},{"// 1":"`amp-slides` is deprecated","// 2":"Please use `` instead.","name":"amp-slides","version":"0.1","latestVersion":"0.1"},{"name":"amp-slikeplayer","version":"0.1","latestVersion":"0.1"},{"name":"amp-smartlinks","version":"0.1","latestVersion":"0.1"},{"name":"amp-social-share","version":"0.1","latestVersion":"0.1","options":{"hasCss":true}},{"name":"amp-social-share","version":"1.0","latestVersion":"0.1","options":{"hasCss":true}},{"name":"amp-soundcloud","version":"0.1","latestVersion":"0.1"},{"name":"amp-soundcloud","version":"1.0","latestVersion":"0.1","options":{"hasCss":true}},{"name":"amp-springboard-player","version":"0.1","latestVersion":"0.1"},{"name":"amp-standalone","version":"0.1","latestVersion":"0.1"},{"name":"amp-sticky-ad","version":"1.0","latestVersion":"1.0","options":{"hasCss":true}},{"name":"amp-story","version":"1.0","latestVersion":"1.0","options":{"hasCss":true}},{"name":"amp-story","version":"1.0","latestVersion":"1.0","options":{"hasCss":false,"additionalSuffix":"ssr-css","ssrCss":true}},{"name":"amp-story-360","version":"0.1","latestVersion":"0.1","options":{"hasCss":true}},{"name":"amp-story-audio-sticker","version":"0.1","options":{"hasCss":true}},{"name":"amp-story-auto-ads","version":"0.1","latestVersion":"0.1","options":{"hasCss":true}},{"name":"amp-story-auto-analytics","version":"0.1","latestVersion":"0.1"},{"name":"amp-story-captions","version":"0.1","latestVersion":"0.1","options":{"hasCss":true}},{"name":"amp-story-dev-tools","version":"0.1","latestVersion":"0.1","options":{"hasCss":true}},{"name":"amp-story-education","version":"0.1","latestVersion":"0.1","options":{"hasCss":true}},{"name":"amp-story-interactive","version":"0.1","latestVersion":"0.1","options":{"hasCss":true}},{"name":"amp-story-page-attachment","version":"0.1","options":{"hasCss":true}},{"name":"amp-story-panning-media","version":"0.1","latestVersion":"0.1","options":{"hasCss":true}},{"name":"amp-story-player","version":"0.1","latestVersion":"0.1","options":{"hasCss":true}},{"name":"amp-story-share-menu","version":"0.1","latestVersion":"0.1","options":{"hasCss":true}},{"name":"amp-story-shopping","version":"0.1","latestVersion":"0.1","options":{"hasCss":true}},{"name":"amp-story-subscriptions","version":"0.1","options":{"hasCss":true}},{"name":"amp-stream-gallery","version":"0.1","latestVersion":"0.1","options":{"hasCss":true}},{"name":"amp-stream-gallery","version":"1.0","latestVersion":"0.1","options":{"hasCss":true}},{"name":"amp-subscriptions","version":"0.1","latestVersion":"0.1","options":{"hasCss":true}},{"name":"amp-subscriptions-google","version":"0.1","latestVersion":"0.1","options":{"hasCss":true}},{"name":"amp-tiktok","version":"0.1","latestVersion":"0.1","options":{"hasCss":true}},{"name":"amp-timeago","version":"0.1","latestVersion":"0.1"},{"name":"amp-timeago","version":"1.0","latestVersion":"0.1","options":{"hasCss":true}},{"name":"amp-truncate-text","version":"0.1","latestVersion":"0.1","options":{"hasCss":true}},{"name":"amp-twitter","version":"0.1","latestVersion":"0.1"},{"name":"amp-twitter","version":"1.0","latestVersion":"0.1","options":{"hasCss":true}},{"name":"amp-user-notification","version":"0.1","latestVersion":"0.1","options":{"hasCss":true}},{"name":"amp-video","version":"0.1","latestVersion":"0.1"},{"name":"amp-video","version":"1.0","latestVersion":"0.1","options":{"hasCss":true}},{"name":"amp-video-docking","version":"0.1","latestVersion":"0.1","options":{"hasCss":true}},{"name":"amp-video-iframe","version":"0.1","latestVersion":"0.1"},{"name":"amp-video-iframe","version":"1.0","latestVersion":"0.1","options":{"hasCss":true}},{"name":"amp-viewer-integration","version":"0.1","latestVersion":"0.1","options":{"// 1":"The viewer integration code needs to run asap, so that viewers","// 2":"can influence document state asap. Otherwise the document may ","// 3":"take a long time to learn that it should start process other","// 4":"extensions faster.","loadPriority":"high"}},{"name":"amp-vimeo","version":"0.1","latestVersion":"0.1"},{"name":"amp-vimeo","version":"1.0","latestVersion":"0.1","options":{"hasCss":true}},{"name":"amp-vine","version":"0.1","latestVersion":"0.1"},{"name":"amp-viqeo-player","version":"0.1","latestVersion":"0.1"},{"name":"amp-vk","version":"0.1","latestVersion":"0.1"},{"name":"amp-web-push","version":"0.1","latestVersion":"0.1","options":{"hasCss":true}},{"name":"amp-wistia-player","version":"0.1","latestVersion":"0.1"},{"name":"amp-wordpress-embed","version":"1.0","latestVersion":"1.0","options":{"hasCss":true}},{"name":"amp-yotpo","version":"0.1","latestVersion":"0.1"},{"name":"amp-youtube","version":"0.1","latestVersion":"0.1"},{"name":"amp-youtube","version":"1.0","latestVersion":"0.1","options":{"hasCss":true}}] \ No newline at end of file +[{"name":"amp-3d-gltf","version":"0.1","latestVersion":"0.1"},{"name":"amp-3q-player","version":"0.1","latestVersion":"0.1"},{"name":"amp-access","version":"0.1","latestVersion":"0.1","options":{"hasCss":true}},{"name":"amp-access-fewcents","version":"0.1","latestVersion":"0.1","options":{"hasCss":true}},{"name":"amp-access-laterpay","version":["0.1","0.2"],"latestVersion":"0.2","options":{"hasCss":true}},{"name":"amp-access-poool","version":"0.1","latestVersion":"0.1"},{"name":"amp-access-scroll","version":"0.1","latestVersion":"0.1","options":{"hasCss":true}},{"name":"amp-accordion","version":"0.1","latestVersion":"0.1","options":{"hasCss":true}},{"name":"amp-accordion","version":"1.0","latestVersion":"0.1","options":{"hasCss":true}},{"name":"amp-action-macro","version":"0.1","latestVersion":"0.1"},{"name":"amp-ad","version":"0.1","latestVersion":"0.1","options":{"hasCss":true}},{"name":"amp-ad-custom","version":"0.1","latestVersion":"0.1"},{"name":"amp-ad-exit","version":"0.1","latestVersion":"0.1"},{"name":"amp-ad-network-adsense-impl","version":"0.1","latestVersion":"0.1"},{"name":"amp-ad-network-adzerk-impl","version":"0.1","latestVersion":"0.1"},{"name":"amp-ad-network-dianomi-impl","version":"0.1","latestVersion":"0.1"},{"name":"amp-ad-network-doubleclick-impl","version":"0.1","latestVersion":"0.1"},{"name":"amp-ad-network-fake-impl","version":"0.1","latestVersion":"0.1"},{"name":"amp-ad-network-mgid-impl","version":"0.1","latestVersion":"0.1"},{"name":"amp-ad-network-nws-impl","version":"0.1","latestVersion":"0.1"},{"name":"amp-ad-network-smartadserver-impl","version":"0.1","latestVersion":"0.1"},{"name":"amp-ad-network-valueimpression-impl","version":"0.1","latestVersion":"0.1"},{"name":"amp-addthis","version":"0.1","latestVersion":"0.1","options":{"hasCss":true}},{"name":"amp-analytics","version":"0.1","latestVersion":"0.1"},{"name":"amp-anim","version":"0.1","latestVersion":"0.1"},{"name":"amp-animation","version":"0.1","latestVersion":"0.1"},{"name":"amp-animation-polyfill","version":"0.1","latestVersion":"0.1"},{"name":"amp-apester-media","version":"0.1","latestVersion":"0.1","options":{"hasCss":true}},{"name":"amp-app-banner","version":"0.1","latestVersion":"0.1","options":{"hasCss":true}},{"name":"amp-app-banner","version":"1.0","options":{"hasCss":true}},{"name":"amp-audio","version":"0.1","latestVersion":"0.1"},{"name":"amp-audio","version":"1.0","latestVersion":"0.1","options":{}},{"name":"amp-auto-ads","version":"0.1","latestVersion":"0.1"},{"name":"amp-auto-lightbox","version":"0.1","latestVersion":"0.1"},{"name":"amp-autocomplete","version":"0.1","latestVersion":"0.1","options":{"hasCss":true}},{"name":"amp-base-carousel","version":"0.1","latestVersion":"0.1","options":{"hasCss":true}},{"name":"amp-base-carousel","version":"1.0","latestVersion":"0.1","options":{"hasCss":true}},{"name":"amp-beopinion","version":"0.1","latestVersion":"0.1"},{"name":"amp-bind","version":"0.1","latestVersion":"0.1"},{"name":"amp-bodymovin-animation","version":"0.1","latestVersion":"0.1"},{"name":"amp-brid-player","version":"0.1","latestVersion":"0.1"},{"name":"amp-brightcove","version":"0.1","latestVersion":"0.1"},{"name":"amp-brightcove","version":"1.0","latestVersion":"0.1","options":{"hasCss":true}},{"name":"amp-byside-content","version":"0.1","latestVersion":"0.1","options":{"hasCss":true}},{"name":"amp-cache-url","version":"0.1","latestVersion":"0.1"},{"name":"amp-call-tracking","version":"0.1","latestVersion":"0.1"},{"name":"amp-carousel","version":["0.1","0.2"],"latestVersion":"0.1","options":{"hasCss":true}},{"name":"amp-connatix-player","version":"0.1","latestVersion":"0.1"},{"name":"amp-consent","version":"0.1","latestVersion":"0.1","options":{"hasCss":true}},{"name":"amp-crypto-polyfill","version":"0.1","latestVersion":"0.1"},{"name":"amp-dailymotion","version":"0.1","latestVersion":"0.1"},{"name":"amp-dailymotion","version":"1.0","latestVersion":"0.1","options":{"hasCss":true}},{"name":"amp-date-countdown","version":"0.1","latestVersion":"0.1"},{"name":"amp-date-countdown","version":"1.0","latestVersion":"0.1","options":{"hasCss":true}},{"name":"amp-date-display","version":"0.1","latestVersion":"0.1"},{"name":"amp-date-display","version":"1.0","latestVersion":"0.1","options":{"hasCss":true}},{"name":"amp-date-picker","version":"0.1","latestVersion":"0.1","options":{"hasCss":true}},{"name":"amp-date-picker","version":"1.0","latestVersion":"0.1","options":{"hasCss":true}},{"name":"amp-delight-player","version":"0.1","latestVersion":"0.1","options":{"hasCss":true}},{"name":"amp-dynamic-css-classes","version":"0.1","latestVersion":"0.1"},{"name":"amp-embedly-card","version":"0.1","latestVersion":"0.1"},{"name":"amp-embedly-card","version":"1.0","latestVersion":"0.1","options":{"hasCss":true}},{"name":"amp-experiment","version":["0.1","1.0"],"latestVersion":"0.1"},{"name":"amp-facebook","version":"0.1","latestVersion":"0.1"},{"name":"amp-facebook","version":"1.0","latestVersion":"0.1","options":{"hasCss":true}},{"name":"amp-facebook-comments","version":"0.1","latestVersion":"0.1"},{"name":"amp-facebook-like","version":"0.1","latestVersion":"0.1"},{"name":"amp-facebook-page","version":"0.1","latestVersion":"0.1"},{"name":"amp-fit-text","version":"0.1","latestVersion":"0.1","options":{"hasCss":true}},{"name":"amp-fit-text","version":"1.0","latestVersion":"0.1","options":{"hasCss":true}},{"name":"amp-font","version":"0.1","latestVersion":"0.1"},{"name":"amp-form","version":"0.1","latestVersion":"0.1","options":{"hasCss":true}},{"name":"amp-fx-collection","version":"0.1","latestVersion":"0.1"},{"name":"amp-fx-flying-carpet","version":"0.1","latestVersion":"0.1","options":{"hasCss":true}},{"name":"amp-geo","version":"0.1","latestVersion":"0.1"},{"name":"amp-gfycat","version":"0.1","latestVersion":"0.1"},{"name":"amp-gist","version":"0.1","latestVersion":"0.1"},{"name":"amp-gist","version":"1.0","options":{"hasCss":true}},{"name":"amp-google-document-embed","version":"0.1","latestVersion":"0.1"},{"name":"amp-google-read-aloud-player","version":"0.1"},{"name":"amp-gwd-animation","version":"0.1","latestVersion":"0.1","options":{"hasCss":true}},{"name":"amp-hulu","version":"0.1","latestVersion":"0.1"},{"name":"amp-iframe","version":"0.1","latestVersion":"0.1"},{"name":"amp-iframe","version":"1.0","latestVersion":"0.1","options":{"hasCss":true}},{"name":"amp-iframely","version":"0.1","latestVersion":"0.1"},{"name":"amp-ima-video","version":"0.1","latestVersion":"0.1"},{"name":"amp-image-lightbox","version":"0.1","latestVersion":"0.1","options":{"hasCss":true}},{"name":"amp-image-slider","version":"0.1","latestVersion":"0.1","options":{"hasCss":true}},{"name":"amp-image-slider","version":"1.0","latestVersion":"0.1","options":{"hasCss":true}},{"name":"amp-image-viewer","version":"0.1","latestVersion":"0.1","options":{"hasCss":true}},{"name":"amp-imgur","version":"0.1","latestVersion":"0.1"},{"name":"amp-inline-gallery","version":"0.1","latestVersion":"0.1","options":{"hasCss":true}},{"name":"amp-inline-gallery","version":"1.0","latestVersion":"0.1","options":{"hasCss":true}},{"name":"amp-inputmask","version":"0.1","latestVersion":"0.1"},{"name":"amp-instagram","version":"0.1","latestVersion":"0.1","options":{"hasCss":true}},{"name":"amp-instagram","version":"1.0","latestVersion":"0.1","options":{"hasCss":true}},{"name":"amp-install-serviceworker","version":"0.1","latestVersion":"0.1"},{"name":"amp-intersection-observer-polyfill","version":"0.1","latestVersion":"0.1"},{"name":"amp-izlesene","version":"0.1","latestVersion":"0.1"},{"name":"amp-jwplayer","version":"0.1","latestVersion":"0.1"},{"name":"amp-jwplayer","version":"1.0","latestVersion":"0.1","options":{"hasCss":true}},{"name":"amp-kaltura-player","version":"0.1","latestVersion":"0.1"},{"name":"amp-lightbox","version":"0.1","latestVersion":"0.1","options":{"hasCss":true}},{"name":"amp-lightbox","version":"1.0","latestVersion":"0.1","options":{"hasCss":true}},{"name":"amp-lightbox-gallery","version":"0.1","latestVersion":"0.1","options":{"hasCss":true}},{"name":"amp-lightbox-gallery","version":"1.0","latestVersion":"0.1","options":{"hasCss":true}},{"name":"amp-link-rewriter","version":"0.1","latestVersion":"0.1"},{"name":"amp-list","version":"0.1","latestVersion":"0.1","options":{"hasCss":true}},{"name":"amp-list","version":"1.0","options":{"hasCss":false}},{"name":"amp-live-list","version":"0.1","latestVersion":"0.1","options":{"hasCss":true}},{"name":"amp-loader","version":"0.1","latestVersion":"0.1","options":{"hasCss":true}},{"name":"amp-mathml","version":"0.1","latestVersion":"0.1","options":{"hasCss":true}},{"name":"amp-mathml","version":"1.0","latestVersion":"0.1","options":{"hasCss":true}},{"name":"amp-mega-menu","version":"0.1","latestVersion":"0.1","options":{"hasCss":true}},{"name":"amp-megaphone","version":"0.1","latestVersion":"0.1"},{"name":"amp-minute-media-player","version":"0.1","latestVersion":"0.1"},{"name":"amp-mowplayer","version":"0.1","latestVersion":"0.1"},{"name":"amp-mraid","version":"0.1","latestVersion":"0.1"},{"name":"amp-mustache","version":["0.1","0.2"],"latestVersion":"0.2"},{"name":"amp-nested-menu","version":"0.1","latestVersion":"0.1","options":{"hasCss":true}},{"name":"amp-next-page","version":["0.1","1.0"],"latestVersion":"1.0","options":{"hasCss":true}},{"name":"amp-nexxtv-player","version":"0.1","latestVersion":"0.1"},{"name":"amp-o2-player","version":"0.1","latestVersion":"0.1"},{"name":"amp-onetap-google","version":"0.1","latestVersion":"0.1","options":{"hasCss":true}},{"name":"amp-ooyala-player","version":"0.1","latestVersion":"0.1"},{"name":"amp-orientation-observer","version":"0.1","latestVersion":"0.1"},{"name":"amp-pan-zoom","version":"0.1","latestVersion":"0.1","options":{"hasCss":true}},{"name":"amp-pan-zoom","version":"1.0","options":{"hasCss":true}},{"name":"amp-pinterest","version":"0.1","latestVersion":"0.1","options":{"hasCss":true}},{"name":"amp-playbuzz","version":"0.1","latestVersion":"0.1","options":{"hasCss":true}},{"name":"amp-position-observer","version":"0.1","latestVersion":"0.1"},{"name":"amp-powr-player","version":"0.1","latestVersion":"0.1"},{"name":"amp-reach-player","version":"0.1","latestVersion":"0.1"},{"name":"amp-recaptcha-input","version":"0.1","latestVersion":"0.1","options":{"hasCss":true}},{"name":"amp-reddit","version":"0.1","latestVersion":"0.1"},{"name":"amp-render","version":"1.0","latestVersion":"1.0"},{"name":"amp-resize-observer-polyfill","version":"0.1","latestVersion":"0.1"},{"name":"amp-riddle-quiz","version":"0.1","latestVersion":"0.1"},{"name":"amp-script","version":"0.1","latestVersion":"0.1","options":{"hasCss":true}},{"name":"amp-selector","version":"0.1","latestVersion":"0.1","options":{"hasCss":true}},{"name":"amp-selector","version":"1.0","latestVersion":"0.1","options":{"hasCss":true}},{"name":"amp-shadow-dom-polyfill","version":"0.1","latestVersion":"0.1","options":{"wrapper":"none"}},{"name":"amp-sidebar","version":["0.1","0.2"],"latestVersion":"0.1","options":{"hasCss":true}},{"name":"amp-sidebar","version":"1.0","latestVersion":"0.1","options":{"hasCss":true}},{"name":"amp-skimlinks","version":"0.1","latestVersion":"0.1"},{"// 1":"`amp-slides` is deprecated","// 2":"Please use `` instead.","name":"amp-slides","version":"0.1","latestVersion":"0.1"},{"name":"amp-slikeplayer","version":"0.1","latestVersion":"0.1"},{"name":"amp-smartlinks","version":"0.1","latestVersion":"0.1"},{"name":"amp-social-share","version":"0.1","latestVersion":"0.1","options":{"hasCss":true}},{"name":"amp-social-share","version":"1.0","latestVersion":"0.1","options":{"hasCss":true}},{"name":"amp-soundcloud","version":"0.1","latestVersion":"0.1"},{"name":"amp-soundcloud","version":"1.0","latestVersion":"0.1","options":{"hasCss":true}},{"name":"amp-springboard-player","version":"0.1","latestVersion":"0.1"},{"name":"amp-standalone","version":"0.1","latestVersion":"0.1"},{"name":"amp-sticky-ad","version":"1.0","latestVersion":"1.0","options":{"hasCss":true}},{"name":"amp-story","version":"1.0","latestVersion":"1.0","options":{"hasCss":true}},{"name":"amp-story","version":"1.0","latestVersion":"1.0","options":{"hasCss":false,"additionalSuffix":"ssr-css","ssrCss":true}},{"name":"amp-story-360","version":"0.1","latestVersion":"0.1","options":{"hasCss":true}},{"name":"amp-story-audio-sticker","version":"0.1","latestVersion":"0.1","options":{"hasCss":true}},{"name":"amp-story-auto-ads","version":"0.1","latestVersion":"0.1","options":{"hasCss":true}},{"name":"amp-story-auto-analytics","version":"0.1","latestVersion":"0.1"},{"name":"amp-story-captions","version":"0.1","latestVersion":"0.1","options":{"hasCss":true}},{"name":"amp-story-dev-tools","version":"0.1","latestVersion":"0.1","options":{"hasCss":true}},{"name":"amp-story-education","version":"0.1","latestVersion":"0.1","options":{"hasCss":true}},{"name":"amp-story-interactive","version":"0.1","latestVersion":"0.1","options":{"hasCss":true}},{"name":"amp-story-page-attachment","version":"0.1","options":{"hasCss":true}},{"name":"amp-story-panning-media","version":"0.1","latestVersion":"0.1","options":{"hasCss":true}},{"name":"amp-story-player","version":"0.1","latestVersion":"0.1","options":{"hasCss":true}},{"name":"amp-story-share-menu","version":"0.1","latestVersion":"0.1","options":{"hasCss":true}},{"name":"amp-story-shopping","version":"0.1","latestVersion":"0.1","options":{"hasCss":true}},{"name":"amp-story-subscriptions","version":"0.1","options":{"hasCss":true}},{"name":"amp-stream-gallery","version":"0.1","latestVersion":"0.1","options":{"hasCss":true}},{"name":"amp-stream-gallery","version":"1.0","latestVersion":"0.1","options":{"hasCss":true}},{"name":"amp-subscriptions","version":"0.1","latestVersion":"0.1","options":{"hasCss":true}},{"name":"amp-subscriptions-google","version":"0.1","latestVersion":"0.1","options":{"hasCss":true}},{"name":"amp-tiktok","version":"0.1","latestVersion":"0.1","options":{"hasCss":true}},{"name":"amp-timeago","version":"0.1","latestVersion":"0.1"},{"name":"amp-timeago","version":"1.0","latestVersion":"0.1","options":{"hasCss":true}},{"name":"amp-truncate-text","version":"0.1","latestVersion":"0.1","options":{"hasCss":true}},{"name":"amp-twitter","version":"0.1","latestVersion":"0.1"},{"name":"amp-twitter","version":"1.0","latestVersion":"0.1","options":{"hasCss":true}},{"name":"amp-user-notification","version":"0.1","latestVersion":"0.1","options":{"hasCss":true}},{"name":"amp-video","version":"0.1","latestVersion":"0.1"},{"name":"amp-video","version":"1.0","latestVersion":"0.1","options":{"hasCss":true}},{"name":"amp-video-docking","version":"0.1","latestVersion":"0.1","options":{"hasCss":true}},{"name":"amp-video-iframe","version":"0.1","latestVersion":"0.1"},{"name":"amp-video-iframe","version":"1.0","latestVersion":"0.1","options":{"hasCss":true}},{"name":"amp-viewer-integration","version":"0.1","latestVersion":"0.1","options":{"// 1":"The viewer integration code needs to run asap, so that viewers","// 2":"can influence document state asap. Otherwise the document may ","// 3":"take a long time to learn that it should start process other","// 4":"extensions faster.","loadPriority":"high"}},{"name":"amp-vimeo","version":"0.1","latestVersion":"0.1"},{"name":"amp-vimeo","version":"1.0","latestVersion":"0.1","options":{"hasCss":true}},{"name":"amp-vine","version":"0.1","latestVersion":"0.1"},{"name":"amp-viqeo-player","version":"0.1","latestVersion":"0.1"},{"name":"amp-vk","version":"0.1","latestVersion":"0.1"},{"name":"amp-web-push","version":"0.1","latestVersion":"0.1","options":{"hasCss":true}},{"name":"amp-wistia-player","version":"0.1","latestVersion":"0.1"},{"name":"amp-wordpress-embed","version":"1.0","latestVersion":"1.0","options":{"hasCss":true}},{"name":"amp-yotpo","version":"0.1","latestVersion":"0.1"},{"name":"amp-youtube","version":"0.1","latestVersion":"0.1"},{"name":"amp-youtube","version":"1.0","latestVersion":"0.1","options":{"hasCss":true}}] \ No newline at end of file diff --git a/packages/optimizer/lib/fetchRuntimeParameters.js b/packages/optimizer/lib/fetchRuntimeParameters.js index 770fecbbf..b99b8c1ff 100644 --- a/packages/optimizer/lib/fetchRuntimeParameters.js +++ b/packages/optimizer/lib/fetchRuntimeParameters.js @@ -29,10 +29,11 @@ try { } const { - AMP_CACHE_HOST, + AMP_CACHE_HOSTS, AMP_RUNTIME_CSS_PATH, AMP_VALIDATION_RULES_URL, appendRuntimeVersion, + DEFAULT_AMP_CACHE_HOST, } = require('./AmpConstants.js'); const KEY_VALIDATOR_RULES = 'validator-rules'; @@ -214,12 +215,12 @@ async function fetchLatestRuntimeData_({config, ampUrlPrefix, lts}, versionKey = version: await config.runtimeVersion.currentVersion({ampUrlPrefix, lts}), maxAge: MaxAge.create(AMP_RUNTIME_MAX_AGE).toObject(), }; - if (!ampRuntimeData.version && ampUrlPrefix && ampUrlPrefix !== AMP_CACHE_HOST) { + if (!ampRuntimeData.version && ampUrlPrefix && !AMP_CACHE_HOSTS.includes(ampUrlPrefix)) { config.log.error( - `Could not download runtime version from ${ampUrlPrefix}. Falling back to ${AMP_CACHE_HOST}` + `Could not download runtime version from ${ampUrlPrefix}. Falling back to ${DEFAULT_AMP_CACHE_HOST}` ); ampRuntimeData = await fetchLatestRuntimeData_( - {config, ampUrlPrefix: AMP_CACHE_HOST, lts}, + {config, ampUrlPrefix: DEFAULT_AMP_CACHE_HOST, lts}, versionKey ); } else if (!ampRuntimeData.version) { @@ -240,15 +241,16 @@ async function fetchLatestRuntimeData_({config, ampUrlPrefix, lts}, versionKey = async function fetchAmpRuntimeStyles_(config, ampUrlPrefix, ampRuntimeVersion) { if (ampUrlPrefix && !isAbsoluteUrl_(ampUrlPrefix)) { config.log.warn( - `AMP runtime styles cannot be fetched from relative ampUrlPrefix, please use the 'ampRuntimeStyles' parameter to provide the correct runtime style. Falling back to latest v0.css on ${AMP_CACHE_HOST}` + `AMP runtime styles cannot be fetched from relative ampUrlPrefix, please use the 'ampRuntimeStyles' parameter to provide the correct runtime style. Falling back to latest v0.css on ${DEFAULT_AMP_CACHE_HOST}` ); // Gracefully fallback to latest runtime version - ampUrlPrefix = AMP_CACHE_HOST; + ampUrlPrefix = DEFAULT_AMP_CACHE_HOST; ampRuntimeVersion = ampRuntimeVersion || (await config.runtimeVersion.currentVersion()); } // Construct the AMP runtime CSS download URL, the default is: https://cdn.ampproject.org/rtv/${ampRuntimeVersion}/v0.css const runtimeCssUrl = - appendRuntimeVersion(ampUrlPrefix || AMP_CACHE_HOST, ampRuntimeVersion) + AMP_RUNTIME_CSS_PATH; + appendRuntimeVersion(ampUrlPrefix || DEFAULT_AMP_CACHE_HOST, ampRuntimeVersion) + + AMP_RUNTIME_CSS_PATH; // Fetch runtime styles const styles = await downloadAmpRuntimeStyles_(config, runtimeCssUrl); if (!styles) { @@ -257,7 +259,7 @@ async function fetchAmpRuntimeStyles_(config, ampUrlPrefix, ampRuntimeVersion) { // Try to download latest from cdn.ampproject.org instead return fetchAmpRuntimeStyles_( config, - AMP_CACHE_HOST, + DEFAULT_AMP_CACHE_HOST, await config.runtimeVersion.currentVersion() ); } else { diff --git a/packages/optimizer/lib/transformers/AddMandatoryTags.js b/packages/optimizer/lib/transformers/AddMandatoryTags.js index 372115030..e493f3441 100644 --- a/packages/optimizer/lib/transformers/AddMandatoryTags.js +++ b/packages/optimizer/lib/transformers/AddMandatoryTags.js @@ -24,117 +24,11 @@ const { createElement, firstChildByTag, } = require('../NodeUtils'); -const {AMP_FORMATS, AMP_TAGS} = require('../AmpConstants'); +const {AMP_FORMATS, AMP_TAGS, DEFAULT_AMP_CACHE_HOST} = require('../AmpConstants'); const DEFAULT_FORMAT = 'AMP'; const AUTO_GENERATED_MARKER = 'data-auto'; -const BOILERPLATES = { - AMP: [ - { - matcher: { - tagName: 'meta', - attribs: { - charset: 'utf-8', - }, - }, - node: { - tagName: 'meta', - attribs: { - charset: 'utf-8', - }, - }, - }, - { - matcher: { - tagName: 'meta', - attribs: { - name: 'viewport', - }, - }, - node: { - tagName: 'meta', - attribs: { - name: 'viewport', - content: 'width=device-width,minimum-scale=1,initial-scale=1', - }, - }, - }, - { - matcher: { - tagName: 'noscript', - }, - node: { - tagName: 'noscript', - children: [ - { - tagName: 'style', - attribs: { - 'amp-boilerplate': '', - }, - // eslint-disable-next-line max-len - text: - 'body{-webkit-animation:none;-moz-animation:none;-ms-animation:none;animation:none}', - }, - ], - }, - }, - { - matcher: { - tagName: 'style', - attribs: { - 'amp-boilerplate': '', - }, - }, - node: { - tagName: 'style', - attribs: { - 'amp-boilerplate': '', - }, - // eslint-disable-next-line max-len - text: - '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}}', - }, - }, - { - matcher: { - tagName: 'script', - attribs: { - src: /^https:\/\/.+\/v0\.js$/, - }, - }, - node: { - tagName: 'script', - attribs: { - async: '', - src: 'https://cdn.ampproject.org/v0.js', - }, - }, - }, - { - matcher: { - tagName: 'link', - attribs: { - rel: 'canonical', - }, - }, - node: { - tagName: 'link', - attribs: { - rel: 'canonical', - href: (params, log) => { - if (!params.canonical) { - log.warn('No canonical param is given. Setting canonical href to `.`'); - params.canonical = '.'; - } - return params.canonical; - }, - }, - }, - }, - ], -}; - /** * AddMandatoryTags - this transformer will automatically add all missing tags required by a valid AMP document. * @@ -164,8 +58,114 @@ class AddMandatoryTags { return; } + const boilerplates = { + AMP: [ + { + matcher: { + tagName: 'meta', + attribs: { + charset: 'utf-8', + }, + }, + node: { + tagName: 'meta', + attribs: { + charset: 'utf-8', + }, + }, + }, + { + matcher: { + tagName: 'meta', + attribs: { + name: 'viewport', + }, + }, + node: { + tagName: 'meta', + attribs: { + name: 'viewport', + content: 'width=device-width,minimum-scale=1,initial-scale=1', + }, + }, + }, + { + matcher: { + tagName: 'noscript', + }, + node: { + tagName: 'noscript', + children: [ + { + tagName: 'style', + attribs: { + 'amp-boilerplate': '', + }, + // eslint-disable-next-line max-len + text: + 'body{-webkit-animation:none;-moz-animation:none;-ms-animation:none;animation:none}', + }, + ], + }, + }, + { + matcher: { + tagName: 'style', + attribs: { + 'amp-boilerplate': '', + }, + }, + node: { + tagName: 'style', + attribs: { + 'amp-boilerplate': '', + }, + // eslint-disable-next-line max-len + text: + '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}}', + }, + }, + { + matcher: { + tagName: 'script', + attribs: { + src: /^https:\/\/.+\/v0\.js$/, + }, + }, + node: { + tagName: 'script', + attribs: { + async: '', + src: (params.ampUrlPrefix || DEFAULT_AMP_CACHE_HOST) + '/v0.js', + }, + }, + }, + { + matcher: { + tagName: 'link', + attribs: { + rel: 'canonical', + }, + }, + node: { + tagName: 'link', + attribs: { + rel: 'canonical', + href: (params, log) => { + if (!params.canonical) { + log.warn('No canonical param is given. Setting canonical href to `.`'); + params.canonical = '.'; + } + return params.canonical; + }, + }, + }, + }, + ], + }; + // Only supports AMP for websites - const boilerplateSpec = BOILERPLATES[this.format]; + const boilerplateSpec = boilerplates[this.format]; if (!boilerplateSpec) { this.log_.info('Unsupported AMP format', this.format); return; diff --git a/packages/optimizer/lib/transformers/AmpStoryCssTransformer.js b/packages/optimizer/lib/transformers/AmpStoryCssTransformer.js index c2c51d4a6..757f9e2fc 100644 --- a/packages/optimizer/lib/transformers/AmpStoryCssTransformer.js +++ b/packages/optimizer/lib/transformers/AmpStoryCssTransformer.js @@ -13,7 +13,7 @@ const { firstChildByTag, appendChild, } = require('../NodeUtils'); -const {AMP_CACHE_HOST} = require('../AmpConstants.js'); +const {DEFAULT_AMP_CACHE_HOST} = require('../AmpConstants.js'); // This string should not be modified, even slightly. This string is strictly // checked by the validator. @@ -139,7 +139,7 @@ function appendAmpStoryCssLink(head) { 'amp-extension': 'amp-story', // We rely on the `RewriteAmpUrls` transformer to modify this to // the correct LTS or correct rtv path. - 'href': `${AMP_CACHE_HOST}/v0/amp-story-1.0.css`, + 'href': `${DEFAULT_AMP_CACHE_HOST}/v0/amp-story-1.0.css`, }); appendChild(head, ampStoryCssLink); } diff --git a/packages/optimizer/lib/transformers/AutoExtensionImporter.js b/packages/optimizer/lib/transformers/AutoExtensionImporter.js index 30805829e..84d4a4228 100644 --- a/packages/optimizer/lib/transformers/AutoExtensionImporter.js +++ b/packages/optimizer/lib/transformers/AutoExtensionImporter.js @@ -23,7 +23,7 @@ const { hasAttribute, } = require('../NodeUtils'); const {findMetaViewport, findRuntimeScript} = require('../HtmlDomHelper'); -const {AMP_FORMATS, AMP_CACHE_HOST} = require('../AmpConstants'); +const {AMP_FORMATS, DEFAULT_AMP_CACHE_HOST} = require('../AmpConstants'); const BIND_SHORT_FORM_PREFIX = 'bind'; const AMP_BIND_DATA_ATTRIBUTE_PREFIX = 'data-amp-bind-'; @@ -188,7 +188,7 @@ class AutoExtensionImporter { } // Use cdn.ampproject.org as default, RewriteUrlTransformer will change this in case of self-hosting - const host = AMP_CACHE_HOST; + const host = DEFAULT_AMP_CACHE_HOST; for (const extensionName of extensionsToImport) { if (existingImports.has(extensionName)) { continue; diff --git a/packages/optimizer/lib/transformers/ReorderHeadTransformer.js b/packages/optimizer/lib/transformers/ReorderHeadTransformer.js index 41be15925..3a5754815 100644 --- a/packages/optimizer/lib/transformers/ReorderHeadTransformer.js +++ b/packages/optimizer/lib/transformers/ReorderHeadTransformer.js @@ -191,7 +191,7 @@ class HeadNodes { rel === 'prefetch' || rel === 'dns-prefetch' || rel === 'preconnect' || - rel == 'modulepreload' + rel === 'modulepreload' ) { this._resourceHintLinks.push(node); return; diff --git a/packages/optimizer/lib/transformers/RewriteAmpUrls.js b/packages/optimizer/lib/transformers/RewriteAmpUrls.js index 8b1109571..debfef6bd 100644 --- a/packages/optimizer/lib/transformers/RewriteAmpUrls.js +++ b/packages/optimizer/lib/transformers/RewriteAmpUrls.js @@ -23,7 +23,7 @@ const { insertBefore, remove, } = require('../NodeUtils'); -const {AMP_CACHE_HOST} = require('../AmpConstants.js'); +const {AMP_CACHE_HOSTS} = require('../AmpConstants.js'); const {findMetaViewport} = require('../HtmlDomHelper'); const {calculateHost} = require('../RuntimeHostHelper'); @@ -141,13 +141,15 @@ class RewriteAmpUrls { _usesAmpCacheUrl(url) { if (!url) { - return; + return false; } - return url.startsWith(AMP_CACHE_HOST); + // check if url starts with one of string array + return AMP_CACHE_HOSTS.some((host) => url.startsWith(host)); } _replaceUrl(url, host) { - return host + url.substring(AMP_CACHE_HOST.length); + const existingHost = AMP_CACHE_HOSTS.find((ampCacheHost) => url.startsWith(ampCacheHost)); + return host + url.substring(existingHost.length); } _addEsm(scriptNode, preloadEnabled) { diff --git a/packages/optimizer/spec/helpers/validatorInstance.js b/packages/optimizer/spec/helpers/validatorInstance.js index e93fa05af..b4a797c77 100644 --- a/packages/optimizer/spec/helpers/validatorInstance.js +++ b/packages/optimizer/spec/helpers/validatorInstance.js @@ -6,6 +6,7 @@ let instance = null; module.exports = { get: () => { if (!instance) { + console.error('Validator instance created: ' + path.join(__dirname, 'validator.js')); instance = validator.getInstance(path.join(__dirname, 'validator.js')); } return instance; diff --git a/packages/optimizer/spec/transformers/valid/AddMandatoryTags/keep-existing-tags-ampjs/expected_output.html b/packages/optimizer/spec/transformers/valid/AddMandatoryTags/keep-existing-tags-ampjs/expected_output.html new file mode 100644 index 000000000..168f7e570 --- /dev/null +++ b/packages/optimizer/spec/transformers/valid/AddMandatoryTags/keep-existing-tags-ampjs/expected_output.html @@ -0,0 +1,13 @@ + + + + My AMP Page + + + + + + +

hello world

+ + \ No newline at end of file diff --git a/packages/optimizer/spec/transformers/valid/AddMandatoryTags/keep-existing-tags-ampjs/input.html b/packages/optimizer/spec/transformers/valid/AddMandatoryTags/keep-existing-tags-ampjs/input.html new file mode 100644 index 000000000..801dd6079 --- /dev/null +++ b/packages/optimizer/spec/transformers/valid/AddMandatoryTags/keep-existing-tags-ampjs/input.html @@ -0,0 +1,10 @@ + + + My AMP Page + + + + +

hello world

+ + diff --git a/packages/optimizer/spec/transformers/valid/RewriteAmpUrls/adds_lts_ampjs/expected_output.html b/packages/optimizer/spec/transformers/valid/RewriteAmpUrls/adds_lts_ampjs/expected_output.html new file mode 100644 index 000000000..aa570f4cf --- /dev/null +++ b/packages/optimizer/spec/transformers/valid/RewriteAmpUrls/adds_lts_ampjs/expected_output.html @@ -0,0 +1,13 @@ + + + + + + + + + + + + + \ No newline at end of file diff --git a/packages/optimizer/spec/transformers/valid/RewriteAmpUrls/adds_lts_ampjs/input.html b/packages/optimizer/spec/transformers/valid/RewriteAmpUrls/adds_lts_ampjs/input.html new file mode 100644 index 000000000..3e5da0cf2 --- /dev/null +++ b/packages/optimizer/spec/transformers/valid/RewriteAmpUrls/adds_lts_ampjs/input.html @@ -0,0 +1,16 @@ + + + + + + + + + + + + diff --git a/packages/optimizer/spec/transformers/valid/RewriteAmpUrls/adds_preloads_ampjs/expected_output.html b/packages/optimizer/spec/transformers/valid/RewriteAmpUrls/adds_preloads_ampjs/expected_output.html new file mode 100644 index 000000000..4a160fd16 --- /dev/null +++ b/packages/optimizer/spec/transformers/valid/RewriteAmpUrls/adds_preloads_ampjs/expected_output.html @@ -0,0 +1,13 @@ + + + + + + + + + + + + + \ No newline at end of file diff --git a/packages/optimizer/spec/transformers/valid/RewriteAmpUrls/adds_preloads_ampjs/input.html b/packages/optimizer/spec/transformers/valid/RewriteAmpUrls/adds_preloads_ampjs/input.html new file mode 100644 index 000000000..cf97424d6 --- /dev/null +++ b/packages/optimizer/spec/transformers/valid/RewriteAmpUrls/adds_preloads_ampjs/input.html @@ -0,0 +1,11 @@ + + + + + + + + + + + diff --git a/packages/runtime-version/lib/RuntimeVersion.js b/packages/runtime-version/lib/RuntimeVersion.js index 3084e7b4b..4e514e6f1 100644 --- a/packages/runtime-version/lib/RuntimeVersion.js +++ b/packages/runtime-version/lib/RuntimeVersion.js @@ -15,9 +15,10 @@ */ 'use strict'; +const {DEFAULT_AMP_CACHE_HOST} = require('../../optimizer/lib/AmpConstants'); + const log = require('@ampproject/toolbox-core').log.tag('AMP Runtime Version'); -const AMP_CACHE_HOST = 'https://cdn.ampproject.org'; const RUNTIME_METADATA_PATH = '/rtv/metadata'; const VERSION_TXT_PATH = '/version.txt'; @@ -96,7 +97,9 @@ class RuntimeVersion { releaseType = ReleaseType.lts; } - const host = options.ampUrlPrefix ? options.ampUrlPrefix.replace(/\/$/, '') : AMP_CACHE_HOST; + const host = options.ampUrlPrefix + ? options.ampUrlPrefix.replace(/\/$/, '') + : DEFAULT_AMP_CACHE_HOST; let rtv = await this.getVersionFromRuntimeMetadata_(host, releaseType); if (!rtv && releaseType === ReleaseType.prod) {