Skip to content

Commit

Permalink
Update to latest version of AMP optimizer (#11753)
Browse files Browse the repository at this point in the history
* Update to latest version of AMP optimizer

* Update test

* Update another test

* Update another test
  • Loading branch information
ijjk authored Apr 9, 2020
1 parent a35ae24 commit fa167e3
Show file tree
Hide file tree
Showing 5 changed files with 55 additions and 47 deletions.
2 changes: 1 addition & 1 deletion packages/next/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@
]
},
"dependencies": {
"@ampproject/toolbox-optimizer": "2.0.1",
"@ampproject/toolbox-optimizer": "2.2.0",
"@babel/core": "7.7.2",
"@babel/plugin-proposal-class-properties": "7.7.0",
"@babel/plugin-proposal-nullish-coalescing-operator": "7.7.4",
Expand Down
2 changes: 1 addition & 1 deletion test/integration/amphtml-fragment-style/test/index.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ describe('AMP Fragment Styles', () => {
await validateAMP(html)
const $ = cheerio.load(html)
const styles = $('style[amp-custom]').text()
expect(styles).toMatch(/background:(.*|)hotpink/)
expect(styles).toMatch(/background:(.*|)#ff69b4/)
expect(styles).toMatch(/font-size:(.*|)16\.4px/)
})
})
2 changes: 1 addition & 1 deletion test/integration/amphtml/test/index.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -229,7 +229,7 @@ describe('AMP Usage', () => {
.first()
.text()
).toMatch(
/div.jsx-\d+{color:red;}span.jsx-\d+{color:blue;}body{background-color:green;}/
/div.jsx-\d+{color:red}span.jsx-\d+{color:#00f}body{background-color:green}/
)
})

Expand Down
2 changes: 1 addition & 1 deletion test/integration/styled-jsx-module/test/index.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ function runTests() {

it('should render styles during SSR (AMP)', async () => {
const html = await renderViaHTTP(appPort, '/amp')
expect(html).toMatch(/color:.*?cyan/)
expect(html).toMatch(/color:.*?#0ff/)
})
}

Expand Down
94 changes: 51 additions & 43 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -2,45 +2,46 @@
# yarn lockfile v1


"@ampproject/toolbox-core@^2.0.0":
version "2.0.0"
resolved "https://registry.yarnpkg.com/@ampproject/toolbox-core/-/toolbox-core-2.0.0.tgz#3329a01eec8f767614385cc56cee8be32ccf7f32"
integrity sha512-xAJOmh6MPS2mdHNsK8mj1t8TLh6mlehirh0fOBsRhKCNCJXgg4Gfd2u5igy8VFq9sYnuWP/npFyjGX36qpXW5Q==
"@ampproject/toolbox-core@^2.2.0":
version "2.2.0"
resolved "https://registry.yarnpkg.com/@ampproject/toolbox-core/-/toolbox-core-2.2.0.tgz#3878c5fbdd2acdd865f070ded43ee84652a7a16b"
integrity sha512-g0NnZZqPJttIcdplIpiMDmOLewwvCWPSnFKvNdyYXN7vknRvR4krpV2qveuVgjnA+dSlDmtzuFapFCaWh4V7FQ==
dependencies:
cross-fetch "3.0.4"

"@ampproject/toolbox-optimizer@2.0.1":
version "2.0.1"
resolved "https://registry.yarnpkg.com/@ampproject/toolbox-optimizer/-/toolbox-optimizer-2.0.1.tgz#943681faf24443044aa66f0b55eefb13cdcc068c"
integrity sha512-zroXqrV7mY77+/6hV7kaaWxp4LA85V0B/2vg7WdF+FrwiO9Wior/lIW8UbpRek6INjw0VOp1ED73MmGJkwaDhA==
dependencies:
"@ampproject/toolbox-core" "^2.0.0"
"@ampproject/toolbox-runtime-version" "^2.0.0"
"@ampproject/toolbox-script-csp" "^2.0.0"
"@ampproject/toolbox-validator-rules" "^2.0.0"
css "2.2.4"
"@ampproject/toolbox-optimizer@2.2.0":
version "2.2.0"
resolved "https://registry.yarnpkg.com/@ampproject/toolbox-optimizer/-/toolbox-optimizer-2.2.0.tgz#2438d7102beb1a74bae8d20926e038c5f724a8ae"
integrity sha512-lEujArv6jyl/mEab0uBZ25oMkf+kf8cpTuHPcy8k3+jtomNyVtd94lbSWbQtomsEnYQ0MA9MvLvCJXsJz1fQcg==
dependencies:
"@ampproject/toolbox-core" "^2.2.0"
"@ampproject/toolbox-runtime-version" "^2.2.0"
"@ampproject/toolbox-script-csp" "^2.2.0"
"@ampproject/toolbox-validator-rules" "^2.2.0"
cssnano "4.1.10"
domhandler "3.0.0"
domutils "2.0.0"
htmlparser2 "4.1.0"
normalize-html-whitespace "1.0.0"
terser "4.6.7"
postcss-safe-parser "4.0.2"
terser "4.6.8"

"@ampproject/toolbox-runtime-version@^2.0.0":
version "2.0.0"
resolved "https://registry.yarnpkg.com/@ampproject/toolbox-runtime-version/-/toolbox-runtime-version-2.0.0.tgz#01202be490ce8baf8654127de35dff5f93e922a0"
integrity sha512-7XDlo7l4Ozpc/XWmJeYNF0ZfXCy7Vdh07spN+xEOst8gF99yaavZRNVkdgyTxLR3BpY9RIqqhSs6OxfkOKlRZQ==
"@ampproject/toolbox-runtime-version@^2.2.0":
version "2.2.0"
resolved "https://registry.yarnpkg.com/@ampproject/toolbox-runtime-version/-/toolbox-runtime-version-2.2.0.tgz#e90ae9e97081c9c5362262f9ba093ac029837a8c"
integrity sha512-kQRLMreDp1Wp9DotQzJ4k/ZKK6ZxtI6ce2JIvyH8Xfi6H4BQNu0Ht0agMgm51/OsMKyHD+dDIGEHKaKWIOiPLQ==
dependencies:
"@ampproject/toolbox-core" "^2.0.0"
"@ampproject/toolbox-core" "^2.2.0"

"@ampproject/toolbox-script-csp@^2.0.0":
version "2.0.0"
resolved "https://registry.yarnpkg.com/@ampproject/toolbox-script-csp/-/toolbox-script-csp-2.0.0.tgz#7aa55fb693749e657b63985ebe49e1d3489a8b79"
integrity sha512-9mW3yiKwjORi0ViuayphVZii9MwiPhneZGZWy+kN44xr3SpN7iQC52/WWWTBOZX9z1zaUh8DqGc//VFY5ILSAw==
"@ampproject/toolbox-script-csp@^2.2.0":
version "2.2.0"
resolved "https://registry.yarnpkg.com/@ampproject/toolbox-script-csp/-/toolbox-script-csp-2.2.0.tgz#7bc33985e94a40acdbddb5695dc8d85f11066803"
integrity sha512-Z5AzbWFTlTMJg0z1/frMDmW6Gj+EbOw0dVdFYfdma4AJq4rNoxCQMVgVOjl4ryWNouJvK1RUA8o7sY1WmMx6eg==

"@ampproject/toolbox-validator-rules@^2.0.0":
version "2.0.0"
resolved "https://registry.yarnpkg.com/@ampproject/toolbox-validator-rules/-/toolbox-validator-rules-2.0.0.tgz#eefdce2f7f773e4675d72c7a1068c70105a647c3"
integrity sha512-5f2IvT1m/zNtqfNXFE9V4ZtKofIttST65QL1wf4lKjBhJsbZgAAeR/u4DgOvftRVRmgn6IpUiWY1pt9xWaI5yA==
"@ampproject/toolbox-validator-rules@^2.2.0":
version "2.2.0"
resolved "https://registry.yarnpkg.com/@ampproject/toolbox-validator-rules/-/toolbox-validator-rules-2.2.0.tgz#830a2bc22a09dc17ff37835991858902d04cfe19"
integrity sha512-R5VkDmhmNatq9SuuHaeA2Uno4O5K4YSh11o6A/5jJZ2EjilAcpuAKvZlRp9tjucPWHi+/z/n5PCJ8YUxzCzWaQ==
dependencies:
cross-fetch "3.0.4"

Expand Down Expand Up @@ -5621,7 +5622,7 @@ css-what@^3.2.1:
resolved "https://registry.yarnpkg.com/css-what/-/css-what-3.2.1.tgz#f4a8f12421064621b456755e34a03a2c22df5da1"
integrity sha512-WwOrosiQTvyms+Ti5ZC5vGEK0Vod3FTt1ca+payZqvKuGJF+dq7bG63DstxtN0dpm6FxY27a/zS3Wten+gEtGw==

css@2.2.4, css@^2.0.0:
css@^2.0.0:
version "2.2.4"
resolved "https://registry.yarnpkg.com/css/-/css-2.2.4.tgz#c646755c73971f2bba6a601e2cf2fd71b1298929"
integrity sha512-oUnjmWpy0niI3x/mPL8dVEI1l7MnG3+HHyRPHf+YFSbK+svOhXpmSOcDURUh2aOCgl2grzrOPt1nHLuCVFULLw==
Expand Down Expand Up @@ -5724,6 +5725,16 @@ cssnano-util-same-parent@^4.0.0:
resolved "https://registry.yarnpkg.com/cssnano-util-same-parent/-/cssnano-util-same-parent-4.0.1.tgz#574082fb2859d2db433855835d9a8456ea18bbf3"
integrity sha512-WcKx5OY+KoSIAxBW6UBBRay1U6vkYheCdjyVNDm85zt5K9mHoGOfsOsqIszfAqrQQFIIKgjh2+FDgIj/zsl21Q==

cssnano@4.1.10, cssnano@^4.1.10, cssnano@^4.1.7:
version "4.1.10"
resolved "https://registry.yarnpkg.com/cssnano/-/cssnano-4.1.10.tgz#0ac41f0b13d13d465487e111b778d42da631b8b2"
integrity sha512-5wny+F6H4/8RgNlaqab4ktc3e0/blKutmq8yNlBFXA//nSFFAqAngjNVRzUvCgYROULmZZUoosL/KSoZo5aUaQ==
dependencies:
cosmiconfig "^5.0.0"
cssnano-preset-default "^4.0.7"
is-resolvable "^1.0.0"
postcss "^7.0.0"

cssnano@^3.10.0:
version "3.10.0"
resolved "https://registry.yarnpkg.com/cssnano/-/cssnano-3.10.0.tgz#4f38f6cea2b9b17fa01490f23f1dc68ea65c1c38"
Expand Down Expand Up @@ -5762,16 +5773,6 @@ cssnano@^3.10.0:
postcss-value-parser "^3.2.3"
postcss-zindex "^2.0.1"

cssnano@^4.1.10, cssnano@^4.1.7:
version "4.1.10"
resolved "https://registry.yarnpkg.com/cssnano/-/cssnano-4.1.10.tgz#0ac41f0b13d13d465487e111b778d42da631b8b2"
integrity sha512-5wny+F6H4/8RgNlaqab4ktc3e0/blKutmq8yNlBFXA//nSFFAqAngjNVRzUvCgYROULmZZUoosL/KSoZo5aUaQ==
dependencies:
cosmiconfig "^5.0.0"
cssnano-preset-default "^4.0.7"
is-resolvable "^1.0.0"
postcss "^7.0.0"

csso@^4.0.2:
version "4.0.2"
resolved "https://registry.yarnpkg.com/csso/-/csso-4.0.2.tgz#e5f81ab3a56b8eefb7f0092ce7279329f454de3d"
Expand Down Expand Up @@ -13233,6 +13234,13 @@ postcss-replace-overflow-wrap@^3.0.0:
dependencies:
postcss "^7.0.2"

postcss-safe-parser@4.0.2:
version "4.0.2"
resolved "https://registry.yarnpkg.com/postcss-safe-parser/-/postcss-safe-parser-4.0.2.tgz#a6d4e48f0f37d9f7c11b2a581bf00f8ba4870b96"
integrity sha512-Uw6ekxSWNLCPesSv/cmqf2bY/77z11O7jZGPax3ycZMFU/oi2DMH9i89AdHc1tRwFg/arFoEwX0IS3LCUxJh1g==
dependencies:
postcss "^7.0.26"

postcss-selector-matches@^4.0.0:
version "4.0.0"
resolved "https://registry.yarnpkg.com/postcss-selector-matches/-/postcss-selector-matches-4.0.0.tgz#71c8248f917ba2cc93037c9637ee09c64436fcff"
Expand Down Expand Up @@ -16034,10 +16042,10 @@ terser@4.4.2:
source-map "~0.6.1"
source-map-support "~0.5.12"

terser@4.6.7:
version "4.6.7"
resolved "https://registry.yarnpkg.com/terser/-/terser-4.6.7.tgz#478d7f9394ec1907f0e488c5f6a6a9a2bad55e72"
integrity sha512-fmr7M1f7DBly5cX2+rFDvmGBAaaZyPrHYK4mMdHEDAdNTqXSZgSOfqsfGq2HqPGT/1V0foZZuCZFx8CHKgAk3g==
terser@4.6.8:
version "4.6.8"
resolved "https://registry.yarnpkg.com/terser/-/terser-4.6.8.tgz#62ccb14a52f102418ad6061dfef45076f13e5fa2"
integrity sha512-drV7ga6ZlIpBtitvb87Uk7P7gAJkCt3j/TqZr9wwF4Dlt0MBn52ANIAyuvP1F605WdPY4w6vT63u6KTWqaXFRQ==
dependencies:
commander "^2.20.0"
source-map "~0.6.1"
Expand Down

0 comments on commit fa167e3

Please sign in to comment.