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

perf (lazysizes): remove lazysizes, use native lazy attribute instead #433

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
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
1 change: 0 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@
"license": "GPL-2.0",
"dependencies": {
"@fontsource/poppins": "^5.0.5",
"lazysizes": "^5.3.2",
"oneloop.js": "^5.2.1"
},
"devDependencies": {
Expand Down
11 changes: 0 additions & 11 deletions src/js/editor.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,21 +2,10 @@

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

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

/**
* LazySizes configuration
* https://github.com/aFarkas/lazysizes/#js-api---options
*/
lazySizes.cfg.nativeLoading = {
setLoadingAttribute: false,
}

// Native Gutenberg
domReady(() => {
// Disable specific block styles
Expand Down
2 changes: 0 additions & 2 deletions src/js/index.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
import 'lazysizes'
import 'lazysizes/plugins/print/ls.print'
import './classes/ScrollDirection'
import './classes/ButtonSeoClick'
import './classes/Header'
Expand Down
5 changes: 0 additions & 5 deletions src/scss/02-tools/_m-placeholder-media.scss
Original file line number Diff line number Diff line change
Expand Up @@ -28,11 +28,6 @@
content: "";
}

.lazyload,
.lazyloading {
height: 0;
}

#{$targets} {
position: absolute;
top: 0;
Expand Down
76 changes: 0 additions & 76 deletions src/scss/04-utilities/_lazyload.scss

This file was deleted.

1 change: 0 additions & 1 deletion src/scss/04-utilities/utilities.scss
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
@import "./wp-admin-bar";
@import "./focus";
@import "./lazyload";
@import "./seo";
@import "./video-wrapper";
@import "./palette";
Expand Down
8 changes: 0 additions & 8 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -2026,7 +2026,6 @@ __metadata:
imagemin-optipng: ^8.0.0
imagemin-svgo: ^10.0.1
js-yaml: ^4.1.0
lazysizes: ^5.3.2
mini-css-extract-plugin: ^1.5.0
oneloop.js: ^5.2.0
portfinder: ^1.0.28
Expand Down Expand Up @@ -6847,13 +6846,6 @@ __metadata:
languageName: node
linkType: hard

"lazysizes@npm:^5.3.2":
version: 5.3.2
resolution: "lazysizes@npm:5.3.2"
checksum: 6126c800bee810e27961ceab39e6940391f54ce42241cf11dcdc5effcf42d0f4ba509a6c126f578a20ba4d60ad6a9fbae2b2518c168494fa0184b644dac65bda
languageName: node
linkType: hard

"levn@npm:^0.4.1":
version: 0.4.1
resolution: "levn@npm:0.4.1"
Expand Down
Loading