Skip to content

Commit 71d35c0

Browse files
Core JS Scan (#173)
1 parent 30c71d9 commit 71d35c0

31 files changed

Lines changed: 1436 additions & 31 deletions

.github/workflows/measure-framework.yml

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -89,6 +89,9 @@ jobs:
8989
RUN_FREQUENCY=$(echo '${{ toJson(matrix.framework) }}' | jq -r '.measurements[] | select(.type == "build") | .runFrequency')
9090
pnpm --filter @framework-tracker/stats-generator run:build ${{ matrix.framework.package }} $RUN_FREQUENCY
9191
92+
- name: Scan build output for vendored core-js
93+
run: pnpm --filter @framework-tracker/stats-generator run:corejs ${{ matrix.framework.package }}
94+
9295
- name: Upload build stats
9396
uses: actions/upload-artifact@bbbca2ddaa5d8feaa63e36b76fdaad77386f024f # v7.0.0
9497
with:
@@ -97,6 +100,14 @@ jobs:
97100
retention-days: 1
98101
if-no-files-found: error
99102

103+
- name: Upload core-js stats
104+
uses: actions/upload-artifact@v4
105+
with:
106+
name: corejs-stats-${{ matrix.framework.name }}
107+
path: packages/${{ matrix.framework.package }}/corejs-stats.json
108+
retention-days: 1
109+
if-no-files-found: warn
110+
100111
measure-ssr:
101112
if: inputs.ssr-matrix != '[]'
102113
runs-on: ubuntu-latest
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
---
2+
import { coreJsTableData } from '../lib/collections'
3+
import { getFrameworkSlug } from '../lib/utils'
4+
import StatsTable from './StatsTable.astro'
5+
6+
const columns = [
7+
{
8+
key: 'name',
9+
header: 'Framework',
10+
nameCell: true,
11+
href: (row: Record<string, unknown>) =>
12+
`/framework/${getFrameworkSlug(row.package as string)}`,
13+
},
14+
{ key: 'bundledSize', header: '~Size' },
15+
{ key: 'unnecessaryModules', header: 'Unnecessary Modules' },
16+
]
17+
---
18+
19+
<StatsTable
20+
label="Core-JS polyfills by framework"
21+
columns={columns}
22+
data={coreJsTableData}
23+
/>

packages/docs/src/components/DependencyStatsTable.astro

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,9 @@ const depsColumns = [
1414
{ key: 'prodDependencies', header: 'Prod Deps' },
1515
{ key: 'devDependencies', header: 'Dev Deps' },
1616
{ key: 'duplicateDependencies', header: 'Dup. Deps' },
17-
{ key: 'nodeModulesSize', header: 'Size' },
18-
{ key: 'nodeModulesSizeProdOnly', header: 'Size (Prod Only)' },
17+
{ key: 'nodeModulesSize', header: 'node_modules' },
18+
{ key: 'nodeModulesSizeProdOnly', header: 'node_modules (prod)' },
19+
{ key: 'depInstallSize', header: 'Dep Install Size' },
1920
{
2021
key: 'graph',
2122
header: 'Graph',

packages/docs/src/content.config.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@ const devtimeCollection = defineCollection({
2525
nodeModulesSize: z.number(),
2626
nodeModulesSizeProdOnly: z.number(),
2727
duplicateDependencies: z.number().optional(),
28+
depInstallSize: z.number().optional(),
2829
e18eMessages: z
2930
.array(
3031
z.object({
@@ -34,6 +35,8 @@ const devtimeCollection = defineCollection({
3435
}),
3536
)
3637
.optional(),
38+
vendoredCoreJsSize: z.number().optional(),
39+
vendoredCoreJsUnnecessaryModules: z.array(z.string()).optional(),
3740
timingMeasuredAt: z.string(),
3841
runner: z.string(),
3942
frameworkVersion: z.string().optional(),

packages/docs/src/content/devtime/starter-astro.json

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -121,5 +121,7 @@
121121
"severity": "warning",
122122
"score": 0
123123
}
124-
]
124+
],
125+
"vendoredCoreJsSize": 0,
126+
"vendoredCoreJsUnnecessaryModules": []
125127
}

packages/docs/src/content/devtime/starter-mastro.json

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,5 +35,7 @@
3535
"severity": "warning",
3636
"score": 0
3737
}
38-
]
38+
],
39+
"vendoredCoreJsSize": 0,
40+
"vendoredCoreJsUnnecessaryModules": []
3941
}

0 commit comments

Comments
 (0)