Skip to content

Commit

Permalink
feat: update new data-preload for sveltekit 1.5.5;
Browse files Browse the repository at this point in the history
  • Loading branch information
migbash committed Feb 13, 2023
1 parent 0a30212 commit 62476fa
Show file tree
Hide file tree
Showing 8 changed files with 35 additions and 31 deletions.
8 changes: 6 additions & 2 deletions src/app.html
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,11 @@

%sveltekit.head%
</head>
<body class="no-scrollbar">
<div id="svelte">%sveltekit.body%</div>
<body
data-sveltekit-preload-data="hover"
class="no-scrollbar">
<div id="svelte">
%sveltekit.body%
</div>
</body>
</html>
12 changes: 6 additions & 6 deletions src/lib/components/_main_/footer/_Footer.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
import { page } from '$app/stores';
import { sessionStore } from '$lib/store/session';
import { onMount } from 'svelte';
// [ℹ] typescript-types;
// [ℹ] typescript-types;
import type { Cache_Single_Lang_Footer_Translation_Response } from '$lib/models/_main_/footer/types';
// [ℹ] image-assets;
import { logDevGroup } from '$lib/utils/debug';
Expand Down Expand Up @@ -74,8 +74,8 @@
});
// [ℹ] IMPORTANT! lang selection [SERVER-SIDE-RENDER]
$: if ($page.routeId != null && !$page.error) {
if ($page.routeId.includes('[lang=lang]')) {
$: if ($page.route.id != null && !$page.error) {
if ($page.route.id.includes('[lang=lang]')) {
server_side_language = $page.params.lang;
homepageURL = '/' + $page.params.lang;
logoLink =
Expand Down Expand Up @@ -190,7 +190,7 @@
on:click={() => reloadPage()}
>
<a
data-sveltekit-prefetch

href={homepageURL}
title={logoLink}
>
Expand Down Expand Up @@ -474,7 +474,7 @@
on:click={() => reloadPage()}
>
<a
data-sveltekit-prefetch

href={homepageURL}
title={logoLink}
>
Expand Down Expand Up @@ -735,7 +735,7 @@
on:click={() => reloadPage()}
>
<a
data-sveltekit-prefetch

href={homepageURL}
title={logoLink}
>
Expand Down
8 changes: 4 additions & 4 deletions src/lib/components/home/league_list/_LeagueList_Widget.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -366,7 +366,7 @@
-->
{#each data.top_geo_leagues as item}
<a
data-sveltekit-prefetch

href={item.urls[
LEAGUE_LIST_WIDGET_DATA_SEO
.lang
Expand Down Expand Up @@ -501,7 +501,7 @@
.toString()
.toLowerCase() && selectedCountryLeagueId === item.country_id}
<a
data-sveltekit-prefetch

href={league.urls[
LEAGUE_LIST_WIDGET_DATA_SEO
.lang
Expand Down Expand Up @@ -576,7 +576,7 @@
-->
{#each leagueSearchData.slice(0, fullLeagueListDisplayNum) as item}
<a
data-sveltekit-prefetch

href={item.urls[
LEAGUE_LIST_WIDGET_DATA_SEO
.lang
Expand Down Expand Up @@ -715,7 +715,7 @@
.toString()
.toLowerCase() && selectedCountryLeagueId === item.country_id}
<a
data-sveltekit-prefetch

href={league.urls[
LEAGUE_LIST_WIDGET_DATA_SEO
.lang
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2521,7 +2521,7 @@

<!--
[ℹ] fixture-teams with FIXTURE-LINK
FIXME: data-sveltekit-prefetch syntax error
FIXME: syntax error
-->
<a
href={fixture?.fixture_link ==
Expand All @@ -2531,7 +2531,7 @@
server_side_language
]}
style="width: inherit;"
data-sveltekit-prefetch

class:disable-anchor={fixture?.fixture_link ==
undefined ||
fixture?.fixture_link[
Expand Down Expand Up @@ -2716,7 +2716,7 @@
-->
{#if fixture?.media_link && fixture?.media_link.length != 0 && fixture?.fixture_link && fixture?.fixture_link[server_side_language]}
<a
data-sveltekit-prefetch

href={fixture
?.fixture_link[
server_side_language
Expand Down Expand Up @@ -3039,7 +3039,7 @@

<!--
[ℹ] fixture-teams with FIXTURE-LINK
FIXME: data-sveltekit-prefetch syntax error
FIXME: syntax error
-->
<a
href={fixture?.fixture_link ==
Expand All @@ -3049,7 +3049,7 @@
server_side_language
]}
style="width: inherit;"
data-sveltekit-prefetch

class:disable-anchor={fixture?.fixture_link ==
undefined ||
fixture?.fixture_link[
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
import { userBetarenaSettings } from '$lib/store/user-settings';
import { removeDiacritics } from '$lib/utils/languages';
/*
/*
[v1]
Standard Imports (client-side)
*/
Expand All @@ -22,7 +22,7 @@
import StandingsWidget from '$lib/components/tournaments_page/standings/_Standings_Widget.svelte';
import TopPlayersWidget from '$lib/components/tournaments_page/top_players/_Top_Players_Widget.svelte';
import SvelteSeo from 'svelte-seo';
/*
/*
[v2]
Dynamic Imports (client-side)
*/
Expand Down Expand Up @@ -321,7 +321,7 @@
class="row-space-start m-b-20"
>
<a
data-sveltekit-prefetch

href={$page.params.lang != undefined
? `/${$page.params.lang}/${$page.params.sport}`
: `/${$page.params.sport}`}
Expand All @@ -342,7 +342,7 @@
/>

<a
data-sveltekit-prefetch

href={$page.params.lang != undefined
? `/${$page.params.lang}/${$page.params.sport}/${$page.params.country}`
: `/${$page.params.sport}/${$page.params.country}`}
Expand Down
6 changes: 3 additions & 3 deletions src/routes/[lang=lang]/[sport]/[fixture=fixture]/+page.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -318,7 +318,7 @@
[ℹ] sport
-->
<a
data-sveltekit-prefetch

href={$page.params.lang != undefined
? `/${$page.params.lang}/${$page.params.sport}`
: `/${$page.params.sport}`}
Expand Down Expand Up @@ -349,7 +349,7 @@
[ℹ] country
-->
<a
data-sveltekit-prefetch

href={$page.params.lang != undefined
? `/${$page.params.lang}/${$page.params.sport}/${country_link}`
: `/${$page.params.sport}/${country_link}`}
Expand Down Expand Up @@ -380,7 +380,7 @@
[ℹ] league_name
-->
<a
data-sveltekit-prefetch

href={$page.params.lang != undefined
? `/${$page.params.lang}/${$page.params.sport}/${country_link}/${league_name_link}`
: `/${$page.params.sport}/${country_link}/${league_name_link}`}
Expand Down
8 changes: 4 additions & 4 deletions src/routes/[sport]/[country]/[league_name]/+page.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
import { userBetarenaSettings } from '$lib/store/user-settings';
import { removeDiacritics } from '$lib/utils/languages';
/*
/*
[v1]
Standard Imports (client-side)
*/
Expand All @@ -22,7 +22,7 @@
import StandingsWidget from '$lib/components/tournaments_page/standings/_Standings_Widget.svelte';
import TopPlayersWidget from '$lib/components/tournaments_page/top_players/_Top_Players_Widget.svelte';
import SvelteSeo from 'svelte-seo';
/*
/*
[v2]
Dynamic Imports (client-side)
*/
Expand Down Expand Up @@ -321,7 +321,7 @@
class="row-space-start m-b-20"
>
<a
data-sveltekit-prefetch

href={$page.params.lang != undefined
? `/${$page.params.lang}/${$page.params.sport}`
: `/${$page.params.sport}`}
Expand All @@ -342,7 +342,7 @@
/>

<a
data-sveltekit-prefetch

href={$page.params.lang != undefined
? `/${$page.params.lang}/${$page.params.sport}/${$page.params.country}`
: `/${$page.params.sport}/${$page.params.country}`}
Expand Down
6 changes: 3 additions & 3 deletions src/routes/[sport]/[fixture=fixture]/+page.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -318,7 +318,7 @@
[ℹ] sport
-->
<a
data-sveltekit-prefetch

href={$page.params.lang != undefined
? `/${$page.params.lang}/${$page.params.sport}`
: `/${$page.params.sport}`}
Expand Down Expand Up @@ -349,7 +349,7 @@
[ℹ] country
-->
<a
data-sveltekit-prefetch

href={$page.params.lang != undefined
? `/${$page.params.lang}/${$page.params.sport}/${country_link}`
: `/${$page.params.sport}/${country_link}`}
Expand Down Expand Up @@ -380,7 +380,7 @@
[ℹ] league_name
-->
<a
data-sveltekit-prefetch

href={$page.params.lang != undefined
? `/${$page.params.lang}/${$page.params.sport}/${country_link}/${league_name_link}`
: `/${$page.params.sport}/${country_link}/${league_name_link}`}
Expand Down

0 comments on commit 62476fa

Please sign in to comment.