-
-
Notifications
You must be signed in to change notification settings - Fork 7
Expand file tree
/
Copy pathDependencyStats.astro
More file actions
505 lines (440 loc) · 11.9 KB
/
DependencyStats.astro
File metadata and controls
505 lines (440 loc) · 11.9 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
---
import { getCollection } from 'astro:content'
const frameworkEntries = await getCollection('frameworks')
const devtimeEntries = await getCollection('devtime')
const runtimeEntries = await getCollection('runtime')
const frameworkMeta = frameworkEntries.map((entry) => entry.data)
const starterStats = devtimeEntries.map((entry) => entry.data)
const ssrStats = runtimeEntries.map((entry) => entry.data)
const BYTES_PER_KB = 1024
const BYTES_PER_MB = BYTES_PER_KB * BYTES_PER_KB
function formatBytesToMB(bytes: number): string {
const mb = bytes / BYTES_PER_MB
return `${mb.toFixed(2)}MB`
}
---
<div id="container">
<main>
<section id="hero">
<h1>Framework Tracker</h1>
<p class="description">
For a full list of what we plan to track see{' '}
<a
href="https://github.com/e18e/framework-tracker/blob/main/initial-comparison-list.md"
target="_blank"
rel="noopener noreferrer"
class="roadmap-link"
>
roadmap
</a>.
</p>
<p class="description">
Stats are currently in active development and may change as we refine
our methodology and testing process.
</p>
<h2>Framework Overview</h2>
<p class="methodology">
Rendering capabilities supported by each framework, their recommended
default approach, and bundler.
</p>
<div class="table-wrapper">
<table aria-label="Framework rendering capabilities">
<thead>
<tr>
<th scope="col">Framework</th>
<th scope="col">SPA</th>
<th scope="col">MPA</th>
<th scope="col">SSG</th>
<th scope="col">Recommended</th>
<th scope="col">Default Bundler</th>
<th scope="col">Other Bundlers</th>
</tr>
</thead>
<tbody>
{
frameworkMeta.map((framework) => (
<tr>
<td class="framework-name">{framework.name}</td>
<td>{framework.supportsSPA ? 'Y' : 'N'}</td>
<td>{framework.supportsMPA ? 'Y' : 'N'}</td>
<td>
{framework.supportsSSG === undefined
? '?'
: framework.supportsSSG
? 'Y'
: 'N'}
</td>
<td>{framework.recommended}</td>
<td>{framework.bundler}</td>
<td>{framework.otherBundlers?.join(', ') || '-'}</td>
</tr>
))
}
</tbody>
</table>
</div>
<h2>Dev Time Performance</h2>
<p class="methodology">
Measured using pnpm on GitHub Actions (ubuntu-latest, Node 24) based on
the starter project set up by each frameworks CLI.
</p>
<div class="table-wrapper">
<table aria-label="Dependency counts by framework">
<thead>
<tr>
<th scope="col">Framework</th>
<th scope="col">Prod Deps</th>
<th scope="col">Dev Deps</th>
<th scope="col">Size</th>
<th scope="col">Size (Prod Only)</th>
<th scope="col">Graph</th>
</tr>
</thead>
<tbody>
{
starterStats.map((framework) => (
<tr>
<td class="framework-name">{framework.name}</td>
<td>{framework.prodDependencies}</td>
<td>{framework.devDependencies}</td>
<td>{formatBytesToMB(framework.nodeModulesSize)}</td>
<td>{formatBytesToMB(framework.nodeModulesSizeProdOnly)}</td>
<td>
<a
href={`https://npmgraph.js.org/?q=https://github.com/e18e/framework-tracker/blob/main/packages/${framework.package}/package.json`}
target="_blank"
rel="noopener noreferrer"
class="graph-link"
>
View
</a>
</td>
</tr>
))
}
</tbody>
</table>
</div>
<div class="table-wrapper">
<table aria-label="Build and install times by framework">
<thead>
<tr>
<th scope="col">Framework</th>
<th scope="col">Avg Install</th>
<th scope="col">Min Install</th>
<th scope="col">Max Install</th>
<th scope="col">Cold Build</th>
<th scope="col">Warm Build</th>
<th scope="col">Build Output</th>
</tr>
</thead>
<tbody>
{
starterStats.map((framework) => (
<tr>
<td class="framework-name">{framework.name}</td>
<td>{(framework.avgInstallTimeMs / 1000).toFixed(2)}s</td>
<td>{(framework.minInstallTimeMs / 1000).toFixed(2)}s</td>
<td>{(framework.maxInstallTimeMs / 1000).toFixed(2)}s</td>
<td>{(framework.coldBuildTimeMs / 1000).toFixed(2)}s</td>
<td>{(framework.warmBuildTimeMs / 1000).toFixed(2)}s</td>
<td>{formatBytesToMB(framework.buildOutputSize)}</td>
</tr>
))
}
</tbody>
</table>
</div>
<h2>Runtime Performance</h2>
<h3>SSR Performance</h3>
<p class="methodology">
Measured on GitHub Actions (ubuntu-latest, Node 24) using custom SSR
benchmark apps.
</p>
<div class="table-wrapper">
<table aria-label="SSR performance by framework">
<thead>
<tr>
<th scope="col">Framework</th>
<th scope="col">Ops/sec</th>
<th scope="col">Avg Latency</th>
<th scope="col">Body Size</th>
<th scope="col">Duplication</th>
</tr>
</thead>
<tbody>
{
ssrStats.map((framework) => (
<tr>
<td class="framework-name">{framework.name}</td>
<td>{framework.ssrOpsPerSec?.toLocaleString()}</td>
<td>{framework.ssrAvgLatencyMs}ms</td>
<td>{framework.ssrBodySizeKb}kb</td>
<td>{framework.ssrDuplicationFactor}x</td>
</tr>
))
}
</tbody>
</table>
</div>
<div class="methodology-notes">
<h4>Methodology</h4>
<ul>
<li>
Each framework renders a table of 1000 rows with two UUID columns
</li>
<li>
Mock HTTP requests bypass TCP overhead for accurate rendering
measurement
</li>
<li>
Data is loaded asynchronously to simulate real-world data fetching
</li>
<li>
Duplication factor indicates how many times each UUID appears in the
response (1x = optimal, 2x = includes hydration payload)
</li>
<li>
Benchmarks run for 10 seconds using <a
href="https://github.com/tinylibs/tinybench"
target="_blank"
rel="noopener noreferrer">tinybench</a
>
</li>
<li>
Inspired by <a
href="https://github.com/eknkc/ssr-benchmark"
target="_blank"
rel="noopener noreferrer">eknkc/ssr-benchmark</a
>
</li>
</ul>
</div>
</section>
</main>
</div>
<style>
#container {
font-family:
'Inter',
-apple-system,
BlinkMacSystemFont,
'Segoe UI',
Roboto,
Oxygen,
Ubuntu,
Cantarell,
'Fira Sans',
'Droid Sans',
'Helvetica Neue',
sans-serif;
min-height: 100vh;
color: #213547;
background-color: #ffffff;
line-height: 1.5;
}
main {
display: flex;
justify-content: center;
padding: 40px 16px;
}
#hero {
width: 100%;
max-width: 900px;
}
h1 {
font-size: 32px;
margin-top: 0.25em;
margin-bottom: 0.5em;
font-weight: 700;
background: linear-gradient(120deg, #7cb560 0%, #cf8c3c 100%);
-webkit-background-clip: text;
-webkit-text-fill-color: transparent;
background-clip: text;
}
h2 {
font-size: 20px;
margin-top: 2em;
margin-bottom: 1em;
font-weight: 600;
color: #213547;
}
h3 {
font-size: 16px;
margin-top: 1.5em;
margin-bottom: 0.75em;
font-weight: 600;
color: #213547;
}
.description {
font-size: 16px;
color: #4b5563;
line-height: 1.6;
margin-bottom: 1em;
max-width: 700px;
}
.methodology {
font-size: 14px;
color: #6b7280;
margin-bottom: 0.5em;
}
.table-wrapper {
width: 100%;
margin-top: 16px;
margin-bottom: 2em;
}
.methodology-notes {
margin-top: 1.5em;
padding: 1em 1.25em;
background: #f9fafb;
border-radius: 8px;
border: 1px solid #e5e7eb;
}
.methodology-notes h4 {
margin: 0 0 0.75em 0;
font-size: 14px;
font-weight: 600;
color: #374151;
}
.methodology-notes ul {
margin: 0;
padding-left: 1.25em;
font-size: 13px;
color: #6b7280;
}
.methodology-notes li {
margin-bottom: 0.4em;
}
.methodology-notes li:last-child {
margin-bottom: 0;
}
.methodology-notes a {
color: #c37822;
text-decoration: none;
}
.methodology-notes a:hover {
text-decoration: underline;
}
table {
width: 100%;
border-collapse: collapse;
background: #ffffff;
border-radius: 8px;
overflow: hidden;
border: 1px solid #e5e7eb;
}
thead {
background: linear-gradient(120deg, #7cb560 0%, #cf8c3c 100%);
color: white;
}
th {
padding: 16px;
text-align: left;
font-weight: 600;
font-size: 14px;
text-transform: uppercase;
letter-spacing: 0.05em;
}
th:not(:first-child) {
text-align: center;
}
td {
padding: 14px 16px;
border-bottom: 1px solid #e5e7eb;
font-size: 15px;
}
tbody tr:last-child td {
border-bottom: none;
}
tbody tr:hover {
background: rgba(207, 140, 60, 0.05);
}
.framework-name {
font-weight: 500;
color: #213547;
}
td:not(.framework-name) {
text-align: center;
color: #6b7280;
}
.graph-link,
.roadmap-link {
color: #c37822;
text-decoration: none;
font-weight: 500;
transition: color 0.2s;
}
.graph-link:hover,
.roadmap-link:hover {
color: #cf8c3c;
text-decoration: underline;
}
/* Dark mode styles */
:global(html.dark) #container {
color: #ffffffde;
background-color: #1a1a1a;
}
:global(html.dark) h2 {
color: #ffffffde;
}
:global(html.dark) h3 {
color: #ffffffde;
}
:global(html.dark) .description {
color: #ffffffa6;
}
:global(html.dark) table {
background: #1a1a1a;
border-color: #2e2e2e;
}
:global(html.dark) td {
border-bottom-color: #2e2e2e;
}
:global(html.dark) tbody tr:hover {
background: rgba(124, 181, 96, 0.1);
}
:global(html.dark) .framework-name {
color: #ffffffde;
}
:global(html.dark) td:not(.framework-name) {
color: #ffffffa6;
}
:global(html.dark) .framework-links li {
color: #ffffffde;
}
:global(html.dark) .methodology {
color: #ffffffa6;
}
:global(html.dark) .methodology-notes {
background: #242424;
border-color: #2e2e2e;
}
:global(html.dark) .methodology-notes h4 {
color: #ffffffde;
}
:global(html.dark) .methodology-notes ul {
color: #ffffffa6;
}
@media screen and (max-width: 768px) {
main {
padding: 20px 16px;
}
h1 {
font-size: 26px;
}
h2 {
font-size: 18px;
}
.description {
font-size: 15px;
}
th,
td {
padding: 12px 8px;
font-size: 13px;
}
th {
font-size: 12px;
}
}
</style>