Skip to content
Open
Show file tree
Hide file tree
Changes from 37 commits
Commits
Show all changes
42 commits
Select commit Hold shift + click to select a range
c54da24
chore: add size limit gating to Amplitude
daniel-graham-amplitude May 14, 2026
35218ab
again
daniel-graham-amplitude May 14, 2026
cf2a7a1
again
daniel-graham-amplitude May 14, 2026
ffb4641
again
daniel-graham-amplitude May 15, 2026
be3b231
again
daniel-graham-amplitude May 15, 2026
4942052
again
daniel-graham-amplitude May 15, 2026
88b24f2
again
daniel-graham-amplitude May 15, 2026
bf048cc
again
daniel-graham-amplitude May 15, 2026
610cc31
again
daniel-graham-amplitude May 15, 2026
a0270c6
again
daniel-graham-amplitude May 15, 2026
2bd561b
again
daniel-graham-amplitude May 15, 2026
638e85b
again
daniel-graham-amplitude May 15, 2026
e696090
again
daniel-graham-amplitude May 15, 2026
6d7c1ef
again
daniel-graham-amplitude May 15, 2026
82bac53
again
daniel-graham-amplitude May 15, 2026
8540d2d
again
daniel-graham-amplitude May 15, 2026
520b6db
again
daniel-graham-amplitude May 15, 2026
995f58f
again
daniel-graham-amplitude May 15, 2026
a059d2c
again
daniel-graham-amplitude May 15, 2026
ce51924
again
daniel-graham-amplitude May 15, 2026
7a7421c
again
daniel-graham-amplitude May 15, 2026
fb5d4b1
again
daniel-graham-amplitude May 15, 2026
d28a6bc
again
daniel-graham-amplitude May 15, 2026
f2fb6a1
again
daniel-graham-amplitude May 15, 2026
faf2a6a
chore: remove failure allowance on size-limit-action
daniel-graham-amplitude May 15, 2026
f3b66cd
Revert "chore: remove failure allowance on size-limit-action"
daniel-graham-amplitude May 15, 2026
5a4e5a5
chore: remove failure allowance on size-limit-action
daniel-graham-amplitude May 15, 2026
1f6f869
again
daniel-graham-amplitude May 15, 2026
66d312a
again
daniel-graham-amplitude May 15, 2026
cef3c5d
again
daniel-graham-amplitude May 15, 2026
94a6445
chore: report bundle sizes to amplitude
daniel-graham-amplitude May 15, 2026
8079dc1
empty message
daniel-graham-amplitude May 15, 2026
cac1590
again
daniel-graham-amplitude May 16, 2026
6a2628d
again
daniel-graham-amplitude May 16, 2026
372c327
again
daniel-graham-amplitude May 16, 2026
12a1cc7
again
daniel-graham-amplitude May 16, 2026
d3d32c3
again
daniel-graham-amplitude May 16, 2026
5d0b541
Merge branch 'main' of github.com:amplitude/Amplitude-TypeScript into…
daniel-graham-amplitude May 22, 2026
634b36f
again
daniel-graham-amplitude May 22, 2026
10014f9
again
daniel-graham-amplitude May 22, 2026
f4c2a10
again
daniel-graham-amplitude May 22, 2026
4d90848
Merge branch 'main' of github.com:amplitude/Amplitude-TypeScript into…
daniel-graham-amplitude May 25, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
35 changes: 35 additions & 0 deletions .github/workflows/ci-nx.yml
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,41 @@ jobs:
- name: Build docs
run: pnpm docs:check

check-size-limits:
name: Check Size Limits
runs-on: ubuntu-latest
env:
NX_BASE: ${{ github.event_name == 'pull_request' && github.event.pull_request.base.sha || 'origin/main~1' }}
NX_HEAD: ${{ github.sha }}
steps:
- name: Check out git repository
uses: actions/checkout@f43a0e5ff2bd294095638e18286ca9a3d1956744 # v3
with:
fetch-depth: 0

- name: Setup pnpm
uses: pnpm/action-setup@b906affcce14559ad1aafd4ab0e942779e9f58b1 # v4

- name: Setup Node.js 24
uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # v4
with:
node-version: 24
cache: 'pnpm'

- name: Restore Nx cache
uses: actions/cache/restore@d4323d4df104b026a6aa633fdb11d772146be0bf # v4
with:
path: .nx/cache
key: nx-${{ runner.os }}-${{ hashFiles('pnpm-lock.yaml', 'nx.json') }}
restore-keys: |
nx-${{ runner.os }}-${{ hashFiles('pnpm-lock.yaml', 'nx.json') }}

- uses: daniel-statsig/size-limit-action@710d41ebc34634c011e8a91fe165d6ff49536a74 # v1
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
package_manager: pnpm
build_script: build:nx

build:
name: Build
strategy:
Expand Down
46 changes: 46 additions & 0 deletions .github/workflows/main-branch-push.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
# Runs on every push to main (for example after a PR merge). Extend with jobs as needed.
name: Main branch push

on:
push:
branches:
- main

jobs:
cache-builds:
name: On push to main
runs-on: ubuntu-latest
steps:
- name: Check out git repository
uses: actions/checkout@f43a0e5ff2bd294095638e18286ca9a3d1956744 # v3
with:
fetch-depth: 0

- name: Setup pnpm
uses: pnpm/action-setup@b906affcce14559ad1aafd4ab0e942779e9f58b1 # v4

- name: Setup Node.js 24
uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # v4
with:
node-version: 24
cache: 'pnpm'

- name: Install project dependencies
run: pnpm install --frozen-lockfile

- name: Restore Nx cache
uses: actions/cache/restore@d4323d4df104b026a6aa633fdb11d772146be0bf # v4
with:
path: .nx/cache
key: nx-${{ runner.os }}-${{ hashFiles('pnpm-lock.yaml', 'nx.json') }}
restore-keys: |
nx-${{ runner.os }}-${{ hashFiles('pnpm-lock.yaml', 'nx.json') }}

- name: Build all packages
run: pnpm build:nx

- name: Save Nx cache
uses: actions/cache/save@d4323d4df104b026a6aa633fdb11d772146be0bf # v4
with:
path: .nx/cache
key: nx-${{ runner.os }}-${{ hashFiles('pnpm-lock.yaml', 'nx.json') }}
7 changes: 7 additions & 0 deletions .github/workflows/publish-v2.yml
Original file line number Diff line number Diff line change
Expand Up @@ -248,3 +248,10 @@ jobs:
DRY_RUN: true
run: |
pnpm deploy:publish:dry-run

# Report bundle size to Amplitude
- name: Report bundle size to Amplitude
env:
AMPLITUDE_API_KEY: ${{ secrets.AMPLITUDE_API_KEY }}
run: |
node ./scripts/report-bundle-size.js
Comment thread
cursor[bot] marked this conversation as resolved.
Outdated
28 changes: 28 additions & 0 deletions .size-limit.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
const limits = [
{
// analytics-browser bundle
packageJsonPath: './packages/analytics-browser/package.json',
path: `./packages/analytics-browser/lib/scripts/amplitude-min.js.gz`,
name: 'analytics-browser.min.js.gz',
limit: '65kb',
brotli: false,
},
{
// session-replay standalone bundle
packageJsonPath: './packages/session-replay-browser/package.json',
path: `./packages/session-replay-browser/lib/scripts/session-replay-browser-min.js.gz`,
name: 'session-replay-browser.min.js.gz',
limit: '150kb',
brotli: false,
},
{
// unified SDK bundle
packageJsonPath: './packages/unified/package.json',
path: `./packages/unified/lib/scripts/amplitude-min.umd.js.gz`,
name: 'unified.min.umd.js.gz',
limit: '225kb',
brotli: false,
},
]

module.exports = limits;
1 change: 1 addition & 0 deletions nx.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
"build": {
"dependsOn": ["^build"],
"inputs": ["production", "^production"],
"outputs": ["{projectRoot}/lib/**"],
"cache": true
},
"test": {
Expand Down
3 changes: 3 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
],
"scripts": {
"build": "lerna run build --stream --include-dependencies --skip-nx-cache",
"build:nx": "nx run-many --target=build --all",
"build:vite": "rm -rf ./test-server/dist/ && vite build",
"build:nx-affected": "nx affected --target=build",
"watch": "nx run-many --target=watch --all --parallel 9999 --output-style=stream --maxParallel=0",
Expand Down Expand Up @@ -52,6 +53,7 @@
"@commitlint/config-conventional": "^17.3.0",
"@nx/workspace": "^21.2.1",
"@playwright/test": "1.55.0",
"@size-limit/file": "^12.1.0",
"@types/jest": "^29.2.4",
"@types/node": "^18.11.14",
"@typescript-eslint/eslint-plugin": "^5.46.1",
Expand Down Expand Up @@ -80,6 +82,7 @@
"nx": "^21.2.1",
"prettier": "^2.8.1",
"rimraf": "^3.0.2",
"size-limit": "^12.1.0",
"source-map": "^0.7.4",
"ts-jest": "^29.0.3",
"tslib": "^2.4.1",
Expand Down
Loading
Loading