Skip to content

Commit 06db0f4

Browse files
committed
Update SPA Improvements doc
1 parent 25ece9b commit 06db0f4

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

docs/spa-improvements.md

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,8 @@ Adding a "SPA mode" in the RUM Settings UI would be the easiest way to simplify
66

77
Adding more methods to the `LUX` API is a middle-ground kind of solution that gives implementers more control but does not significantly reduce complexity.
88

9+
Both solutions require updates to the inline snippet. If customers try to use the new `LUX` methods with the old snippet, there is a risk of JavaScript errors and app crashes.
10+
911
We should aspire to completely automate SPA implementations, possibly with the help of Chromium's soft navigation work, but mostly aiming for a generic cross-browser solution. This would be a large undertaking and require a lot of testing and validation with customers.
1012

1113
## The problem (high level)
@@ -14,7 +16,7 @@ We should aspire to completely automate SPA implementations, possibly with the h
1416

1517
Much of the internal lux.js architecture is designed around full page navigations. SPA support was an afterthought, and setting `LUX.auto = false` essentially puts lux.js into "full manual control" mode.
1618

17-
A proper lux.js implementation in a SPA requires correctly use of `LUX.auto`, `LUX.sendBeaconOnPageHidden`, `LUX.init()`, `LUX.markLoadTime()`, and `LUX.send()`. Getting just one of these wrong can throw the whole implementation off.
19+
A proper lux.js implementation in a SPA requires correct use of `LUX.auto`, `LUX.sendBeaconOnPageHidden`, `LUX.init()`, `LUX.markLoadTime()`, and `LUX.send()`. Getting just one of these wrong can throw the whole implementation off.
1820

1921
### Many implementations seem to be incorrect, resulting in lost data and mistrust in SpeedCurve's metrics
2022

@@ -62,6 +64,7 @@ Once a lux.js implementation is deployed, it is difficult to get customers to ch
6264
### Cons
6365

6466
- Requires a new API method.
67+
- Requires an inline snippet update. Implementers using the old snippet may have JS errors.
6568
- Implementers are forced to choose one extreme or the other: full manual control (`LUX.auto = false`) or full autopilot.
6669
- Does not fix the fundamental issues with lux.js architecture.
6770

@@ -139,6 +142,7 @@ This solution would also get rid of the Page Load metric for soft navigations (u
139142

140143
- Does not allow for per-account implementation tweaks.
141144
- Adds at least 3 new methods to the `LUX` API, increasing risk of redundancy or deprecation.
145+
- Requires an inline snippet update. Implementers using the old snippet may have JS errors.
142146
- Some risk of misconfiguration if `LUX.enableSPAMode()` is not called at the correct time.
143147

144148
### Technical details

0 commit comments

Comments
 (0)