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

core(legacy-javascript): add focus-visible polyfill #14827

Merged
merged 11 commits into from
Mar 15, 2023

Conversation

connorjclark
Copy link
Collaborator

This adds the first non-corejs polyfill. Inspired by GoogleChrome/web.dev#9409

This polyfill can have an outsized impact relative to its size, so the audit in its current state does not do a good job of highlighting the issue. For example, it's passing because the KB is so little:

image

We can address this later, but it'll be either a huge change (task attribution using source maps...) or a hardcoded thing (force-fail audit when this polyfill is detected). Needs some discussion, but either way this is a good place to split the work and land something.

@connorjclark connorjclark requested a review from a team as a code owner February 23, 2023 20:22
@connorjclark connorjclark requested review from brendankenny and removed request for a team February 23, 2023 20:22
@connorjclark
Copy link
Collaborator Author

Updated - and also modified the polyfill size estimator graph to not be so specific to corejs. Just hard-coding the size of the non-corejs stuff for now, since it's only one thing.

@@ -1,54 +1,54 @@
{
"moduleSizes": [498, 265, 277, 263, 453, 219, 216, 546, 339, 1608, 671, 1525, 420, 214, 504, 98, 524, 196, 268, 642, 204, 742, 618, 169, 394, 127, 433, 1473, 779, 239, 144, 182, 254, 77, 508, 124, 1388, 75, 133, 301, 362, 170, 1078, 182, 490, 195, 321, 316, 447, 551, 216, 284, 253, 17, 107, 295, 356, 345, 1939, 1596, 291, 139, 259, 1291, 179, 528, 174, 61, 326, 20, 444, 522, 104, 1945, 120, 1943, 680, 1409, 850, 630, 288, 38, 695, 569, 106, 587, 208, 370, 606, 766, 535, 616, 200, 170, 224, 422, 970, 978, 498, 284, 241, 210, 151, 194, 178, 814, 205, 189, 215, 111, 236, 147, 237, 191, 691, 212, 432, 499, 445, 176, 333, 129, 414, 617, 380, 251, 199, 524, 515, 681, 160, 259, 295, 283, 178, 472, 786, 520, 202, 575, 575, 349, 549, 458, 166, 173, 508, 1522, 743, 414, 431, 393, 899, 137, 270, 131, 472, 457, 205, 778, 801, 133],
"moduleSizes": [11897, 498, 265, 277, 263, 453, 219, 216, 546, 339, 1608, 671, 1525, 420, 214, 504, 98, 524, 196, 268, 642, 204, 742, 618, 169, 394, 127, 433, 1473, 779, 239, 144, 182, 254, 77, 508, 124, 1388, 75, 133, 301, 362, 170, 1078, 182, 490, 195, 321, 316, 447, 551, 216, 284, 253, 17, 107, 295, 356, 345, 1939, 1596, 291, 139, 259, 1291, 179, 528, 174, 61, 326, 20, 444, 522, 104, 1945, 120, 1943, 680, 1409, 850, 630, 288, 38, 695, 569, 106, 587, 208, 370, 606, 766, 535, 616, 200, 170, 224, 422, 970, 978, 498, 284, 241, 210, 151, 194, 178, 814, 205, 189, 215, 111, 236, 147, 237, 191, 691, 212, 432, 499, 445, 176, 333, 129, 414, 617, 380, 251, 199, 524, 515, 681, 160, 259, 295, 283, 178, 472, 786, 520, 202, 575, 575, 349, 549, 458, 166, 173, 508, 1522, 743, 414, 431, 393, 899, 137, 270, 131, 472, 457, 205, 778, 801, 133, 3000],
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Note how this first entry is the "common core-js" stuff, the same value as was in baseSize.

@ftservice ftservice linked an issue Feb 28, 2023 that may be closed by this pull request
@connorjclark connorjclark merged commit 91d457b into main Mar 15, 2023
@connorjclark connorjclark deleted the leg-js-focus-visible branch March 15, 2023 23:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Phone
4 participants