Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[WIP]Add more chapters #25

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
135 changes: 108 additions & 27 deletions doczrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,14 @@ export default {
themeConfig: {
colors: {
header: {
bg: '#ffd54f',
},
bg: '#ffd54f'
}
},
styles: {
inlineCode: {
color: 'hotpink',
},
},
color: 'hotpink'
}
}
},
menu: [
'Introduction',
Expand All @@ -23,58 +23,139 @@ export default {
'Concept',
{
name: 'Action',
route: '/en/basic/action',
route: '/en/basic/action'
},
{
name: 'Effects',
route: '/en/basic/effects',
route: '/en/basic/effects'
},
{
name: 'Dependencies Injection',
route: '/en/basic/dependencies-injection',
route: '/en/basic/dependencies-injection'
}
]
},
{
name: 'React recipes',
menu: [
{
name: 'Cancellation',
route: '/en/recipes/react/cancellation'
},
{
name: 'Loading/Error states handling',
route: '/en/recipes/react/loading-error-states-handling'
},
{
name: 'StateSelector',
route: '/en/recipes/react/state-selector'
},
],
{
name: 'Dependencies Replacement',
route: '/en/recipes/react/dependencies-replacement'
},
{
name: 'Adding new EffectModule asynchronously',
route: '/en/recipes/react/adding-new-effect-module-asynchronously'
},
]
},
{
name: 'Recipes',
name: 'VueJS recipes',
menu: [
'Cancellation',
'Loading/Error states handling',
'StateSelector',
'Dependencies Replacement',
'Adding new EffectModule asynchronously',
'Writting tests',
],
{
name: 'Cancellation',
route: '/en/recipes/vue/cancellation'
},
{
name: 'Loading/Error states handling',
route: '/en/recipes/vue/loading-error-states-handling'
},
{
name: 'Dependencies Replacement',
route: '/en/recipes/vue/dependencies-replacement'
},
{
name: 'Adding new EffectModule asynchronously',
route: '/en/recipes/vue/adding-new-effect-module-asynchronously'
},
]
},
{
name: 'Writting tests',
route: '/en/recipes/writting-tests'
},
{
name: 'FAQ',
route: '/en/faq',
route: '/en/faq'
},
{
name: '基本概念',
menu: [
'概念',
{
name: 'Action',
route: '/zh/basic/action',
route: '/zh/basic/action'
},
{
name: 'Effects',
route: '/zh/basic/effects',
route: '/zh/basic/effects'
},
{
name: '依赖注入',
route: '/zh/basic/dependencies-injection',
route: '/zh/basic/dependencies-injection'
}
]
},
{
name: 'React 接入指南',
menu: [
{
name: '取消',
route: '/zh/recipes/react/cancellation'
},
{
name: '处理 Loading/Error 状态',
route: '/zh/recipes/react/loading-error-states-handling'
},
{
name: 'StateSelector',
route: '/zh/recipes/react/state-selector'
},
{
name: '依赖替换',
route: '/zh/recipes/react/dependencies-replacement'
},
{
name: 'Module 异步加载',
route: '/zh/recipes/react/adding-new-effect-module-asynchronously'
},
],
]
},
{
name: '深入',
menu: ['取消', '处理 Loading/Error 状态', 'StateSelector', '依赖替换', 'Module 异步加载', '测试'],
name: 'VueJS 接入指南',
menu: [
{
name: '取消',
route: '/zh/recipes/vue/cancellation'
},
{
name: '处理 Loading/Error 状态',
route: '/zh/recipes/vue/loading-error-states-handling'
},
{
name: '依赖替换',
route: '/zh/recipes/vue/dependencies-replacement'
},
{
name: 'Module 异步加载',
route: '/zh/recipes/vue/adding-new-effect-module-asynchronously'
},
]
},
{
name: '常见问题',
route: '/zh/faq',
},
],
route: '/zh/faq'
}
]
}
23 changes: 21 additions & 2 deletions index.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -9,15 +9,34 @@ route: /
[![Slack Status](https://img.shields.io/badge/slack-@sigi/framework-green.svg?logo=slack)](https://join.slack.com/t/sigiframework/shared_invite/enQtOTM4ODYwMjQ5OTY5LTRmM2JhYTA1NTA5OWVkZWQzZmVkZjE4OGM0ZjM4NGJlZTliNTZjYjE5OGExMjE3MTNkNGE2NmE1MjM5NDQwNTY)

# Introduction
**Sigi** is a high level **Process manager** with well designed API which based on `RxJS` and `Immer`.

`TypeScript` is not requirement but we **strongly recommand** using `Sigi` with `TypeScript`, and we don't provide `JavaScript` version document for now.
> **Sigi** is son of Odin ***(Oðin)***, the **Sig** in Sigi means victory because the name of Odin is ***Sigtýr***, which means ***The god of victory***.


**Sigi** is a high level **Process manager** with well designed API which based on `RxJS` and `Immer`. Unlike others state management framenwork, **Sigi** focus on the ***Process management***, which usually come with ***State management*** requirement.

Of course **Sigi** also manage your state, but if you only want put some data in state, and really don't care how the data will be fetched, cached or staled, **Sigi** might too ***heavy*** for you.

**Sigi** is really good at manage the ***process*** of how the state changed, not just the state itself. With the benifit of `RxJS`, you can easily cancel the ongoing request when leaving page (`takeUntil`), or ignore the following event which will trigger ajax request when the first triggered one hasn't resposed yet (`exhaustMap`).

`RxJS` is the only way to manage process now, so you might need to know about [RxJS](https://rxjs.dev/) before you get start. We will also provide `AsyncGenerator` API in future.

**Sigi** is written by `TypeScript`, and we **strongly recommand** using `Sigi` with `TypeScript`, we don't provide `JavaScript` version document now.

## Install

### React app

```bash
yarn install @sigi/{core,di,react,react-router,ssr} immer rxjs
```

### VueJS app

```bash
yarn install @sigi/{core,di,vue} immer rxjs
```

## Required polyfill in legacy browsers

> Bundle these polyfills on demand, `Sigi` does't import them in source code.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
---
name: Adding new EffectModule asynchronously
route: /en/recipes/adding-new-effect-module-asynchronously
menu: Recipes
route: /en/recipes/react/adding-new-effect-module-asynchronously
menu: React Recipes
---

# Adding new EffectModule Asynchronously/Lazily
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
---
name: EffectModule 异步加载
route: /zh/recipes/adding-new-effect-module-asynchronously
route: /zh/recipes/react/adding-new-effect-module-asynchronously
menu: 深入
---

Expand Down
4 changes: 2 additions & 2 deletions recipes/cancellation.mdx → recipes/react/cancellation.mdx
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
---
name: Cancellation
route: /en/recipes/cancellation
menu: Recipes
route: /en/recipes/react/cancellation
menu: React Recipes
---

# Cancellation
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
---
name: 取消
route: /zh/recipes/cancellation
route: /zh/recipes/react/cancellation
menu: 深入
---

Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
---
name: Dependencies Replacement
route: /en/recipes/dependencies-replacement
menu: Recipes
route: /en/recipes/react/dependencies-replacement
menu: React Recipes
---

# Dependencies replacement
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
---
name: 依赖替换
route: /zh/recipes/dependencies-replacement
route: /zh/recipes/react/dependencies-replacement
menu: 深入
---

Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
---
name: Loading/Error states handling
route: /en/recipes/loading-error-states-handling
menu: Recipes
route: /en/recipes/react/loading-error-states-handling
menu: React Recipes
---

# Loading/Error states handling
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
---
name: 处理 Loading/Error 状态
route: /zh/recipes/loading-error-states-handling
route: /zh/recipes/react/loading-error-states-handling
menu: 深入
---

Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
---
name: StateSelector
route: /en/recipes/state-selector
menu: Recipes
menu: React Recipes
---

# StateSelector
Expand Down
File renamed without changes.
1 change: 0 additions & 1 deletion recipes/writting_tests.mdx
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
---
name: Writting tests
route: /en/recipes/writting-tests
menu: Recipes
---

# Writting tests
Expand Down
1 change: 0 additions & 1 deletion recipes/writting_tests.zh.mdx
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
---
name: 测试
route: /zh/recipes/writting-tests
menu: 深入
---

# 编写测试
Expand Down