Fixing issues after SvelteKit v2 upgrade.

This commit is contained in:
Bradley Shellnut 2023-12-15 11:03:46 -08:00
parent 5bd28523ee
commit 7c68536362
4 changed files with 9 additions and 17 deletions

View file

@ -52,7 +52,6 @@
"sharp": "^0.32.6",
"svelte": "^4.2.8",
"svelte-check": "^3.6.2",
"svelte-lazy-loader": "^1.0.0",
"svelte-meta-tags": "^3.1.0",
"svelte-preprocess": "^5.1.2",
"svelte-sequential-preprocessor": "^2.0.1",

View file

@ -130,9 +130,6 @@ devDependencies:
svelte-check:
specifier: ^3.6.2
version: 3.6.2(postcss-load-config@4.0.2)(postcss@8.4.32)(sass@1.69.5)(svelte@4.2.8)
svelte-lazy-loader:
specifier: ^1.0.0
version: 1.0.0
svelte-meta-tags:
specifier: ^3.1.0
version: 3.1.0(svelte@4.2.8)(typescript@5.3.3)
@ -4703,10 +4700,6 @@ packages:
svelte: 4.2.8
dev: true
/svelte-lazy-loader@1.0.0:
resolution: {integrity: sha512-AZD6R60vksyojn21FgXLglmBiBB9K5Dkdu0hdGrLbCaRCYT68IsWkZfRUqKhMx1IfzqWcZQ8X9y/f+Ih0oNQkQ==}
dev: true
/svelte-meta-tags@3.1.0(svelte@4.2.8)(typescript@5.3.3):
resolution: {integrity: sha512-wFBfpktSua1R5rdvQ/aFucvXmRqzDhRYrPpMQ/pL4+KL5QHIzomPf29a5WN3yDR0reSy1PXyQ2ah0+uCYCbi0g==}
peerDependencies:

View file

@ -23,11 +23,6 @@
]
}
}
// [
// { format: 'avif', src: `${album.artwork}`, width: 230, height: 230 },
// { format: 'webp', src: `${album.artwork}`, width: 230, height: 230 },
// { format: 'jpg', src: `${album.artwork}`, width: 230, height: 230 }
// ]
}
</script>

View file

@ -41,8 +41,13 @@ export const load: PageServerLoad = async ({ fetch, setHeaders, url }) => {
url: currentPageUrl
});
const albums = async () => await fetchBandcampAlbums();
const articles = async () => await fetch(`/api/articles?page=1&limit=3`);
const [albums, articles] = await Promise.all([
await fetchBandcampAlbums(),
(await fetch(`/api/articles?page=1&limit=3`)).json()
]);
console.log('Albums', albums);
console.log('Articles', articles);
setHeaders({
'cache-control': 'max-age=43200'
@ -50,7 +55,7 @@ export const load: PageServerLoad = async ({ fetch, setHeaders, url }) => {
return {
baseUrl,
metaTagsChild: metaTags,
albums: albums(),
articlesData: (await articles()).json()
albums,
articlesData: articles
};
};