You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
echo '::error:: 😦 Something you did broke scripts/generateTranslations.ts. Most likely, this means you added an import that caused react-native to be directly or indirectly imported into the script.'
echo '::error:: 😦 Something you did broke scripts/generateTranslations.ts. Most likely, this means you added an import that caused react-native to be directly or indirectly imported into the script.'
Copy file name to clipboardExpand all lines: README.md
+4-26Lines changed: 4 additions & 26 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -586,30 +586,9 @@ If you seek some additional information you can always refer to the [extended ve
586
586
587
587
# Philosophy
588
588
This application is built with the following principles.
589
-
1. **Data Flow** - Ideally, this is how data flows through the app:
590
-
1. Server pushes data to the disk of any client (Server -> Pusher event-> Action listening to pusher event-> Onyx).
591
-
>**Note:** Currently the code only does this with report comments. Until we make more server changes, this step is actually done by the client requesting data from the server via XHR and then storing the response in Onyx.
592
-
2. Disk pushes data to the UI (Onyx ->withOnyx() -> React component).
593
-
3. UI pushes data to people's brains (React component -> device screen).
594
-
4. Brain pushes data into UI inputs (Device input -> React component).
595
-
5. UI inputs push data to the server (React component -> Action ->XHR to server).
596
-
6. Go to 1
597
-

598
-
1. **Offline first**
599
-
- Be sure to read [OFFLINE.md](contributingGuides/philosophies/OFFLINE.md)!
600
-
- All data that is brought into the app and is necessary to display the app when offline should be stored on disk in persistent storage (eg. localStorage on browser platforms). [AsyncStorage](https://reactnative.dev/docs/asyncstorage) is a cross-platform abstraction layer that is used to access persistent storage.
601
-
- All data that is displayed, comes from persistent storage.
602
-
1.**UI Binds to data on disk**
603
-
- Onyx is a Pub/Sub library to connect the application to the data stored on disk.
604
-
-UI components subscribe to Onyx (using `withOnyx()`) and any change to the Onyx data is published to the component by calling `setState()`with the changed data.
605
-
- Libraries subscribe to Onyx (with`Onyx.connect()`) and any change to the Onyx data is published to the callback with the changed data.
606
-
- The UI should never call any Onyx methods except for`Onyx.connect()`. That is the job ofActions (see next section).
607
-
- The UI always triggers an Action when something needs to happen (eg. a person inputs data, the UI triggers an Action withthis data).
608
-
- The UI should be as flexible as possible when it comes to:
609
-
- Incomplete or missing data. Always assume data is incomplete or not there. For example, when a comment is pushed to the client from a pusher event, it's possible that Onyx does not have data for that report yet. That's OK. A partial report object is added to Onyx for the report key `report_1234 = {reportID: 1234, isUnread: true}`. Then there is code that monitors Onyx for reports with incomplete data, and calls `openReport(1234)` to get the full data for that report. TheUI should be able to gracefully handle the report object not being complete. Inthis example, the sidebar wouldn't display any report that does not have a report name.
610
-
- The order that actions are done in. All actions should be done in parallel instead of sequence.
611
-
- Parallel actions are asynchronous methods that don't returnpromises. Any number of these actions can be called at one time and it doesn't matter what order they happen in or when they complete.
612
-
- In-Sequence actions are asynchronous methods that return promises. This is necessary when one asynchronous method depends on the results from a previous asynchronous method. Example: Making an XHR to `command=CreateChatReport` which returns a reportID which is used to call `command=Get&rvl=reportStuff`.
- When data needs to be written to or read from the server, this is done through Actions only.
615
594
- Action methods should only have return values (data or a promise) if they are called by other actions. This is done to encourage that action methods can be called in parallel with no dependency on other methods (see discussion above).
@@ -624,8 +603,7 @@ This application is built with the following principles.
624
603
4. server responds
625
604
5.UI updates with data from the server
626
605
627
-
1.**Cross Platform 99.9999%**
628
-
See details [here](contributingGuides/philosophies/CROSS-PLATFORM.md).
0 commit comments