Skip to content

Commit

Permalink
docs: new documentation structure (#621)
Browse files Browse the repository at this point in the history
* docs: setup new documentation structure

* docs: fix build after re-arrange

* docs: add getting-started/setup page

* docs: add learning

* fix: background image bouncing
on in mobile browsers on scroll

* docs: add testing examples

* docs: update docs

* docs: debugging section

* fix: build after rebase

* docs: fix internal links

* docs: add intro

Co-authored-by: Arutiunian Artem <[email protected]>

* Update docs/src/content/docs/getting-started/learning.md

Co-authored-by: Arutiunian Artem <[email protected]>

* Update docs/src/content/docs/getting-started/debugging.md

Co-authored-by: Arutiunian Artem <[email protected]>

* docs: improve learning section according feedback

* docs: remove unfinished recipes

* docs: less complex example in setup section

* docs: a note about vite template

---------

Co-authored-by: BANO <[email protected]>
Co-authored-by: Arutiunian Artem <[email protected]>
  • Loading branch information
3 people authored Oct 31, 2023
1 parent 9db8276 commit 23e7380
Show file tree
Hide file tree
Showing 27 changed files with 1,241 additions and 559 deletions.
142 changes: 92 additions & 50 deletions docs/.astro/types.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -264,6 +264,13 @@ declare module 'astro:content' {
collection: "docs";
data: InferEntrySchema<"docs">
} & { render(): Render[".md"] };
"contributing.md": {
id: "contributing.md";
slug: "contributing";
body: string;
collection: "docs";
data: InferEntrySchema<"docs">
} & { render(): Render[".md"] };
"core.md": {
id: "core.md";
slug: "core";
Expand All @@ -278,65 +285,37 @@ declare module 'astro:content' {
collection: "docs";
data: InferEntrySchema<"docs">
} & { render(): Render[".md"] };
"general/what-is-state-manager.md": {
id: "general/what-is-state-manager.md";
slug: "general/what-is-state-manager";
body: string;
collection: "docs";
data: InferEntrySchema<"docs">
} & { render(): Render[".md"] };
"guides/architecture.md": {
id: "guides/architecture.md";
slug: "guides/architecture";
body: string;
collection: "docs";
data: InferEntrySchema<"docs">
} & { render(): Render[".md"] };
"guides/atomization.md": {
id: "guides/atomization.md";
slug: "guides/atomization";
body: string;
collection: "docs";
data: InferEntrySchema<"docs">
} & { render(): Render[".md"] };
"guides/contributing.md": {
id: "guides/contributing.md";
slug: "guides/contributing";
"getting-started/debugging.md": {
id: "getting-started/debugging.md";
slug: "getting-started/debugging";
body: string;
collection: "docs";
data: InferEntrySchema<"docs">
} & { render(): Render[".md"] };
"guides/custom-operator.md": {
id: "guides/custom-operator.md";
slug: "guides/custom-operator";
"getting-started/learning.md": {
id: "getting-started/learning.md";
slug: "getting-started/learning";
body: string;
collection: "docs";
data: InferEntrySchema<"docs">
} & { render(): Render[".md"] };
"guides/debug.md": {
id: "guides/debug.md";
slug: "guides/debug";
"getting-started/setup.md": {
id: "getting-started/setup.md";
slug: "getting-started/setup";
body: string;
collection: "docs";
data: InferEntrySchema<"docs">
} & { render(): Render[".md"] };
"guides/lifecycle.md": {
id: "guides/lifecycle.md";
slug: "guides/lifecycle";
"getting-started/testing.md": {
id: "getting-started/testing.md";
slug: "getting-started/testing";
body: string;
collection: "docs";
data: InferEntrySchema<"docs">
} & { render(): Render[".md"] };
"guides/naming.md": {
id: "guides/naming.md";
slug: "guides/naming";
body: string;
collection: "docs";
data: InferEntrySchema<"docs">
} & { render(): Render[".md"] };
"guides/typescript.md": {
id: "guides/typescript.md";
slug: "guides/typescript";
"getting-started/try-online.md": {
id: "getting-started/try-online.md";
slug: "getting-started/try-online";
body: string;
collection: "docs";
data: InferEntrySchema<"docs">
Expand Down Expand Up @@ -425,13 +404,41 @@ declare module 'astro:content' {
collection: "docs";
data: InferEntrySchema<"docs">
} & { render(): Render[".md"] };
"package/npm-cookie-baker.md": {
id: "package/npm-cookie-baker.md";
slug: "package/npm-cookie-baker";
body: string;
collection: "docs";
data: InferEntrySchema<"docs">
} & { render(): Render[".md"] };
"package/npm-history.md": {
id: "package/npm-history.md";
slug: "package/npm-history";
body: string;
collection: "docs";
data: InferEntrySchema<"docs">
} & { render(): Render[".md"] };
"package/npm-react.md": {
id: "package/npm-react.md";
slug: "package/npm-react";
body: string;
collection: "docs";
data: InferEntrySchema<"docs">
} & { render(): Render[".md"] };
"package/npm-solid-js.md": {
id: "package/npm-solid-js.md";
slug: "package/npm-solid-js";
body: string;
collection: "docs";
data: InferEntrySchema<"docs">
} & { render(): Render[".md"] };
"package/npm-svelte.md": {
id: "package/npm-svelte.md";
slug: "package/npm-svelte";
body: string;
collection: "docs";
data: InferEntrySchema<"docs">
} & { render(): Render[".md"] };
"package/persist-web-storage.md": {
id: "package/persist-web-storage.md";
slug: "package/persist-web-storage";
Expand Down Expand Up @@ -495,20 +502,55 @@ declare module 'astro:content' {
collection: "docs";
data: InferEntrySchema<"docs">
} & { render(): Render[".md"] };
"repl.mdx": {
id: "repl.mdx";
slug: "repl";
"recipes/atomization.md": {
id: "recipes/atomization.md";
slug: "recipes/atomization";
body: string;
collection: "docs";
data: InferEntrySchema<"docs">
} & { render(): Render[".mdx"] };
"tutorial.md": {
id: "tutorial.md";
slug: "tutorial";
} & { render(): Render[".md"] };
"recipes/data-fetching.md": {
id: "recipes/data-fetching.md";
slug: "recipes/data-fetching";
body: string;
collection: "docs";
data: InferEntrySchema<"docs">
} & { render(): Render[".md"] };
"recipes/data-persisting.md": {
id: "recipes/data-persisting.md";
slug: "recipes/data-persisting";
body: string;
collection: "docs";
data: InferEntrySchema<"docs">
} & { render(): Render[".md"] };
"recipes/forms.md": {
id: "recipes/forms.md";
slug: "recipes/forms";
body: string;
collection: "docs";
data: InferEntrySchema<"docs">
} & { render(): Render[".md"] };
"recipes/share-state.md": {
id: "recipes/share-state.md";
slug: "recipes/share-state";
body: string;
collection: "docs";
data: InferEntrySchema<"docs">
} & { render(): Render[".md"] };
"recipes/undo-redo.md": {
id: "recipes/undo-redo.md";
slug: "recipes/undo-redo";
body: string;
collection: "docs";
data: InferEntrySchema<"docs">
} & { render(): Render[".md"] };
"repl.mdx": {
id: "repl.mdx";
slug: "repl";
body: string;
collection: "docs";
data: InferEntrySchema<"docs">
} & { render(): Render[".mdx"] };
};

};
Expand Down
43 changes: 18 additions & 25 deletions docs/astro.config.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -25,45 +25,34 @@ export default defineConfig({
customCss: ['./src/styles/custom.css'],
sidebar: [
{
label: 'Core',
link: 'core',
},
{
label: 'Examples',
link: 'examples',
},
{
label: 'Tutorial',
link: 'tutorial',
},
{
label: 'REPL',
link: 'repl',
},
{
label: 'Guides',
label: 'Getting Started',
autogenerate: {
directory: 'guides',
directory: 'getting-started',
},
},
{
label: 'General',
label: 'Recipes',
autogenerate: {
directory: 'general',
directory: 'recipes',
},
},
{
label: 'Examples',
link: 'examples',
},
{
label: 'Handbook',
link: 'handbook',
},
{
label: 'Packages',
autogenerate: {
directory: 'package',
},
},
{
label: 'Adapters',
autogenerate: {
directory: 'adapter',
collapsed: true,
},
label: 'REPL',
link: 'repl',
},
{
label: 'Compat',
Expand All @@ -72,6 +61,10 @@ export default defineConfig({
collapsed: true,
},
},
{
label: 'Contributing',
link: 'contributing',
},
],
}),
],
Expand Down
File renamed without changes.
6 changes: 3 additions & 3 deletions docs/src/content/docs/examples.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,13 +25,13 @@ https://github.com/artalar/RTK-entities-basic-example/pull/1

### Search component

This example is close to real life and shows the complexity of interactive UI. It uses [async package](https://www.reatom.dev/package/async) to handle classic search edge cases and made perfect UX.
This example is close to real life and shows the complexity of interactive UI. It uses [async package](/package/async) to handle classic search edge cases and made perfect UX.

https://codesandbox.io/s/reatom-react-search-component-l4pe8q?file=/src/App.tsx

### Dynamic atom creation

This example shoes how to use [atomization](https://www.reatom.dev/guides/atomization) to improve editable fields performance, persists it to localStorage.
This example shoes how to use [atomization](/recipes/atomization/) to improve editable fields performance, persists it to localStorage.

https://codesandbox.io/s/reatom-react-atomization-k39vrs?file=/src/App.tsx

Expand All @@ -47,7 +47,7 @@ https://github.com/artalar/reatom-react-tree/blob/main/src/model.ts.

### Managing notifications

This example perfectly illustrates the benefits of [atomization](https://www.reatom.dev/guides/atomization/) and reusability within the Reatom ecosystem - [reatom/timer](https://www.reatom.dev/package/timer/).
This example perfectly illustrates the benefits of [atomization](/recipes/atomization/) and reusability within the Reatom ecosystem - [reatom/timer](/package/timer/).

- **Domain-Oriented Code**: You don't need to normalize data, store states in separate lists, select and modify them by IDs. Instead, you can describe the entire logic in one factory, making it safer to create instances of your models. This significantly reduces and simplifies the code. While you can use classes, I prefer factories.
- **Isolated States**: Since states are highly isolated into atoms, they are also easy to use in the view layer. Take a look at App.tsx for an example.
Expand Down
93 changes: 0 additions & 93 deletions docs/src/content/docs/general/what-is-state-manager.md

This file was deleted.

Loading

1 comment on commit 23e7380

@vercel
Copy link

@vercel vercel bot commented on 23e7380 Oct 31, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.