Skip to content

Commit 4f77ee6

Browse files
KyleAMathewsKevinVandythruflo
authored
feat: Add tanstack db (#406)
* initial go at adding tanstack/db * combine library layout on home page * docs: finish up coming soon page. * db: link to docs. * run format --------- Co-authored-by: Kevin Van Cott <[email protected]> Co-authored-by: James Arthur <[email protected]>
1 parent 05bffe1 commit 4f77ee6

File tree

11 files changed

+395
-111
lines changed

11 files changed

+395
-111
lines changed

src/components/DocsCalloutQueryGG.tsx

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,8 +23,7 @@ export function DocsCalloutQueryGG() {
2323
<cite className="italic block text-right">—Tanner Linsley</cite>
2424
</blockquote>
2525

26-
<div className="grid justify-center bg-gray-800 dark:bg-gray-100 text-gray-100 dark:text-gray-800 z-10">
27-
</div>
26+
<div className="grid justify-center bg-gray-800 dark:bg-gray-100 text-gray-100 dark:text-gray-800 z-10"></div>
2827

2928
{ppp && (
3029
<>

src/images/electric-dark.svg

Lines changed: 13 additions & 0 deletions
Loading

src/images/electric-light.svg

Lines changed: 13 additions & 0 deletions
Loading

src/libraries/db.tsx

Lines changed: 85 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,85 @@
1+
import { BsCollectionFill } from 'react-icons/bs'
2+
import { VscPreview, VscWand } from 'react-icons/co'
3+
import { Library } from '.'
4+
import { FaGithub, FaBolt, FaCogs } from 'react-icons/fa'
5+
import { BiBookAlt } from 'react-icons/bi'
6+
import { twMerge } from 'tailwind-merge'
7+
8+
const repo = 'tanstack/db'
9+
10+
const textStyles = `text-orange-600 dark:text-orange-500`
11+
12+
export const dbProject = {
13+
id: 'db',
14+
name: 'TanStack DB',
15+
cardStyles: `shadow-xl shadow-orange-700/20 dark:shadow-lg dark:shadow-orange-500/20 text-orange-500 dark:text-orange-400 border-2 border-transparent hover:border-current`,
16+
to: '/db',
17+
tagline: `A reactive client store for building super fast apps on sync`,
18+
description: `TanStack DB extends TanStack Query with collections, live queries and optimistic mutations that keep your UI reactive, consistent and blazing fast 🔥`,
19+
ogImage: 'https://github.com/tanstack/db/raw/main/media/repo-header.png',
20+
badge: 'soon',
21+
bgStyle: `bg-orange-700`,
22+
textStyle: `text-orange-500`,
23+
repo,
24+
latestBranch: 'main',
25+
latestVersion: 'v0',
26+
availableVersions: ['v0'],
27+
colorFrom: `from-orange-500`,
28+
colorTo: `to-orange-700`,
29+
textColor: `text-orange-700`,
30+
frameworks: ['react', 'solid'],
31+
scarfId: '302d0fef-cb3f-43c6-b45c-f055b9745edb',
32+
defaultDocs: 'overview',
33+
menu: [
34+
// {
35+
// icon: <VscPreview />,
36+
// label: 'Examples',
37+
// to: '/db/latest/docs/framework/react/examples/simple',
38+
// },
39+
{
40+
icon: <BiBookAlt />,
41+
label: 'Docs',
42+
to: `https://github.com/${repo}/blob/main/docs/index.md`,
43+
},
44+
{
45+
icon: <FaGithub />,
46+
label: 'Github',
47+
to: `https://github.com/${repo}`,
48+
},
49+
],
50+
featureHighlights: [
51+
{
52+
title: 'Collections',
53+
icon: <BsCollectionFill className={twMerge(textStyles)} />,
54+
description: (
55+
<div>
56+
Collections are typed sets of objects. Sync or load data into them.
57+
Query across them with live queries and write locally to them using
58+
optimistic mutations.
59+
</div>
60+
),
61+
},
62+
{
63+
title: 'Live Queries',
64+
icon: <FaBolt className={twMerge(textStyles)} />,
65+
description: (
66+
<div>
67+
Live queries run reactively against and across collections. They're
68+
super fast, powered by differential dataflow, with support for joins,
69+
filters and aggregates.
70+
</div>
71+
),
72+
},
73+
{
74+
title: 'Optimistic mutations',
75+
icon: <FaCogs className={twMerge(textStyles)} />,
76+
description: (
77+
<div>
78+
Batch and stage instant local changes across collections. Sync
79+
transactions to the backend with automatic management of rollbacks and
80+
optimistic state.
81+
</div>
82+
),
83+
},
84+
],
85+
} satisfies Library

src/libraries/index.tsx

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ import { virtualProject } from './virtual'
1717
import { rangerProject } from './ranger'
1818
import { storeProject } from './store'
1919
import { pacerProject } from './pacer'
20-
// import { optimisticProject } from './optimistic'
20+
import { dbProject } from './db'
2121

2222
export const frameworkOptions = [
2323
{ label: 'React', value: 'react', logo: reactLogo, color: 'bg-blue-500' },
@@ -54,7 +54,7 @@ export type Library = {
5454
| 'ranger'
5555
| 'store'
5656
| 'pacer'
57-
| 'optimistic'
57+
| 'db'
5858
| 'config'
5959
| 'react-charts'
6060
name: string
@@ -107,13 +107,19 @@ export const libraries = [
107107
pacerProject,
108108
storeProject,
109109
rangerProject,
110-
// optimisticProject,
110+
dbProject,
111111
configProject,
112112
] satisfies Library[]
113113

114114
export const librariesByGroup = {
115-
app: [startProject, routerProject],
116-
state: [queryProject, storeProject, pacerProject],
115+
state: [
116+
startProject,
117+
routerProject,
118+
queryProject,
119+
dbProject,
120+
storeProject,
121+
pacerProject,
122+
],
117123
headlessUI: [tableProject, formProject, virtualProject, rangerProject],
118124
other: [configProject],
119125
}

src/libraries/optimistic.tsx

Lines changed: 0 additions & 101 deletions
This file was deleted.

0 commit comments

Comments
 (0)