Skip to content

Commit aac48a5

Browse files
authored
Merge pull request #9 from lind-tania/reactime7
dev readme update
2 parents 0b17898 + 2c93999 commit aac48a5

File tree

7 files changed

+26
-1
lines changed

7 files changed

+26
-1
lines changed

assets/backend.jpg

128 KB
Loading

assets/console-log.gif

236 KB
Loading

assets/dataflow.jpg

82 KB
Loading

assets/extension-console.gif

2.47 MB
Loading

assets/frontend.jpg

69.3 KB
Loading

assets/reactime-console.gif

6.16 MB
Loading

src/README.md

Lines changed: 26 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,9 +49,13 @@ src/
4949

5050
1. The *app* folder is responsible for the Single Page Application that you see when you open the chrome dev tools under the Reactime tab.
5151

52+
![FRONTEND DATA FLOW](../assets/frontend.jpg)
53+
5254
2. The *backend* folder contains the set of all scripts that we inject into our "target" application via `background.js`
5355
- In Reactime, its main role is to generate data and handle time-jump requests from the background script in our *extension* folder.
5456

57+
![BACKEND DATA FLOW](../assets/backend.jpg)
58+
5559
3. The *extension* folder is where the `contentScript.js` and `background.js` are located.
5660
- Like regular web apps, Chrome Extensions are event-based. The background script is where one typically monitors for browser triggers (e.g. events like closing a tab, for example). The content script is what allows us to read or write to our target web application, usually as a result of [messages passed](https://developer.chrome.com/extensions/messaging) from the background script.
5761
- These two files help us handle requests both from the web browser and from the Reactime extension itself
@@ -60,7 +64,7 @@ src/
6064

6165
The general flow of data is described in the following steps:
6266

63-
![demo](../assets/AppStructureDiagram.png)
67+
![GENERAL DATA FLOW](../assets/dataflow.jpg)
6468

6569
1. When the background bundle is loaded by the browser, it executes a script injection into the dom. (see section on *backend*). This script uses a technique called [throttle](https://medium.com/@bitupon.211/debounce-and-throttle-160affa5457b) to send state data from the app to the content script every specified milliseconds (in our case, this interval is 70ms).
6670

@@ -69,6 +73,27 @@ The general flow of data is described in the following steps:
6973
3. Likewise, when Reactime emits an action due to user interaction -- a "jump" request for example -- a message will be passed from Reactime via the background script to the content script. Then, the content script will pass a message to the target application containing a payload that represents the state the user wants the DOM to reflect or "jump" to.
7074
- One important thing to note here is that this jump action must be dispatched in the target application (i.e. *backend* land), because only there do we have direct access to the DOM.
7175

76+
## Console.log
77+
78+
Navigation between different console.log panels can be confusing when running Reactime. We created a short instruction where you can find the results for your console.log
79+
80+
### <b> /src/extension </b>
81+
Console.logs from the Extension folder you can find here:
82+
- Chrome Extension (Developer mode)
83+
- Background page
84+
![extension](../assets/extension-console.gif)
85+
86+
### <b> /src/app </b>
87+
Console.logs from the App folder you can find here:
88+
- Chrome Browser
89+
- Inspect
90+
![frontend](../assets/console-log.gif)
91+
92+
### <b> /src/backend </b>
93+
Console.logs from the App folder you can find here:
94+
- Open the Reactime extension in Chrome
95+
- Click "Inspect" on Reactime
96+
![backend](../assets/reactime-console.gif)
7297

7398
## Chrome Developer Resources
7499
Still unsure about what content scripts and background scripts do for Reactime, or for a chrome extensions in general?

0 commit comments

Comments
 (0)