Skip to content

Commit 7ea75ed

Browse files
committed
show some categories as alternatives to sveltekit functionality
1 parent 704b712 commit 7ea75ed

File tree

4 files changed

+35
-28
lines changed

4 files changed

+35
-28
lines changed

apps/svelte.dev/src/lib/packages-meta.ts

Lines changed: 26 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ const SV_ADD_CMD: Record<string, { alias: string; options?: string }> = {
3636
'@sveltejs/adapter-netlify': { alias: 'sveltekit-adapter', options: 'adapter:netlify' }
3737
};
3838

39-
const FEATURED: { title: string; packages: string[]; weights?: Record<string, number> }[] = [
39+
const FEATURED: { title: string; alternative?: string; packages: string[]; weights?: Record<string, number> }[] = [
4040
{
4141
title: 'Component libraries',
4242
packages: [
@@ -94,17 +94,6 @@ const FEATURED: { title: string; packages: string[]; weights?: Record<string, nu
9494
'phosphor-svelte'
9595
]
9696
},
97-
{
98-
title: 'Router',
99-
packages: [
100-
'@sveltejs/kit',
101-
'svelte-routing',
102-
'@roxi/routify',
103-
'svelte5-router',
104-
'svelte-pathfinder',
105-
'universal-router'
106-
]
107-
},
10897
{
10998
title: 'Data visualization',
11099
packages: [
@@ -168,17 +157,6 @@ const FEATURED: { title: string; packages: string[]; weights?: Record<string, nu
168157
'svelte-easy-crop'
169158
]
170159
},
171-
{
172-
title: 'Data fetching',
173-
packages: [
174-
'@urql/svelte',
175-
'trpc-sveltekit',
176-
'sswr',
177-
'@tanstack/svelte-query',
178-
'@orpc/svelte-query',
179-
'houdini'
180-
]
181-
},
182160
{
183161
title: 'SEO',
184162
packages: ['svelte-meta-tags', '@sveltejs/amp', 'svelte-seo', 'super-sitemap', 'svead']
@@ -217,8 +195,33 @@ const FEATURED: { title: string; packages: string[]; weights?: Record<string, nu
217195
// 'vitest'
218196
// ]
219197
// },
198+
{
199+
title: 'Router',
200+
alternative: 'SvelteKit',
201+
packages: [
202+
'@sveltejs/kit',
203+
'svelte-routing',
204+
'@roxi/routify',
205+
'svelte5-router',
206+
'svelte-pathfinder',
207+
'universal-router'
208+
]
209+
},
210+
{
211+
title: 'Data fetching',
212+
alternative: 'SvelteKit remote functions',
213+
packages: [
214+
'@urql/svelte',
215+
'trpc-sveltekit',
216+
'sswr',
217+
'@tanstack/svelte-query',
218+
'@orpc/svelte-query',
219+
'houdini'
220+
]
221+
},
220222
{
221223
title: 'Forms',
224+
alternative: 'SvelteKit forms',
222225
packages: ['sveltekit-superforms', '@tanstack/svelte-form', 'formsnap', 'felte']
223226
}
224227
];

apps/svelte.dev/src/routes/packages/+page.server.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,17 +21,18 @@ const arrToPackages = (arr: string[]) => {
2121
};
2222

2323
// Netflix style page. Send pre-done cards with categories
24-
const homepage: { title: string; href?: string; packages: Package[] }[] = [
24+
const homepage: { title: string; href?: string; alternative?: string; packages: Package[] }[] = [
2525
{
2626
title: 'Svelte CLI add-ons',
2727
href: '/docs/cli',
2828
packages: arrToPackages(PACKAGES_META.SV_ADD.packages)
2929
}
3030
];
3131

32-
for (const { packages, title } of PACKAGES_META.FEATURED) {
32+
for (const { packages, title, alternative } of PACKAGES_META.FEATURED) {
3333
homepage.push({
3434
title,
35+
alternative,
3536
packages: arrToPackages(packages)
3637
});
3738
}

apps/svelte.dev/src/routes/packages/+page.svelte

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,8 +22,8 @@
2222

2323
<div class="page content">
2424
<div in:fly={{ y: 20 }}>
25-
{#each data.homepage as { title, href, packages }}
26-
<Category {title} {href} {packages} />
25+
{#each data.homepage as { title, alternative, href, packages }}
26+
<Category {title} {alternative} {href} {packages} />
2727
{/each}
2828
</div>
2929
</div>

apps/svelte.dev/src/routes/packages/Category.svelte

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
packages: Package[];
99
}
1010
11-
let { title, href, packages }: Props = $props();
11+
let { title, alternative, href, packages }: Props = $props();
1212
1313
let content: HTMLElement;
1414
let scroller: HTMLElement;
@@ -42,6 +42,9 @@
4242
{#if href}
4343
(<a {href}>docs</a>)
4444
{/if}
45+
{#if alternative}
46+
(if not using {alternative})
47+
{/if}
4548
</h2>
4649

4750
{#if !at_start || !at_end}

0 commit comments

Comments
 (0)