Commit 40bb201
committed
Script Loader: Load block styles on demand in classic themes even when
This reverts part of [61076] which made `wp-block-styles` theme support a precondition for opting in to `should_load_separate_core_block_assets` and `should_load_block_assets_on_demand`. This meant that the Twenty Twenty theme (and other themes without this support declared) would not benefit from on-demand block style loading. Nevertheless, even though such themes were not getting block styles loaded on demand, the `wp_load_classic_theme_block_styles_on_demand()` function was proceeding to opt in to the output buffer for hoisting late-printed styles, even though it was unlikely there would then be any. This meant the template enhancement output buffer was being opened for no reason.
Enabling on-demand block style loading is measured to improve FCP and LCP in Twenty Twenty, for example a ~13% improvement over a Fast 4G connection when loading the Sample Page.
Developed in #10457
Follow-up to [61008], [61076], [60936].
Props westonruter.
See #64099, #64150, #64166, #43258.
git-svn-id: https://develop.svn.wordpress.org/trunk@61122 602fd350-edb4-49c9-b593-d223f7449a82wp-block-styles support is absent.1 parent 5a9dcbc commit 40bb201
File tree
2 files changed
+41
-22
lines changed- src/wp-includes
- tests/phpunit/tests
2 files changed
+41
-22
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
3577 | 3577 | | |
3578 | 3578 | | |
3579 | 3579 | | |
| 3580 | + | |
| 3581 | + | |
3580 | 3582 | | |
3581 | 3583 | | |
| 3584 | + | |
3582 | 3585 | | |
3583 | 3586 | | |
3584 | 3587 | | |
| |||
3590 | 3593 | | |
3591 | 3594 | | |
3592 | 3595 | | |
| 3596 | + | |
3593 | 3597 | | |
3594 | 3598 | | |
3595 | 3599 | | |
3596 | 3600 | | |
| 3601 | + | |
| 3602 | + | |
3597 | 3603 | | |
3598 | | - | |
3599 | | - | |
3600 | | - | |
3601 | | - | |
| 3604 | + | |
| 3605 | + | |
| 3606 | + | |
3602 | 3607 | | |
3603 | | - | |
3604 | | - | |
3605 | | - | |
3606 | | - | |
3607 | | - | |
3608 | | - | |
| 3608 | + | |
3609 | 3609 | | |
3610 | | - | |
3611 | | - | |
| 3610 | + | |
| 3611 | + | |
| 3612 | + | |
| 3613 | + | |
| 3614 | + | |
| 3615 | + | |
| 3616 | + | |
| 3617 | + | |
| 3618 | + | |
3612 | 3619 | | |
3613 | 3620 | | |
3614 | 3621 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1393 | 1393 | | |
1394 | 1394 | | |
1395 | 1395 | | |
1396 | | - | |
| 1396 | + | |
1397 | 1397 | | |
1398 | 1398 | | |
1399 | | - | |
| 1399 | + | |
| 1400 | + | |
1400 | 1401 | | |
1401 | 1402 | | |
1402 | | - | |
| 1403 | + | |
1403 | 1404 | | |
1404 | 1405 | | |
1405 | 1406 | | |
1406 | 1407 | | |
| 1408 | + | |
1407 | 1409 | | |
1408 | 1410 | | |
1409 | 1411 | | |
1410 | | - | |
| 1412 | + | |
1411 | 1413 | | |
1412 | 1414 | | |
1413 | | - | |
| 1415 | + | |
1414 | 1416 | | |
| 1417 | + | |
1415 | 1418 | | |
1416 | | - | |
| 1419 | + | |
1417 | 1420 | | |
1418 | | - | |
| 1421 | + | |
1419 | 1422 | | |
1420 | 1423 | | |
1421 | | - | |
| 1424 | + | |
1422 | 1425 | | |
| 1426 | + | |
1423 | 1427 | | |
| 1428 | + | |
| 1429 | + | |
| 1430 | + | |
| 1431 | + | |
| 1432 | + | |
| 1433 | + | |
| 1434 | + | |
1424 | 1435 | | |
1425 | 1436 | | |
1426 | 1437 | | |
| |||
1436 | 1447 | | |
1437 | 1448 | | |
1438 | 1449 | | |
1439 | | - | |
| 1450 | + | |
1440 | 1451 | | |
1441 | 1452 | | |
1442 | 1453 | | |
| |||
1447 | 1458 | | |
1448 | 1459 | | |
1449 | 1460 | | |
| 1461 | + | |
1450 | 1462 | | |
1451 | | - | |
| 1463 | + | |
1452 | 1464 | | |
1453 | 1465 | | |
1454 | 1466 | | |
| |||
0 commit comments