Skip to content

Commit 24dee06

Browse files
committed
wip
1 parent 0575737 commit 24dee06

File tree

1 file changed

+14
-15
lines changed

1 file changed

+14
-15
lines changed

packages/browser/architecture/ARCHITECTURE.md

Lines changed: 14 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -17,33 +17,32 @@ The following diagram illustrates how Analytics.js initializes and loads device
1717
```mermaid
1818
sequenceDiagram
1919
participant Page as Web Page
20-
participant AJS as Analytics.js
20+
participant AJS as analytics.load(...)
2121
participant CDN as Segment CDN
22-
participant Dest as Device Mode Destinations
22+
participant Plugin as Plugin Registration
2323
24-
Note over Page,Dest: Initialization Phase
25-
Page->>AJS: Load analytics.js<br/>with writeKey
26-
AJS->>CDN: Fetch settings
27-
CDN-->>AJS: Return CDN settings
24+
Note over Page,Plugin: Initialization Phase
25+
Page<<->>AJS: Web Page fetches analytics.js from CDN
26+
Page<<->>AJS: analytics.load(...) invoked.
27+
AJS<<->>CDN: Fetch CDN settings from cdn.segment.io
2828
29-
Note over AJS: Block events unil all non-destination plugins and middleware are loaded
29+
Note over AJS: Block events until all non-destination plugins and middleware are loaded
3030
31-
Note over AJS: Parse device mode<br/>destinations
3231
33-
Note over AJS,Dest: Begin parallel destination loading
32+
Note over AJS,Plugin: Begin parallel destination loading from CDN settings
3433
par Parallel Destination Loading
35-
AJS->>Dest: Load destination 1<br/>(async)
36-
AJS->>Dest: Load destination 2<br/>(async)
34+
AJS->>Plugin: Load destination 1<br/>(async)
35+
AJS->>Plugin: Load destination 2<br/>(async)
3736
end
3837
39-
Note over AJS,Dest: Each destination loads its own scripts
38+
Note over AJS,Plugin: Each destination loads its own scripts into the head and calls its own load() method
4039
4140
Note over AJS: If critical plugins exist,<br/>wait for their registration
4241
4342
par Event Delivery (per destination)
44-
AJS->>Dest: Flush buffered events to segment.io
45-
AJS->>Dest: Flush buffered events to dest 1
46-
AJS->>Dest: Flush buffered events to dest 2
43+
AJS->>Plugin: Flush buffered events to segment.io
44+
AJS->>Plugin: Flush buffered events to destination 1
45+
AJS->>Plugin: Flush buffered events to destination 2
4746
end
4847
4948
```

0 commit comments

Comments
 (0)