Commit 512342d
committed
perf(devframe): parse user-agent server-side
The only client-side use of ua-parser-modern was formatting
navigator.userAgent into a short device label before sending it in the
anonymous:devframe:auth(:exchange) handshake - the parsed shape never
crossed the wire, only the resulting string did. Send the raw
navigator.userAgent instead and parse+format it at the server ingress
(node/auth/state.ts, where it's stored), keeping the persisted label
format and the ua: string wire shape identical while moving
ua-parser-modern out of the ~90 KB client bundle every embedded page
loads.1 parent 8a8ec85 commit 512342d
2 files changed
Lines changed: 29 additions & 16 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
3 | 3 | | |
4 | 4 | | |
5 | 5 | | |
6 | | - | |
7 | 6 | | |
8 | 7 | | |
9 | 8 | | |
| |||
184 | 183 | | |
185 | 184 | | |
186 | 185 | | |
187 | | - | |
188 | | - | |
189 | | - | |
190 | | - | |
191 | | - | |
192 | | - | |
193 | | - | |
194 | | - | |
195 | | - | |
196 | | - | |
197 | | - | |
198 | | - | |
199 | 186 | | |
200 | 187 | | |
201 | 188 | | |
202 | 189 | | |
203 | 190 | | |
204 | | - | |
| 191 | + | |
| 192 | + | |
| 193 | + | |
| 194 | + | |
205 | 195 | | |
206 | 196 | | |
207 | 197 | | |
| |||
228 | 218 | | |
229 | 219 | | |
230 | 220 | | |
231 | | - | |
| 221 | + | |
232 | 222 | | |
233 | 223 | | |
234 | 224 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
3 | 3 | | |
4 | 4 | | |
5 | 5 | | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
6 | 29 | | |
7 | 30 | | |
8 | 31 | | |
| |||
121 | 144 | | |
122 | 145 | | |
123 | 146 | | |
124 | | - | |
| 147 | + | |
125 | 148 | | |
126 | 149 | | |
127 | 150 | | |
| |||
0 commit comments