Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

build: update critters to version 0.0.11 #21983

Merged
merged 2 commits into from
Oct 20, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,7 @@
"conventional-commits-parser": "^3.0.0",
"copy-webpack-plugin": "9.0.1",
"core-js": "3.16.0",
"critters": "0.0.10",
"critters": "0.0.11",
"css-loader": "6.2.0",
"css-minimizer-webpack-plugin": "3.0.2",
"debug": "^4.1.1",
Expand Down
2 changes: 1 addition & 1 deletion packages/angular_devkit/build_angular/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
"circular-dependency-plugin": "5.2.2",
"copy-webpack-plugin": "9.0.1",
"core-js": "3.16.0",
"critters": "0.0.10",
"critters": "0.0.11",
"css-loader": "6.2.0",
"css-minimizer-webpack-plugin": "3.0.2",
"esbuild-wasm": "0.13.8",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -294,7 +294,7 @@ describe('AppShell Builder', () => {
const content = virtualFs.fileBufferToString(host.scopedSync().read(normalize(fileName)));

expect(content).toContain('app-shell works!');
expect(content).toContain('p{color:#000;}');
expect(content).toContain('p{color:#000}');
expect(content).toMatch(
/<link rel="stylesheet" href="styles\.[a-z0-9]+\.css" media="print" onload="this\.media='all'">/,
);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ describeBuilder(buildWebpackBrowser, BROWSER_BUILDER_INFO, (harness) => {
.content.toContain(
`<link rel="stylesheet" href="styles.css" media="print" onload="this.media='all'">`,
);
harness.expectFile('dist/index.html').content.toContain(`body{color:#000;}`);
harness.expectFile('dist/index.html').content.toContain(`body{color:#000}`);
});

it(`should extract critical css when 'optimization' is unset`, async () => {
Expand All @@ -55,7 +55,7 @@ describeBuilder(buildWebpackBrowser, BROWSER_BUILDER_INFO, (harness) => {
.content.toContain(
`<link rel="stylesheet" href="styles.css" media="print" onload="this.media='all'">`,
);
harness.expectFile('dist/index.html').content.toContain(`body{color:#000;}`);
harness.expectFile('dist/index.html').content.toContain(`body{color:#000}`);
});

it(`should extract critical css when 'optimization' is true`, async () => {
Expand All @@ -73,7 +73,7 @@ describeBuilder(buildWebpackBrowser, BROWSER_BUILDER_INFO, (harness) => {
.content.toContain(
`<link rel="stylesheet" href="styles.css" media="print" onload="this.media='all'">`,
);
harness.expectFile('dist/index.html').content.toContain(`body{color:#000;}`);
harness.expectFile('dist/index.html').content.toContain(`body{color:#000}`);
});

it(`should not extract critical css when 'optimization' is false`, async () => {
Expand Down Expand Up @@ -131,7 +131,7 @@ describeBuilder(buildWebpackBrowser, BROWSER_BUILDER_INFO, (harness) => {
.content.toContain(
`<link rel="stylesheet" href="http://cdn.com/styles.css" media="print" onload="this.media='all'">`,
);
harness.expectFile('dist/index.html').content.toContain(`body{color:#000;}`);
harness.expectFile('dist/index.html').content.toContain(`body{color:#000}`);
});

it(`should extract critical css when using '@media all {}' and 'minify' is set to true`, async () => {
Expand All @@ -157,7 +157,7 @@ describeBuilder(buildWebpackBrowser, BROWSER_BUILDER_INFO, (harness) => {
.content.toContain(
`<link rel="stylesheet" href="styles.css" media="print" onload="this.media='all'">`,
);
harness.expectFile('dist/index.html').content.toContain(`body{color:#000;}`);
harness.expectFile('dist/index.html').content.toContain(`body{color:#000}`);
});
});
});
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ describeBuilder(serveWebpackBrowser, DEV_SERVER_BUILDER_INFO, (harness) => {
const { result, response } = await executeOnceAndFetch(harness, '/');

expect(result?.success).toBeTrue();
expect(await response?.text()).toContain('body{color:#000;}');
expect(await response?.text()).toContain('body{color:#000}');
});
});
});
Original file line number Diff line number Diff line change
Expand Up @@ -58,14 +58,10 @@ describe('InlineCriticalCssProcessor', () => {
);
expect(content).not.toContain('color: blue');
expect(tags.stripIndents`${content}`).toContain(tags.stripIndents`
<style>body {
margin: 0;
}

html {
color: white;
}</style>
`);
<style>
body { margin: 0; }
html { color: white; }
</style>`);
});

it('should inline critical css when using deployUrl', async () => {
Expand All @@ -85,14 +81,10 @@ describe('InlineCriticalCssProcessor', () => {
`<link href="http://cdn.com/theme.css" rel="stylesheet" media="print" onload="this.media='all'">`,
);
expect(tags.stripIndents`${content}`).toContain(tags.stripIndents`
<style>body {
margin: 0;
}

html {
color: white;
}</style>
`);
<style>
body { margin: 0; }
html { color: white; }
</style>`);
});

it('should compress inline critical css when minify is enabled', async () => {
Expand All @@ -111,6 +103,6 @@ describe('InlineCriticalCssProcessor', () => {
expect(content).toContain(
`<link href="theme.css" rel="stylesheet" media="print" onload="this.media='all'">`,
);
expect(content).toContain('<style>body{margin:0;}html{color:white;}</style>');
expect(content).toContain('<style>body{margin:0}html{color:white}</style>');
});
});
84 changes: 69 additions & 15 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -3184,7 +3184,7 @@ bonjour@^3.5.0:
multicast-dns "^6.0.1"
multicast-dns-service-types "^1.1.0"

boolbase@^1.0.0:
boolbase@^1.0.0, boolbase@~1.0.0:
version "1.0.0"
resolved "https://registry.yarnpkg.com/boolbase/-/boolbase-1.0.0.tgz#68dff5fbe60c51eb37725ea9e3ed310dcc1e776e"
integrity sha1-aN/1++YMUes3cl6p4+0xDcwed24=
Expand Down Expand Up @@ -3943,15 +3943,16 @@ create-require@^1.1.0:
resolved "https://registry.yarnpkg.com/create-require/-/create-require-1.1.1.tgz#c1d7e8f1e5f6cfc9ff65f9cd352d37348756c333"
integrity sha512-dcKFX3jn0MpIaXjisoRvexIJVEKzaq7z2rZKxf+MSr9TkdmHmsU4m2lcLojrj/FHl8mk5VxMmYA+ftRkP/3oKQ==

critters@0.0.10:
version "0.0.10"
resolved "https://registry.yarnpkg.com/critters/-/critters-0.0.10.tgz#edd0e962fc5af6c4adb6dbf1a71bae2d3f917000"
integrity sha512-p5VKhP1803+f+0Jq5P03w1SbiHtpAKm+1EpJHkiPxQPq0Vu9QLZHviJ02GRrWi0dlcJqrmzMWInbwp4d22RsGw==
critters@0.0.11:
version "0.0.11"
resolved "https://registry.yarnpkg.com/critters/-/critters-0.0.11.tgz#8dce2ba94e906d31de82b7c12b973717d1488823"
integrity sha512-E1XlhQTmf0Y2Q6hYVrXKxibxps2LNarpZaDCRNaxA1LA5LxlgoIPN0rcOzFVlwRD47iNYhVtD4DmGtgr2edrlQ==
dependencies:
chalk "^4.1.0"
css "^3.0.0"
css-select "^1.2.0"
parse5 "^6.0.1"
parse5-htmlparser2-tree-adapter "^6.0.1"
postcss "^8.3.7"
pretty-bytes "^5.3.0"

cross-spawn@^6.0.0:
Expand Down Expand Up @@ -4047,6 +4048,16 @@ css-prefers-color-scheme@^3.1.1:
dependencies:
postcss "^7.0.5"

css-select@^1.2.0:
version "1.2.0"
resolved "https://registry.yarnpkg.com/css-select/-/css-select-1.2.0.tgz#2b3a110539c5355f1cd8d314623e870b121ec858"
integrity sha1-KzoRBTnFNV8c2NMUYj6HCxIeyFg=
dependencies:
boolbase "~1.0.0"
css-what "2.1"
domutils "1.5.1"
nth-check "~1.0.1"

css-select@^4.1.3:
version "4.1.3"
resolved "https://registry.yarnpkg.com/css-select/-/css-select-4.1.3.tgz#a70440f70317f2669118ad74ff105e65849c7067"
Expand Down Expand Up @@ -4074,6 +4085,11 @@ css-tree@^1.1.2:
mdn-data "2.0.14"
source-map "^0.6.1"

css-what@2.1:
version "2.1.3"
resolved "https://registry.yarnpkg.com/css-what/-/css-what-2.1.3.tgz#a6d7604573365fe74686c3f311c56513d88285f2"
integrity sha512-a+EPoD+uZiNfh+5fxw2nO9QwFa6nJe2Or35fGY6Ipw1R3R4AGz1d1TEZrCegvw2YTmZ0jXirGYlzxxpYSHwpEg==

css-what@^5.0.0:
version "5.0.1"
resolved "https://registry.yarnpkg.com/css-what/-/css-what-5.0.1.tgz#3efa820131f4669a8ac2408f9c32e7c7de9f4cad"
Expand All @@ -4089,15 +4105,6 @@ css@^2.0.0:
source-map-resolve "^0.5.2"
urix "^0.1.0"

css@^3.0.0:
version "3.0.0"
resolved "https://registry.yarnpkg.com/css/-/css-3.0.0.tgz#4447a4d58fdd03367c516ca9f64ae365cee4aa5d"
integrity sha512-DG9pFfwOrzc+hawpmqX/dHYHJG+Bsdb0klhyi1sDneOgGOXy9wQIC8hzyVp1e4NRYDBdxcylvywPkkXCHAzTyQ==
dependencies:
inherits "^2.0.4"
source-map "^0.6.1"
source-map-resolve "^0.6.0"

cssauron@^1.4.0:
version "1.4.0"
resolved "https://registry.yarnpkg.com/cssauron/-/cssauron-1.4.0.tgz#a6602dff7e04a8306dc0db9a551e92e8b5662ad8"
Expand Down Expand Up @@ -4534,6 +4541,14 @@ dom-serialize@^2.2.1:
extend "^3.0.0"
void-elements "^2.0.0"

dom-serializer@0:
version "0.2.2"
resolved "https://registry.yarnpkg.com/dom-serializer/-/dom-serializer-0.2.2.tgz#1afb81f533717175d478655debc5e332d9f9bb51"
integrity sha512-2/xPb3ORsQ42nHYiSunXkDjPLBaEj/xTwUO4B7XCZQTRk7EBtTOPaygh10YAAh2OI1Qrp6NWfpAhzswj0ydt9g==
dependencies:
domelementtype "^2.0.1"
entities "^2.0.0"

dom-serializer@^1.0.1:
version "1.3.2"
resolved "https://registry.yarnpkg.com/dom-serializer/-/dom-serializer-1.3.2.tgz#6206437d32ceefaec7161803230c7a20bc1b4d91"
Expand All @@ -4543,6 +4558,11 @@ dom-serializer@^1.0.1:
domhandler "^4.2.0"
entities "^2.0.0"

domelementtype@1:
version "1.3.1"
resolved "https://registry.yarnpkg.com/domelementtype/-/domelementtype-1.3.1.tgz#d048c44b37b0d10a7f2a3d5fee3f4333d790481f"
integrity sha512-BSKB+TSpMpFI/HOxCNr1O8aMOTZ8hT3pM3GQ0w/mWRmkhEDSFJkkyzz4XQsBV44BChwGkrDfMyjVD0eA2aFV3w==

domelementtype@^2.0.1, domelementtype@^2.2.0:
version "2.2.0"
resolved "https://registry.yarnpkg.com/domelementtype/-/domelementtype-2.2.0.tgz#9a0b6c2782ed6a1c7323d42267183df9bd8b1d57"
Expand Down Expand Up @@ -4572,6 +4592,14 @@ dompurify@^2.2.6:
resolved "https://registry.yarnpkg.com/dompurify/-/dompurify-2.3.0.tgz#07bb39515e491588e5756b1d3e8375b5964814e2"
integrity sha512-VV5C6Kr53YVHGOBKO/F86OYX6/iLTw2yVSI721gKetxpHCK/V5TaLEf9ODjRgl1KLSWRMY6cUhAbv/c+IUnwQw==

domutils@1.5.1:
version "1.5.1"
resolved "https://registry.yarnpkg.com/domutils/-/domutils-1.5.1.tgz#dcd8488a26f563d61079e48c9f7b7e32373682cf"
integrity sha1-3NhIiib1Y9YQeeSMn3t+Mjc2gs8=
dependencies:
dom-serializer "0"
domelementtype "1"

domutils@^2.6.0:
version "2.7.0"
resolved "https://registry.yarnpkg.com/domutils/-/domutils-2.7.0.tgz#8ebaf0c41ebafcf55b0b72ec31c56323712c5442"
Expand Down Expand Up @@ -7963,6 +7991,11 @@ nanoid@^3.1.23:
resolved "https://registry.yarnpkg.com/nanoid/-/nanoid-3.1.23.tgz#f744086ce7c2bc47ee0a8472574d5c78e4183a81"
integrity sha512-FiB0kzdP0FFVGDKlRLEQ1BgDzU87dy5NnzjeW9YZNt+/c3+q82EQDUwniSAUxp/F0gFNI1ZhKU1FqYsMuqZVnw==

nanoid@^3.1.28:
version "3.1.30"
resolved "https://registry.yarnpkg.com/nanoid/-/nanoid-3.1.30.tgz#63f93cc548d2a113dc5dfbc63bfa09e2b9b64362"
integrity sha512-zJpuPDwOv8D2zq2WRoMe1HsfZthVewpel9CAvTfc/2mBD1uUT/agc5f7GHGWXlYkFvi1mVxe4IjvP2HNrop7nQ==

nanomatch@^1.2.9:
version "1.2.13"
resolved "https://registry.yarnpkg.com/nanomatch/-/nanomatch-1.2.13.tgz#b87a8aa4fc0de8fe6be88895b38983ff265bd119"
Expand Down Expand Up @@ -8271,6 +8304,13 @@ nth-check@^2.0.0:
dependencies:
boolbase "^1.0.0"

nth-check@~1.0.1:
version "1.0.2"
resolved "https://registry.yarnpkg.com/nth-check/-/nth-check-1.0.2.tgz#b2bd295c37e3dd58a3bf0700376663ba4d9cf05c"
integrity sha512-WeBOdju8SnzPN5vTUJYxYUxLeXpCaVP5i5e0LF8fg7WORF2Wd7wFX/pk0tYZk7s8T+J7VLy0Da6J1+wCT0AtHg==
dependencies:
boolbase "~1.0.0"

num2fraction@^1.2.2:
version "1.2.2"
resolved "https://registry.yarnpkg.com/num2fraction/-/num2fraction-1.2.2.tgz#6f682b6a027a4e9ddfa4564cd2589d1d4e669ede"
Expand Down Expand Up @@ -8763,6 +8803,11 @@ performance-now@^2.1.0:
resolved "https://registry.yarnpkg.com/performance-now/-/performance-now-2.1.0.tgz#6309f4e0e5fa913ec1c69307ae364b4b377c9e7b"
integrity sha1-Ywn04OX6kT7BxpMHrjZLSzd8nns=

picocolors@^0.2.1:
version "0.2.1"
resolved "https://registry.yarnpkg.com/picocolors/-/picocolors-0.2.1.tgz#570670f793646851d1ba135996962abad587859f"
integrity sha512-cMlDqaLEqfSaW8Z7N5Jw+lyIW869EzT73/F5lhtY9cLGoVxSXznfgfXMO0Z5K0o0Q2TkTXq+0KFsdnSe3jDViA==

picomatch@^2.0.4, picomatch@^2.2.1, picomatch@^2.2.2, picomatch@^2.2.3:
version "2.3.0"
resolved "https://registry.yarnpkg.com/picomatch/-/picomatch-2.3.0.tgz#f1f061de8f6a4bf022892e2d128234fb98302972"
Expand Down Expand Up @@ -9476,6 +9521,15 @@ postcss@8.3.6, postcss@^8.2.15, postcss@^8.2.4, postcss@^8.3.5:
nanoid "^3.1.23"
source-map-js "^0.6.2"

postcss@^8.3.7:
version "8.3.9"
resolved "https://registry.yarnpkg.com/postcss/-/postcss-8.3.9.tgz#98754caa06c4ee9eb59cc48bd073bb6bd3437c31"
integrity sha512-f/ZFyAKh9Dnqytx5X62jgjhhzttjZS7hMsohcI7HEI5tjELX/HxCy3EFhsRxyzGvrzFF+82XPvCS8T9TFleVJw==
dependencies:
nanoid "^3.1.28"
picocolors "^0.2.1"
source-map-js "^0.6.2"

prelude-ls@^1.2.1:
version "1.2.1"
resolved "https://registry.yarnpkg.com/prelude-ls/-/prelude-ls-1.2.1.tgz#debc6489d7a6e6b0e7611888cec880337d316396"
Expand Down