Skip to content

Commit 9b89893

Browse files
committed
perf (lazysizes): remove lazysizes, use native lazy attribute instead
1 parent 911dae3 commit 9b89893

File tree

7 files changed

+100
-139
lines changed

7 files changed

+100
-139
lines changed

package.json

-1
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,6 @@
1717
"license": "GPL-2.0",
1818
"dependencies": {
1919
"@fontsource/poppins": "^5.0.5",
20-
"lazysizes": "^5.3.2",
2120
"oneloop.js": "^5.2.1"
2221
},
2322
"devDependencies": {

src/js/editor.js

-11
Original file line numberDiff line numberDiff line change
@@ -2,21 +2,10 @@
22

33
/* Customize BFFEditorSettings in inc/Services/Editor.php or with `bff_editor_custom_settings` filter (see readme). */
44

5-
import lazySizes from 'lazysizes'
6-
import 'lazysizes/plugins/native-loading/ls.native-loading'
7-
import 'lazysizes/plugins/object-fit/ls.object-fit'
85
import domReady from '@wordpress/dom-ready'
96
import { addFilter } from '@wordpress/hooks'
107
import { unregisterBlockStyle, getBlockVariations, unregisterBlockVariation } from '@wordpress/blocks'
118

12-
/**
13-
* LazySizes configuration
14-
* https://github.com/aFarkas/lazysizes/#js-api---options
15-
*/
16-
lazySizes.cfg.nativeLoading = {
17-
setLoadingAttribute: false,
18-
}
19-
209
// Native Gutenberg
2110
domReady(() => {
2211
// Disable specific block styles

src/js/index.js

-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
import 'lazysizes'
2-
import 'lazysizes/plugins/print/ls.print'
31
import './classes/ScrollDirection'
42
import './classes/ButtonSeoClick'
53
import './classes/Header'

src/scss/02-tools/_m-placeholder-media.scss

-5
Original file line numberDiff line numberDiff line change
@@ -28,11 +28,6 @@
2828
content: "";
2929
}
3030

31-
.lazyload,
32-
.lazyloading {
33-
height: 0;
34-
}
35-
3631
#{$targets} {
3732
position: absolute;
3833
top: 0;

src/scss/04-utilities/_lazyload.scss

-76
This file was deleted.

src/scss/04-utilities/utilities.scss

-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
@import "./wp-admin-bar";
22
@import "./focus";
3-
@import "./lazyload";
43
@import "./seo";
54
@import "./video-wrapper";
65
@import "./palette";

0 commit comments

Comments
 (0)