Skip to content

Commit dae4418

Browse files
authored
update readme (#1735)
* update readme * fix(website): move redirects to Vercel config * update readme * update readme and introduction * update introduction * fix(website): revise redirects * update introduction
1 parent 0c195b0 commit dae4418

File tree

4 files changed

+171
-83
lines changed

4 files changed

+171
-83
lines changed

docs/introduction.mdx

Lines changed: 7 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -4,18 +4,15 @@ description: Table of contents
44
nav: 0
55
---
66

7-
Welcome to the Jotai documentation! Jotai is a primitive and flexible state management library for React.
8-
9-
It takes a bottom-up approach to global React state management with an atomic model inspired by Recoil. One can build state by combining atoms and renders are optimized based on atom dependency. This solves the extra re-render issue of React context and eliminates the need for memoization.
7+
Welcome to the Jotai v2 documentation! Jotai's atomic approach to global React state management scales from a simple `useState` replacement to an enterprise application with complex requirements.
108

119
## Features
1210

13-
- Minimal API
11+
- Minimal core API (2kb)
12+
- Many utilities and integrations
1413
- TypeScript oriented
15-
- Tiny core bundle size (2kb)
16-
- Many extra utilities and integrations
17-
- Supports Next.js, Gatsby, Remix, and React Native
18-
- Great developer experience with React Fast Refresh
14+
- Works with Next.js, Gatsby, Remix, and React Native
15+
- React Fast Refresh with SWC and Babel plugins
1916

2017
## Core
2118

@@ -25,7 +22,7 @@ Jotai has a very minimal API, exposing only a few exports from the main `jotai`
2522

2623
## Utilities
2724

28-
Jotai also includes a `jotai/utils` bundle with a variety of extra utility functions. One example is `atomWithStorage`, which includes localStorage persistence and browser tab synchronization.
25+
Jotai also includes a `jotai/utils` bundle with a variety of extra utility functions. One example is `atomWithStorage`, which includes localStorage persistence and cross browser tab synchronization.
2926

3027
<TOC section="utilities" />
3128

@@ -37,7 +34,7 @@ Jotai has separate bundles for many official integrations including `atomWithQue
3734

3835
## Tools
3936

40-
There are also SWC and Babel compiler plugins for React Fast Refresh support and debugging labels to provide the best developer experience when using Jotai in a React framework such as Next.js or Gatsby.
37+
There are also SWC and Babel compiler plugins for React Fast Refresh support and debugging labels. This creates the best developer experience when using Jotai with a React framework such as Next.js or Gatsby.
4138

4239
<TOC section="tools" />
4340

readme.md

Lines changed: 12 additions & 66 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55

66
<br>
77

8-
`npm i jotai` or visit [jotai.org](https://jotai.org)
8+
visit [jotai.org](https://jotai.org) or `npm i jotai`
99

1010
[![Build Status](https://img.shields.io/github/actions/workflow/status/pmndrs/jotai/lint-and-type.yml?branch=main&style=flat&colorA=000000&colorB=000000)](https://github.com/pmndrs/jotai/actions?query=workflow%3ALint)
1111
[![Build Size](https://img.shields.io/bundlephobia/minzip/jotai?label=bundle%20size&style=flat&colorA=000000&colorB=000000)](https://bundlephobia.com/result?p=jotai)
@@ -14,17 +14,14 @@
1414
[![Discord Shield](https://img.shields.io/discord/740090768164651008?style=flat&colorA=000000&colorB=000000&label=discord&logo=discord&logoColor=ffffff)](https://discord.gg/poimandres)
1515
[![Open Collective](https://img.shields.io/opencollective/all/jotai?style=flat&colorA=000000&colorB=000000)](https://opencollective.com/jotai)
1616

17-
Jotai is pronounced "joe-tie" and means "state" in Japanese.
17+
Jotai scales from a simple useState replacement to an enterprise TypeScript application.
1818

19-
You can try live demos in the following:
20-
[Demo 1](https://codesandbox.io/s/jotai-demo-47wvh) |
21-
[Demo 2](https://codesandbox.io/s/jotai-demo-forked-x2g5d).
19+
- Minimal core API (2kb)
20+
- Many utilities and integrations
21+
- No string keys (compared to Recoil)
2222

23-
#### How does Jotai differ from Recoil?
24-
25-
- Minimalistic API
26-
- No string keys
27-
- TypeScript oriented
23+
Examples: [Demo 1](https://codesandbox.io/s/jotai-demo-47wvh) |
24+
[Demo 2](https://codesandbox.io/s/jotai-demo-forked-x2g5d)
2825

2926
### First create a primitive atom
3027

@@ -72,8 +69,6 @@ function DoubleCounter() {
7269
}
7370
```
7471
75-
## Recipes
76-
7772
### Creating an atom from multiple atoms
7873
7974
You can combine multiple atoms to create a derived atom.
@@ -165,57 +160,8 @@ function Controls() {
165160
...
166161
```
167162
168-
## Learn Jotai
169-
170-
[![free egghead Jotai introduction course by Daishi](./img/jotai-course-banner.jpg)](https://egghead.io/courses/manage-application-state-with-jotai-atoms-2c3a29f0?utm_source=github&utm_medium=cta&utm_term=jotai)
171-
172-
## More documents
173-
174-
- Core
175-
- [atom](./docs/core/atom.mdx)
176-
- [useAtom](./docs/core/use-atom.mdx)
177-
- [Store](./docs/core/store.mdx)
178-
- [Provider](./docs/core/provider.mdx)
179-
- Utilities
180-
- [Storage](./docs/utilities/storage.mdx)
181-
- [SSR](./docs/utilities/ssr.mdx)
182-
- [Async](./docs/utilities/async.mdx)
183-
- [Resettable](./docs/utilities/resettable.mdx)
184-
- [Family](./docs/utilities/family.mdx)
185-
- Integrations
186-
- [tRPC](./docs/integrations/trpc.mdx)
187-
- [Query](./docs/integrations/query.mdx)
188-
- [URQL](./docs/integrations/urql.mdx)
189-
- [Immer](./docs/integrations/immer.mdx)
190-
- [XState](./docs/integrations/xstate.mdx)
191-
- [Location](./docs/integrations/location.mdx)
192-
- [Cache](./docs/integrations/cache.mdx)
193-
- [Molecules](./docs/integrations/molecules.mdx)
194-
- [Optics](./docs/integrations/optics.mdx)
195-
- Tools
196-
- [SWC](./docs/tools/swc.mdx)
197-
- [Babel](./docs/tools/babel.mdx)
198-
- [Devtools](./docs/tools/devtools.mdx)
199-
- Basics
200-
- [Concepts](./docs/basics/concepts.mdx)
201-
- [Comparison](./docs/basics/comparison.mdx)
202-
- [Showcase](./docs/basics/showcase.mdx)
203-
- Guides
204-
- [v2 API migration](./docs/guides/migrating-to-v2-api.mdx)
205-
- [TypeScript](./docs/guides/typescript.mdx)
206-
- [Next.js](./docs/guides/nextjs.mdx)
207-
- [Gatsby](./docs/guides/gatsby.mdx)
208-
- [Remix](./docs/guides/remix.mdx)
209-
- [React Native](./docs/guides/react-native.mdx)
210-
- [Debugging](./docs/guides/debugging.mdx)
211-
- [Performance](./docs/guides/performance.mdx)
212-
- [Testing](./docs/guides/testing.mdx)
213-
- [Core internals](./docs/guides/core-internals.mdx)
214-
- [Composing atoms](./docs/guides/composing-atoms.mdx)
215-
- [Atoms in atom](./docs/guides/atoms-in-atom.mdx)
216-
- [Initializing state on render](./docs/guides/initialize-atom-on-render.mdx)
217-
- [Persistence](./docs/guides/persistence.mdx)
218-
- Recipes
219-
- [Large objects](./docs/advanced-recipes/large-objects.mdx)
220-
- [Atom creators](./docs/advanced-recipes/atom-creators.mdx)
221-
- [Custom useAtom hooks](./docs/advanced-recipes/custom-useatom-hooks.mdx)
163+
## Links
164+
165+
- [website](https://jotai.org)
166+
- [documentation](https://jotai.org/docs)
167+
- [course](https://egghead.io/courses/manage-application-state-with-jotai-atoms-2c3a29f0)

website/src/pages/index.js

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -18,15 +18,18 @@ export default function HomePage() {
1818
<div className="space-y-4">
1919
<Headline>Introduction</Headline>
2020
<p>
21-
Jotai takes a bottom-up approach to global React state management with an atomic model
22-
inspired by Recoil. One can build state by combining atoms and renders are optimized
23-
based on atom dependency. This solves the extra re-render issue of React context and
24-
eliminates the need for memoization.
21+
Jotai takes an atomic approach to global React state management with a model inspired by
22+
Recoil.
2523
</p>
2624
<p>
27-
It’s scalable from a simple <InlineCode>useState</InlineCode> replacement all the way to
28-
an enterprise TypeScript application with complex requirements. Plus there are plenty of
29-
built-in utilities and officially maintained integrations to help you along the way!
25+
Build state by combining atoms and renders are automatically optimized based on atom
26+
dependency. This solves the extra re-render issue of React context and eliminates the
27+
need for memoization.
28+
</p>
29+
<p>
30+
It scales from a simple <InlineCode>useState</InlineCode> replacement to an enterprise
31+
TypeScript application with complex requirements. Plus there are plenty of utilities and
32+
integrations to help you along the way!
3033
</p>
3134
<p>Jotai is trusted in production by teams at innovative companies like these.</p>
3235
<LogoCloud />

website/vercel.json

Lines changed: 142 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,5 +5,147 @@
55
"maxDuration": 30
66
}
77
},
8+
"redirects": [
9+
{
10+
"source": "/docs",
11+
"destination": "/docs/introduction",
12+
"permanent": false
13+
},
14+
{
15+
"source": "/docs/utils/:slug",
16+
"destination": "/docs/utilities/:slug",
17+
"permanent": false
18+
},
19+
{
20+
"source": "/docs/advanced-recipes/:slug",
21+
"destination": "/docs/recipes/:slug",
22+
"permanent": false
23+
},
24+
{
25+
"source": "/docs/api/babel",
26+
"destination": "/docs/tools/babel",
27+
"permanent": false
28+
},
29+
{
30+
"source": "/docs/api/core",
31+
"destination": "/docs/core/atom",
32+
"permanent": false
33+
},
34+
{
35+
"source": "/docs/api/devtools",
36+
"destination": "/docs/tools/devtools",
37+
"permanent": false
38+
},
39+
{
40+
"source": "/docs/api/devtools",
41+
"destination": "/docs/tools/devtools",
42+
"permanent": false
43+
},
44+
{
45+
"source": "/docs/api/swc",
46+
"destination": "/docs/tools/swc",
47+
"permanent": false
48+
},
49+
{
50+
"source": "/docs/api/utils",
51+
"destination": "/docs/tools/introduction",
52+
"permanent": false
53+
},
54+
{
55+
"source": "/docs/utils/atom-family",
56+
"destination": "/docs/utilities/family",
57+
"permanent": false
58+
},
59+
{
60+
"source": "/docs/utils/atom-with-default",
61+
"destination": "/docs/utilities/resettable",
62+
"permanent": false
63+
},
64+
{
65+
"source": "/docs/utils/atom-with-hash",
66+
"destination": "/docs/integrations/location",
67+
"permanent": false
68+
},
69+
{
70+
"source": "/docs/utils/atom-with-observable",
71+
"destination": "/docs/utilities/async",
72+
"permanent": false
73+
},
74+
{
75+
"source": "/docs/utils/atom-with-reducer",
76+
"destination": "/docs/utilities/reducer",
77+
"permanent": false
78+
},
79+
{
80+
"source": "/docs/utils/atom-with-reset",
81+
"destination": "/docs/utilities/resettable",
82+
"permanent": false
83+
},
84+
{
85+
"source": "/docs/utils/atom-with-storage",
86+
"destination": "/docs/utilities/storage",
87+
"permanent": false
88+
},
89+
{
90+
"source": "/docs/utils/freeze-atom-creator",
91+
"destination": "/docs/tools/devtools",
92+
"permanent": false
93+
},
94+
{
95+
"source": "/docs/utils/freeze-atom",
96+
"destination": "/docs/tools/devtools",
97+
"permanent": false
98+
},
99+
{
100+
"source": "/docs/utils/loadable",
101+
"destination": "/docs/utilities/async",
102+
"permanent": false
103+
},
104+
{
105+
"source": "/docs/utils/reset",
106+
"destination": "/docs/utilities/resettable",
107+
"permanent": false
108+
},
109+
{
110+
"source": "/docs/utils/select-atom",
111+
"destination": "/docs/utilities/select",
112+
"permanent": false
113+
},
114+
{
115+
"source": "/docs/utils/split-atom",
116+
"destination": "/docs/utilities/split",
117+
"permanent": false
118+
},
119+
{
120+
"source": "/docs/utils/use-atom-callback",
121+
"destination": "/docs/utilities/callback",
122+
"permanent": false
123+
},
124+
{
125+
"source": "/docs/utils/use-atom-value",
126+
"destination": "/docs/core/use-atom",
127+
"permanent": false
128+
},
129+
{
130+
"source": "/docs/utils/use-hydrate-atoms",
131+
"destination": "/docs/utilities/ssr",
132+
"permanent": false
133+
},
134+
{
135+
"source": "/docs/utils/use-reducer-atom",
136+
"destination": "/docs/utilities/reducer",
137+
"permanent": false
138+
},
139+
{
140+
"source": "/docs/utils/use-reset-atom",
141+
"destination": "/docs/utilities/resttable",
142+
"permanent": false
143+
},
144+
{
145+
"source": "/docs/utils/use-update-atom",
146+
"destination": "/docs/core/use-atom",
147+
"permanent": false
148+
}
149+
],
8150
"trailingSlash": false
9151
}

0 commit comments

Comments
 (0)