Skip to content

Commit c771942

Browse files
author
Žan Gornjak
authored
Docs grammar corrections IV (mobxjs#2462)
* docs/refguide/tojs.md: remove deprecated file * docs/refguide/object-api.md: correct heading size * docs/refguide/observable.md: Create -> Creating * docs/intro/installation.md: reorder React bindings paragraph * docs/react/react-performance.md: sync title with 1st heading * docs/best/debugging-mobx.md: sync 1st heading with sidebar_label * docs/refguide/on-become-observed.md: sync title with 1st heading * docs/refguide/observe.md: add title * docs/refguide/object-api.md: add title * docs/refguide/modifiers.md: remove [] from sidebar_label to match others * docs/refguide/extending.md: add title * docs/react/react-performance.md: move title before sidebar_label * docs/faq/migrate-to-6.md: add title * docs/best/debugging-mobx.md: add title * docs/best/what-does-mobx-react-to.md: add title * docs/best/store.md: move title before sidebar_label * docs/best/decorators.md: add title * docs/best/what-does-mobx-react-to.md: sync 1st heading with title * docs/intro/installation.md: italic warning to match others * docs/best/store.md: sync title and 1st heading with sidebar_label * docs/react/react-integration.md: add ending quote to import statement * website/sidebars.json: switch positions of Reactions and Computeds * website/sidebars.json: rename Introduction to MobX * docs/intro/how-to-read.md: How to read -> About, friendlier, lol * docs/react/react-integration.md: add comment mentioning mobx-react * docs/README.md: 3rd pass * docs/intro/how-to-read.md: 2nd pass * docs/intro/installation.md: 6th pass * docs/intro/how-to-read.md: 3rd pass * docs/intro/concepts.md: 6th pass * docs/README.md: Introduction -> About MobX * website/sidebars.json: MobX -> Introduction * docs/intro/concepts.md: supports -> uses * docs/intro/how-to-read.md: MobX -> Introduction * docs/react/react-performance.md: reword title and 1st heading * docs/README.md: rework the Further resources section * docs/README.md: 4th pass * website/sidebars.json: move react-performance to MobX and React & store on top of Tips & Tricks * docs/refguide/computed.md: 1st pass * website/sidebars.json: Configuring MobX -> Configuration * docs/refguide/computed-with-args.md: 1st pass * docs/refguide/computed-with-args.md: 2nd pass * docs/refguide/computed-with-args.md: lower the headings so the right-side menu appears * docs/refguide/observable.md: 6th pass * website/sidebars.json: switch MobX-utils with Computeds with arguments * docs/refguide/computed: 2nd pass * docs/refguide/computed-with-args.md: 3rd pass * docs/: make all Tip: Note: Example: bold * docs/refguide/computed.md: 3rd pass * docs/refguide/computed.md: 4th pass * docs/refguide/computed.md: re-comp -> recomp * docs/README.md: add video React Live 2019, Reinventing MobX by Max Gallo * website/i18n/en.json: changes to titles and sidebar_label's * docs/: convert remaining side-effects to majority side effects * docs/react/react-performance.md: mark as advanced * docs/refguide/computed.md: add a note about autorun and the Reactions section * docs/refguide/computed.md: reverse the autorun mention * docs/: surround all advanced markings with {} as it looks the cleanest all-around * docs/refguide/autorun.md: 1st pass * website/core/Footer.js: correct to About MobX & The gist of MobX * docs/refguide/{action,api}.md: correct advanced markings, side effect & recomp * docs/: move to a flat dir structure, add notices and links to legacy documents * docs/observable-state.md: added changes made in commit bd9629f * docs/: update all references and fix any dead ends * docs/LINKS.md: capitalize the only lowercase x in MobX * docs/observable-state.md: correct import of observable -> makeAutoObservable * docs/api.md: revert API overview -> API Reference * docs/: convert remaining capitalized words after :** to lowercase * docs/actions.md: 1st pass * docs/: mark direct mentions of advanced sections with the icon, like in computeds * docs/actions.md: 2nd pass * docs/: convert remaining . leading to lists and examples, to : * docs/reactions.md: 2nd pass
1 parent ff246b3 commit c771942

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

60 files changed

+5176
-4795
lines changed

Diff for: README.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -125,7 +125,7 @@ The `observer` wrapper around the `TimerView` React component will automatically
125125
of the component depends on `timer.secondsPassed`, even though this relationship is not explicitly defined. MobX's reactivity system will make sure the component gets re-rendered when _precisely that_ field is updated in the future.
126126

127127
Every event (`onClick` and `setInterval`) invokes an _action_ (`increaseTimer` and `resetTimer` functions) that updates _observable state_ (`secondsPassed` class property).
128-
Changes in the observable state are propagated precisely to all _computations_ and _side-effects_ (`TimerView` component) that depend on the changes being made.
128+
Changes in the observable state are propagated precisely to all _computations_ and _side effects_ (`TimerView` component) that depend on the changes being made.
129129

130130
<img alt="MobX unidirectional flow" src="docs/assets/flow2.png" align="center" />
131131

@@ -161,6 +161,6 @@ The philosophy and benefits of the mental model provided by MobX are described i
161161

162162
## Credits
163163

164-
MobX is inspired by reactive programming principles as found in spreadsheets. It is inspired by MVVM frameworks like in MeteorJS tracker, knockout and Vue.js. But MobX brings Transparent Functional Reactive Programming to the next level and provides a stand alone implementation. It implements TFRP in a glitch-free, synchronous, predictable and efficient manner.
164+
MobX is inspired by reactive programming principles as found in spreadsheets. It is inspired by MVVM frameworks like in MeteorJS tracker, knockout and Vue.js. But MobX brings Transparent Functional Reactive Programming to the next level and provides a standalone implementation. It implements TFRP in a glitch-free, synchronous, predictable and efficient manner.
165165

166166
A ton of credits for [Mendix](https://github.com/mendix), for providing the flexibility and support to maintain MobX and the chance to proof the philosophy of MobX in a real, complex, performance critical applications.

Diff for: docs/LINKS.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
- [rfx-stack](https://github.com/foxhound87/rfx-stack) RFX Stack - Universal App featuring: React + Feathers + MobX
1414
- [mobx-reactor](https://github.com/amsb/mobx-reactor) Connect MobX data stores to functional stateless React components with async actions and unidirectional data flow.
1515
- [mobx-model](https://github.com/ikido/mobx-model) Simplify mobx data stores that mimic backend models
16-
- [rx-mobx](https://github.com/chicoxyzzy/rx-mobx) Convert Mobx observables to RxJS and vice versa
16+
- [rx-mobx](https://github.com/chicoxyzzy/rx-mobx) Convert MobX observables to RxJS and vice versa
1717

1818
## More examples
1919

Diff for: docs/README.md

+41-35
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
11
---
2-
title: Introduction
3-
sidebar_label: Introduction
2+
title: About MobX
3+
sidebar_label: About MobX
44
hide_title: true
55
---
66

77
<img src="assets/mobx.png" alt="logo" height="120" align="right" />
88

99
# MobX
1010

11-
_Simple, scalable state management_
11+
_Simple, scalable state management._
1212

1313
[![Discuss on Github](https://img.shields.io/badge/discuss%20on-GitHub-orange)](https://github.com/mobxjs/mobx/discussions)
1414
[![npm version](https://badge.fury.io/js/mobx.svg)](https://badge.fury.io/js/mobx)
@@ -17,7 +17,7 @@ _Simple, scalable state management_
1717

1818
---
1919

20-
MobX is made possible by the generosity of the sponsors below, and many [individual backers](http://mobxjs.github.io/mobx/backers-sponsors.html#backers). Sponsoring directly impacts the longevity of this project.
20+
MobX is made possible by the generosity of the sponsors below, and many other [individual backers](http://mobxjs.github.io/mobx/backers-sponsors.html#backers). Sponsoring directly impacts the longevity of this project.
2121

2222
**🥇 Gold sponsors (\$3000+ total contribution):** <br/>
2323
<a href="https://mendix.com/"><img src="assets/mendix-logo.png" align="center" width="100" title="Mendix" alt="Mendix" /></a>
@@ -45,7 +45,7 @@ MobX is made possible by the generosity of the sponsors below, and many [individ
4545

4646
## Introduction
4747

48-
_Anything that can be derived from the application state, should be derived. Automatically._
48+
_Anything that can be derived from the application state, should be. Automatically._
4949

5050
MobX is a battle tested library that makes state management simple and scalable by transparently applying functional reactive programming (TFRP).
5151
The philosophy behind MobX is simple:
@@ -55,10 +55,9 @@ The philosophy behind MobX is simple:
5555
<div class="pic">😙</div>
5656
<div>
5757
<h5>Straightforward</h5>
58-
<p>With MobX, you write minimalistic, boilerplate free code that captures your intent:
59-
Trying to update a record field? Use good old JavaScript assignment.
60-
Updating data in an asynchronous process? No special tools are required.
61-
The reactivity system will detect all your changes and propagate them out to where they are being used.
58+
<p>Write minimalistic, boilerplate free code that captures your intent.
59+
Trying to update a record field? Use the good old JavaScript assignment.
60+
Updating data in an asynchronous process? No special tools are required, the reactivity system will detect all your changes and propagate them out to where they are being used.
6261
</p>
6362
</div>
6463
</div>
@@ -67,9 +66,9 @@ The philosophy behind MobX is simple:
6766
<div>
6867
<h5>Effortless optimal rendering</h5>
6968
<p>
70-
MobX tracks all updates and usages of your data at runtime, building a dependency tree that captures all relations between state and output.
69+
All changes to and uses of your data are tracked at runtime, building a dependency tree that captures all relations between state and output.
7170
This guarantees that computations depending on your state, like React components, run only when strictly needed.
72-
With MobX, there is no need to manually optimize components using error-prone and sub-optimal techniques like memoization and selectors.
71+
There is no need to manually optimize components with error-prone and sub-optimal techniques like memoization and selectors.
7372
</p>
7473
</div>
7574
</div>
@@ -103,42 +102,42 @@ class Timer {
103102
makeAutoObservable(this)
104103
}
105104

106-
increaseTimer() {
105+
increase() {
107106
this.secondsPassed += 1
108107
}
109108

110-
resetTimer() {
109+
reset() {
111110
this.secondsPassed = 0
112111
}
113112
}
114113

115114
const myTimer = new Timer()
116115

117-
// Build a user interface for this app that merely uses the state.
116+
// Build a "user interface" that uses the observable state.
118117
const TimerView = observer(({ timer }) => (
119-
<button onClick={() => timer.resetTimer()}>Seconds passed: {timer.secondsPassed}</button>
118+
<button onClick={() => timer.reset()}>Seconds passed: {timer.secondsPassed}</button>
120119
))
121120

122121
ReactDOM.render(<TimerView timer={myTimer} />, document.body)
123122

124123
// Update the 'Seconds passed: X' text every second.
125124
setInterval(() => {
126-
myTimer.increaseTimer()
125+
myTimer.increase()
127126
}, 1000)
128127
```
129128

130-
The `observer` wrapper around the `TimerView` React component will automatically detect that rendering
131-
of the component depends on `timer.secondsPassed`, even though this relationship is not explicitly defined. MobX's reactivity system will make sure the component gets re-rendered when _precisely that_ field is updated in the future.
129+
The `observer` wrapper around the `TimerView` React component, will automatically detect that rendering
130+
depends on the `timer.secondsPassed` observable, even though this relationship is not explicitly defined. The reactivity system will take care of re-rendering the component when _precisely that_ field is updated in the future.
132131

133-
Every event (`onClick` and `setInterval`) invokes an _action_ (`increaseTimer` and `resetTimer` functions) that updates _observable state_ (`secondsPassed` class property).
134-
Changes in the observable state are propagated precisely to all _computations_ and _side-effects_ (`TimerView` component) that depend on the changes being made.
132+
Every event (`onClick` / `setInterval`) invokes an _action_ (`myTimer.increase` / `myTimer.reset`) that updates _observable state_ (`myTimer.secondsPassed`).
133+
Changes in the observable state are propagated precisely to all _computations_ and _side effects_ (`TimerView`) that depend on the changes being made.
135134

136135
<img alt="MobX unidirectional flow" src="assets/flow2.png" align="center" />
137136

138-
You can apply this diagram as a conceptual picture to this simple example or any other application using MobX.
137+
This conceptual picture can be applied to the above example, or any other application using MobX.
139138

140-
To learn about the core concepts of MobX with a larger example, please read [Concepts & Principles](http://mobxjs.github.io/mobx/intro/concepts.html) or take the [10 minute interactive introduction to MobX and React](https://mobx.js.org/getting-started).
141-
The philosophy and benefits of the mental model provided by MobX are described in detail in the blogs [UI as an afterthought](https://michel.codes/blogs/ui-as-an-afterthought) and [How to decouple state and UI (a.k.a. you don’t need componentWillMount)](https://hackernoon.com/how-to-decouple-state-and-ui-a-k-a-you-dont-need-componentwillmount-cc90b787aa37).
139+
To learn about the core concepts of MobX using a larger example, check out [The gist of MobX](the-gist-of-mobx.md) section, or take the [10 minute interactive introduction to MobX and React](https://mobx.js.org/getting-started.html).
140+
The philosophy and benefits of the mental model provided by MobX are also described in great detail in the blog posts [UI as an afterthought](https://michel.codes/blogs/ui-as-an-afterthought) and [How to decouple state and UI (a.k.a. you don’t need componentWillMount)](https://hackernoon.com/how-to-decouple-state-and-ui-a-k-a-you-dont-need-componentwillmount-cc90b787aa37).
142141

143142
## What others are saying...
144143

@@ -154,19 +153,26 @@ The philosophy and benefits of the mental model provided by MobX are described i
154153
155154
## Further resources and documentation
156155

157-
- [Ten minute, interactive MobX + React tutorial](https://mobx.js.org/getting-started)
158-
- <i><a style="color: white; background:green;padding:5px;margin:5px;border-radius:2px" href="https://egghead.io/courses/manage-complex-state-in-react-apps-with-mobx">egghead.io course</a></i> (Based on MobX 3)
159-
- <img src="assets/book.jpg" height="80px"/> [The MobX book](https://books.google.nl/books?id=ALFmDwAAQBAJ&pg=PP1&lpg=PP1&dq=michel+weststrate+mobx+quick+start+guide:+supercharge+the+client+state+in+your+react+apps+with+mobx&source=bl&ots=D460fxti0F&sig=ivDGTxsPNwlOjLHrpKF1nweZFl8&hl=nl&sa=X&ved=2ahUKEwiwl8XO--ncAhWPmbQKHWOYBqIQ6AEwAnoECAkQAQ#v=onepage&q=michel%20weststrate%20mobx%20quick%20start%20guide%3A%20supercharge%20the%20client%20state%20in%20your%20react%20apps%20with%20mobx&f=false) by Pavan Podila and Michel Weststrate.
160-
- Videos:
161-
- [Introduction to MobX & React in 2020](https://www.youtube.com/watch?v=pnhIJA64ByY) - 17m by Leigh Halliday.
162-
- [ReactNext 2016: Real World MobX](https://www.youtube.com/watch?v=Aws40KOx90U) - 40m [slides](https://docs.google.com/presentation/d/1DrI6Hc2xIPTLBkfNH8YczOcPXQTOaCIcDESdyVfG_bE/edit?usp=sharing)
163-
- [Practical React with MobX](https://www.youtube.com/watch?v=XGwuM_u7UeQ). In depth introduction and explanation to MobX and React by Matt Ruby on OpenSourceNorth (ES5 only) - 42m.
164-
- [MobX and the unique symbiosis of predictability and speed](https://www.youtube.com/watch?v=NBYbBbjZeX4&list=PL8sJahqnzh8JJD7xahG5zXkjfM5GOgcPA&index=21&t=0s) - HolyJS 2019 conf, 59 min
165-
- [Talk: State Management Is Easy, React Amsterdam 2016 conf](https://www.youtube.com/watch?v=ApmSsu3qnf0&feature=youtu.be) ([slides](https://speakerdeck.com/mweststrate/state-management-is-easy-introduction-to-mobx))
166-
- [MobX awesome list](https://github.com/mobxjs/awesome-mobx#awesome-mobx)
156+
- [10 minute interactive introduction to MobX and React](https://mobx.js.org/getting-started)
157+
- [Egghead.io course, based on MobX 3](https://egghead.io/courses/manage-complex-state-in-react-apps-with-mobx)
158+
159+
### The MobX book
160+
[<img src="assets/book.jpg" height="80px"/> ](https://books.google.nl/books?id=ALFmDwAAQBAJ&pg=PP1&lpg=PP1&dq=michel+weststrate+mobx+quick+start+guide:+supercharge+the+client+state+in+your+react+apps+with+mobx&source=bl&ots=D460fxti0F&sig=ivDGTxsPNwlOjLHrpKF1nweZFl8&hl=nl&sa=X&ved=2ahUKEwiwl8XO--ncAhWPmbQKHWOYBqIQ6AEwAnoECAkQAQ#v=onepage&q=michel%20weststrate%20mobx%20quick%20start%20guide%3A%20supercharge%20the%20client%20state%20in%20your%20react%20apps%20with%20mobx&f=false)
161+
162+
Created by [Pavan Podila](https://twitter.com/pavanpodila) and [Michel Weststrate](https://twitter.com/mweststrate).
163+
164+
### Videos
165+
- [Introduction to MobX & React in 2020](https://www.youtube.com/watch?v=pnhIJA64ByY) by Leigh Halliday, _17min_.
166+
- [ReactNext 2016: Real World MobX](https://www.youtube.com/watch?v=Aws40KOx90U) by Michel Weststrate, _40min_, [slides](https://docs.google.com/presentation/d/1DrI6Hc2xIPTLBkfNH8YczOcPXQTOaCIcDESdyVfG_bE/edit?usp=sharing).
167+
- [OpenSourceNorth: Practical React with MobX (ES5)](https://www.youtube.com/watch?v=XGwuM_u7UeQ) by Matt Ruby, _42min_.
168+
- [HolyJS 2019: MobX and the unique symbiosis of predictability and speed](https://www.youtube.com/watch?v=NBYbBbjZeX4&list=PL8sJahqnzh8JJD7xahG5zXkjfM5GOgcPA&index=21&t=0s) by Michel Weststrate, _59min_.
169+
- [React Amsterdam 2016: State Management Is Easy](https://www.youtube.com/watch?v=ApmSsu3qnf0&feature=youtu.be) by Michel Weststrate, _20min_, [slides](https://speakerdeck.com/mweststrate/state-management-is-easy-introduction-to-mobx).
170+
- {🚀} [React Live 2019: Reinventing MobX](https://www.youtube.com/watch?v=P_WqKZxpX8g) by Max Gallo, _27min_.
171+
172+
And an all around [MobX awesome list](https://github.com/mobxjs/awesome-mobx#awesome-mobx).
167173

168174
## Credits
169175

170-
MobX is inspired by reactive programming principles as found in spreadsheets. It is inspired by MVVM frameworks like in MeteorJS tracker, knockout and Vue.js. But MobX brings Transparent Functional Reactive Programming to the next level and provides a stand alone implementation. It implements TFRP in a glitch-free, synchronous, predictable and efficient manner.
176+
MobX is inspired by reactive programming principles as found in the spreadsheets. It is inspired by MVVM frameworks like MeteorJS tracker, knockout and Vue.js, but MobX brings _Transparent Functional Reactive Programming_ to the next level and provides a standalone implementation. It implements TFRP in a glitch-free, synchronous, predictable and efficient manner.
171177

172-
A ton of credits for [Mendix](https://github.com/mendix), for providing the flexibility and support to maintain MobX and the chance to proof the philosophy of MobX in a real, complex, performance critical applications.
178+
A ton of credits goes to [Mendix](https://github.com/mendix), for providing the flexibility and support to maintain MobX and the chance to proof the philosophy of MobX in a real, complex, performance critical applications.

Diff for: docs/about-this-documentation.md

+46
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
---
2+
title: About this documentation
3+
sidebar_label: About this documentation
4+
hide_title: true
5+
---
6+
7+
<script async type="text/javascript" src="//cdn.carbonads.com/carbon.js?serve=CEBD4KQ7&placement=mobxjsorg" id="_carbonads_js"></script>
8+
9+
# About this documentation
10+
11+
It follows the principle that the most commonly used concepts are
12+
introduced before specialized information. This applies to the headings in the table
13+
of concepts as well as the pages under those headings.
14+
15+
We've marked the sections and concepts that are more advanced with the {🚀} marker. You likely won't have to understand them until you will have a special use case, and can use MobX very effectively without knowing about them. Feel free to skip them and move on to the next section!
16+
17+
The documentation has been rewritten for MobX 6. For older versions of MobX, it can be found [here](https://github.com/mobxjs/mobx/tree/mobx4and5/docs).
18+
All the principles are the same, and the API is largely the same. The main difference is that before MobX 6, [decorators](https://github.com/mobxjs/mobx/blob/mobx4and5/docs/best/decorators.md) were the recommended syntax to write MobX enhanced classes.
19+
20+
## Guided tour
21+
22+
To get an overall idea of how to use MobX with React, read through the current _Introduction_ heading, in particular [The gist of MobX](the-gist-of-mobx.md) section.
23+
It will introduce you to the most important principles, API's and how they relate.
24+
You should be ready to use MobX once you read this!
25+
26+
Here are a few suggestions about the next things to check out:
27+
28+
- Try the [10 minute interactive introduction to MobX and React](getting-started.html)
29+
30+
- [React integration](react-integration.md)
31+
32+
- [`makeObservable` / `makeAutoObservable`](observable-state.md)
33+
34+
- Learn about [actions](actions.md), which includes a discussion on asynchronous actions
35+
36+
- The basics of [computeds](computeds.md)
37+
38+
- Read about [`autorun`](reactions.md#autorun), if only because it's used in the examples
39+
40+
- To get an idea on how to organize your application's data stores, check out [Defining data stores](defining-data-stores.md)
41+
42+
- If the behavior of MobX confuses you, it's useful to check out [Understanding reactivity](understanding-reactivity.md)
43+
44+
- Get a [quick overview of the API](api.md), also linked in the top navigation bar
45+
46+
This should give you a good understanding of the day-to-day uses of MobX. There is plenty more available for you to read at your own leisure.

0 commit comments

Comments
 (0)