From 23c1dfec10662f874eb5b772db52f2ed2206408e Mon Sep 17 00:00:00 2001 From: Shinigami Date: Wed, 26 Apr 2023 22:46:00 +0200 Subject: [PATCH] feat: lazy load images (#1969) --- components/common/CommonBlurhash.vue | 44 ++------------------- components/status/StatusAttachment.vue | 2 +- nuxt.config.ts | 4 ++ package.json | 1 + pnpm-lock.yaml | 54 +++++++++++++++++++++++--- 5 files changed, 57 insertions(+), 48 deletions(-) diff --git a/components/common/CommonBlurhash.vue b/components/common/CommonBlurhash.vue index 11f3c95f..42c21698 100644 --- a/components/common/CommonBlurhash.vue +++ b/components/common/CommonBlurhash.vue @@ -1,8 +1,6 @@ diff --git a/components/status/StatusAttachment.vue b/components/status/StatusAttachment.vue index f9c8c133..39c56f4a 100644 --- a/components/status/StatusAttachment.vue +++ b/components/status/StatusAttachment.vue @@ -214,7 +214,7 @@ watch(shouldLoadAttachment, () => { @click="!shouldLoadAttachment ? loadAttachment() : openMediaPreview(attachments ? attachments : [attachment], attachments?.indexOf(attachment) || 0)" > =4'} @@ -12930,6 +12961,17 @@ packages: resolution: {integrity: sha512-hAZsKq7Yy11Zu1DE0OzWjw7nnLZmJZYTDZZyEFHZdUhV8FkH5MCfoU1XMaxXovpyW5nq5scPqq0ZDP9Zyl04oQ==} engines: {node: '>= 10.0.0'} + /unlazy@0.8.8(fast-blurhash@1.1.2)(thumbhash@0.1.1): + resolution: {integrity: sha512-7wro4wypXPr2WurVcuapEYwju9YXkJP9fHT2SgK5e0aegmuGL/M6wPaZNFQMzfMUCiFb5NODxW9lykq7ymOEog==} + peerDependencies: + fast-blurhash: ^1.1.2 + thumbhash: ^0.1.1 + dependencies: + '@unlazy/core': 0.8.8 + fast-blurhash: 1.1.2 + thumbhash: 0.1.1 + dev: true + /unocss@0.51.4(@unocss/webpack@0.51.4)(postcss@8.4.23)(rollup@2.79.1)(vite@4.3.1): resolution: {integrity: sha512-84kRoL29Rk0AKdeS2GGZ+YduW5F0S2on3cSxA2Hh1KlI4MN8Xvxa8+f4RfFS0U5iH4yoHohvcWThRgjDhOWSeg==} engines: {node: '>=14'} @@ -14185,16 +14227,16 @@ packages: resolution: {integrity: sha512-bXE4cR/kVZhKZX/RjPEflHaKVhUVl85noU3v6b8apfQEc1x4A+zBxjZ4lN8LqGd6WZ3dl98pY4o717VFmoPp+A==} dev: true - github.com/tauri-apps/tauri-plugin-log/36100c269e33ac91246b0a4bfadd18c1caee5296: - resolution: {tarball: https://codeload.github.com/tauri-apps/tauri-plugin-log/tar.gz/36100c269e33ac91246b0a4bfadd18c1caee5296} + github.com/tauri-apps/tauri-plugin-log/782a97aeb30cf0f54355d04e6026842fa420bd83: + resolution: {tarball: https://codeload.github.com/tauri-apps/tauri-plugin-log/tar.gz/782a97aeb30cf0f54355d04e6026842fa420bd83} name: tauri-plugin-log-api version: 0.0.0 dependencies: '@tauri-apps/api': 1.2.0 dev: false - github.com/tauri-apps/tauri-plugin-store/df267506bf12de451762f3f4b7f929ebed1421c9: - resolution: {tarball: https://codeload.github.com/tauri-apps/tauri-plugin-store/tar.gz/df267506bf12de451762f3f4b7f929ebed1421c9} + github.com/tauri-apps/tauri-plugin-store/f4ef29684e4a32eddf51befaae98a5e498df8574: + resolution: {tarball: https://codeload.github.com/tauri-apps/tauri-plugin-store/tar.gz/f4ef29684e4a32eddf51befaae98a5e498df8574} name: tauri-plugin-store-api version: 0.0.0 dependencies: