diff --git a/.github/workflows/lighthouse.yml b/.github/workflows/lighthouse.yml deleted file mode 100644 index 1073b0c17b51..000000000000 --- a/.github/workflows/lighthouse.yml +++ /dev/null @@ -1,32 +0,0 @@ -name: 'Nightly: Lighthouse' - -# Nightly: builds the Lighthouse fixture app and uploads bundles to the -# lighthouse.sentry.gg lab. Never blocks merges. - -on: - schedule: - - cron: '0 0 * * *' - workflow_dispatch: - -jobs: - build-and-upload: - name: Bundle and upload Lighthouse cells - runs-on: namespace-profile-sentry-javascript-large - timeout-minutes: 30 - env: - LIGHTHOUSE_LAB_URL: ${{ secrets.LIGHTHOUSE_LAB_URL }} - LIGHTHOUSE_UPLOAD_TOKEN: ${{ secrets.LIGHTHOUSE_UPLOAD_TOKEN }} - VITE_E2E_TEST_DSN: 'https://username@domain/123' - steps: - - uses: actions/checkout@v7 - - name: Install pnpm - uses: ./.github/actions/install-pnpm - - uses: actions/setup-node@v7 - with: - node-version-file: 'package.json' - - run: pnpm install --frozen-lockfile - - run: pnpm run build:ci - - run: pnpm run build:tarball - - run: pnpm run test:prepare - working-directory: dev-packages/e2e-tests - - run: node scripts/lighthouse-bundle-and-upload.mjs diff --git a/dev-packages/e2e-tests/test-applications/lighthouse-react/index.html b/dev-packages/e2e-tests/test-applications/lighthouse-react/index.html deleted file mode 100644 index dbddfb003021..000000000000 --- a/dev-packages/e2e-tests/test-applications/lighthouse-react/index.html +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - - Lighthouse Fixture - - -
- - - diff --git a/dev-packages/e2e-tests/test-applications/lighthouse-react/package.json b/dev-packages/e2e-tests/test-applications/lighthouse-react/package.json deleted file mode 100644 index b0a9d2858d57..000000000000 --- a/dev-packages/e2e-tests/test-applications/lighthouse-react/package.json +++ /dev/null @@ -1,37 +0,0 @@ -{ - "name": "lighthouse-react-test-app", - "private": true, - "type": "module", - "sentryTest": { - "skip": true - }, - "scripts": { - "build": "vite build", - "build:no-sentry": "vite build --mode no-sentry", - "build:init-only": "vite build --mode init-only", - "build:errors-only": "vite build --mode errors-only", - "build:minimal-integrations": "vite build --mode minimal-integrations", - "build:no-integrations": "vite build --mode no-integrations", - "build:no-browser-api-errors": "vite build --mode no-browser-api-errors", - "build:no-breadcrumbs": "vite build --mode no-breadcrumbs", - "build:no-browser-session": "vite build --mode no-browser-session", - "build:tracing": "vite build --mode tracing", - "build:tracing-lazy-import": "vite build --mode tracing-lazy-import", - "build:tracing-replay": "vite build --mode tracing-replay", - "preview": "vite preview", - "clean": "npx rimraf node_modules pnpm-lock.yaml dist", - "test:build": "pnpm install && pnpm build" - }, - "dependencies": { - "@sentry/react": "file:../../packed/sentry-react-packed.tgz", - "react": "^18.3.1", - "react-dom": "^18.3.1" - }, - "devDependencies": { - "@types/react": "^18.3.0", - "@types/react-dom": "^18.3.0", - "@vitejs/plugin-react-swc": "^3.7.0", - "typescript": "~5.4.0", - "vite": "^5.4.0" - } -} diff --git a/dev-packages/e2e-tests/test-applications/lighthouse-react/pnpm-workspace.yaml b/dev-packages/e2e-tests/test-applications/lighthouse-react/pnpm-workspace.yaml deleted file mode 100644 index dafa2e7eca8c..000000000000 --- a/dev-packages/e2e-tests/test-applications/lighthouse-react/pnpm-workspace.yaml +++ /dev/null @@ -1,4 +0,0 @@ -allowBuilds: - '@swc/core': true - esbuild: true -minimumReleaseAge: 0 diff --git a/dev-packages/e2e-tests/test-applications/lighthouse-react/public/logo.svg b/dev-packages/e2e-tests/test-applications/lighthouse-react/public/logo.svg deleted file mode 100644 index a1ee6ba8d243..000000000000 --- a/dev-packages/e2e-tests/test-applications/lighthouse-react/public/logo.svg +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - diff --git a/dev-packages/e2e-tests/test-applications/lighthouse-react/src/App.tsx b/dev-packages/e2e-tests/test-applications/lighthouse-react/src/App.tsx deleted file mode 100644 index bf6e99e7419d..000000000000 --- a/dev-packages/e2e-tests/test-applications/lighthouse-react/src/App.tsx +++ /dev/null @@ -1,60 +0,0 @@ -import { useEffect, useState } from 'react'; - -const CARDS = [ - { title: 'Performance', body: 'Measure and optimize your app render times and interaction latency.' }, - { title: 'Accessibility', body: 'Ensure your interface is usable by everyone, including assistive technologies.' }, - { title: 'Best Practices', body: 'Follow modern web development patterns for secure and maintainable code.' }, - { title: 'SEO', body: 'Optimize discoverability with semantic markup and structured metadata.' }, - { title: 'PWA', body: 'Add offline support and installability via service workers and manifests.' }, - { title: 'Security', body: 'Protect users with CSP headers, HTTPS, and input validation.' }, -]; - -export default function App() { - const [count, setCount] = useState(0); - - useEffect(() => { - document.title = `Lighthouse Fixture (${count})`; - }, [count]); - - return ( -
-
- -
- -
- Lighthouse logo -

Lighthouse Fixture

-

- This app exists to measure JavaScript bundle size and runtime cost across three Sentry instrumentation - configurations. Each build mode ships a different level of SDK integration. -

-
- -
- {CARDS.map(card => ( -
-

{card.title}

-

{card.body}

-
- ))} -
- -
{ - e.preventDefault(); - setCount(c => c + 1); - }} - > - - - - -
-
- ); -} diff --git a/dev-packages/e2e-tests/test-applications/lighthouse-react/src/main.tsx b/dev-packages/e2e-tests/test-applications/lighthouse-react/src/main.tsx deleted file mode 100644 index 352c53c7208b..000000000000 --- a/dev-packages/e2e-tests/test-applications/lighthouse-react/src/main.tsx +++ /dev/null @@ -1,157 +0,0 @@ -import * as Sentry from '@sentry/react'; -import { createRoot } from 'react-dom/client'; -import App from './App'; - -const sentryInitStart = performance.now(); - -performance.measure('sentry-sdk-pre-init-duration', { - detail: { mode: import.meta.env.MODE ?? 'unknown_mode' }, - start: 0, - end: sentryInitStart, -}); - -performance.mark('sentry-sdk-init-start', { - detail: { mode: import.meta.env.MODE ?? 'unknown_mode' }, -}); - -if (import.meta.env.MODE === 'tracing-replay') { - Sentry.init({ - dsn: import.meta.env.VITE_E2E_TEST_DSN as string | undefined, - release: 'lighthouse-fixture', - environment: 'qa', - integrations: [Sentry.browserTracingIntegration(), Sentry.replayIntegration()], - tracesSampleRate: 1.0, - replaysSessionSampleRate: 1.0, - replaysOnErrorSampleRate: 1.0, - }); -} else if (import.meta.env.MODE === 'tracing') { - // Tracing + errors, but no replay — isolates the replay integration's cost. - Sentry.init({ - dsn: import.meta.env.VITE_E2E_TEST_DSN as string | undefined, - release: 'lighthouse-fixture', - environment: 'qa', - integrations: [Sentry.browserTracingIntegration()], - tracesSampleRate: 1.0, - }); -} else if (import.meta.env.MODE === 'tracing-lazy-import') { - // Tracing + errors, but browsertracing loaded lazily. - // (We don't recommend this setup anywhere and neither will it work well. - // this is purely for testing if it changes anything about overhead.) - Sentry.init({ - dsn: import.meta.env.VITE_E2E_TEST_DSN as string | undefined, - release: 'lighthouse-fixture', - environment: 'qa', - tracesSampleRate: 1.0, - }); - - import('@sentry/react').then(lazySentry => { - Sentry.addIntegration(lazySentry.browserTracingIntegration()); - }); -} else if (import.meta.env.MODE === 'errors-only') { - // Default integrations only — errors are always captured, no tracing or replay. - Sentry.init({ - dsn: import.meta.env.VITE_E2E_TEST_DSN as string | undefined, - release: 'lighthouse-fixture', - environment: 'qa', - }); -} else if (import.meta.env.MODE === 'minimal-integrations') { - // Minimal integratoins setup only (everything necessary to automatically get errors) - Sentry.init({ - dsn: import.meta.env.VITE_E2E_TEST_DSN as string | undefined, - release: 'lighthouse-fixture', - environment: 'qa', - defaultIntegrations: false, - integrations: [ - Sentry.globalHandlersIntegration(), - Sentry.linkedErrorsIntegration(), - Sentry.dedupeIntegration(), - // for good measure, let's include event filters since noise reduction is usually desired - // 99% of this integration's work is done in an event processor, so outside the hot path - Sentry.eventFiltersIntegration(), - ], - }); -} else if (import.meta.env.MODE === 'no-integrations') { - // DSN set but every integration disabled. Isolates the cost of the enabled - // client itself from the default instrumentation that wraps DOM/timer/network APIs. - Sentry.init({ - dsn: import.meta.env.VITE_E2E_TEST_DSN as string | undefined, - release: 'lighthouse-fixture', - environment: 'qa', - defaultIntegrations: false, - integrations: [], - }); -} else if (import.meta.env.MODE === 'no-browser-api-errors') { - // Default integrations minus BrowserApiErrors, which wraps addEventListener/ - // removeEventListener on ~32 prototypes plus setTimeout/setInterval/rAF/XHR. - // Isolates that global monkey-patching cost from the rest of the defaults. - Sentry.init({ - dsn: import.meta.env.VITE_E2E_TEST_DSN as string | undefined, - release: 'lighthouse-fixture', - environment: 'qa', - integrations: defaultIntegrations => - defaultIntegrations.filter(integration => integration.name !== 'BrowserApiErrors'), - }); -} else if (import.meta.env.MODE === 'no-breadcrumbs') { - // Default integrations minus Breadcrumbs, which adds a lot of monkey patching to - // DOM and Network APIs as well as event targets and listeners - Sentry.init({ - dsn: import.meta.env.VITE_E2E_TEST_DSN as string | undefined, - release: 'lighthouse-fixture', - environment: 'qa', - integrations: defaultIntegrations => defaultIntegrations.filter(integration => integration.name !== 'Breadcrumbs'), - }); -} else if (import.meta.env.MODE === 'no-browser-session') { - // Default integrations minus Breadcrumbs, which adds a lot of monkey patching to - // DOM and Network APIs as well as event targets and listeners - Sentry.init({ - dsn: import.meta.env.VITE_E2E_TEST_DSN as string | undefined, - release: 'lighthouse-fixture', - environment: 'qa', - integrations: defaultIntegrations => - defaultIntegrations.filter(integration => integration.name !== 'BrowserSession'), - }); -} else if (import.meta.env.MODE === 'init-only') { - // enabled: false makes the SDK a guaranteed no-op (no transport allocation, - // no DSN warning). We're measuring pure SDK-loading + tree-shaking cost. - Sentry.init({ enabled: false }); -} - -performance.measure('sentry-sdk-init-duration', { - detail: { mode: import.meta.env.MODE ?? 'unknown_mode' }, - start: sentryInitStart, - end: performance.now(), -}); -performance.mark('sentry-sdk-init-end', { - detail: { mode: import.meta.env.MODE ?? 'unknown_mode' }, -}); - -// 'no-sentry' mode: all branches above are statically dead, so Vite drops -// the @sentry/react import entirely from the bundle. - -// Elements tagged with `elementtiming` (e.g. the hero logo) emit a -// PerformanceElementTiming entry when painted. Re-emit each as a -// performance.measure spanning time origin -> render so the element's render -// duration lands on the same timeline as the SDK init marks. -// `PerformanceElementTiming` isn't in this project's TS lib, so type it locally. -type ElementTimingEntry = PerformanceEntry & { - identifier: string; - renderTime: number; - loadTime: number; -}; - -const elementTimingObserver = new PerformanceObserver(list => { - for (const entry of list.getEntries() as ElementTimingEntry[]) { - const renderEnd = entry.renderTime || entry.loadTime; - - performance.measure(`element-timing-${entry.identifier}`, { - detail: { mode: import.meta.env.MODE ?? 'unknown_mode', identifier: entry.identifier }, - start: 0, - end: renderEnd, - }); - } -}); - -elementTimingObserver.observe({ type: 'element', buffered: true }); - -const root = createRoot(document.getElementById('root')!); -root.render(); diff --git a/dev-packages/e2e-tests/test-applications/lighthouse-react/tsconfig.json b/dev-packages/e2e-tests/test-applications/lighthouse-react/tsconfig.json deleted file mode 100644 index 3934b8f6d676..000000000000 --- a/dev-packages/e2e-tests/test-applications/lighthouse-react/tsconfig.json +++ /dev/null @@ -1,21 +0,0 @@ -{ - "compilerOptions": { - "target": "ES2020", - "useDefineForClassFields": true, - "lib": ["ES2020", "DOM", "DOM.Iterable"], - "module": "ESNext", - "skipLibCheck": true, - "moduleResolution": "bundler", - "allowImportingTsExtensions": true, - "resolveJsonModule": true, - "isolatedModules": true, - "noEmit": true, - "jsx": "react-jsx", - "strict": true, - "noUnusedLocals": true, - "noUnusedParameters": true, - "noFallthroughCasesInSwitch": true - }, - "include": ["src"], - "references": [{ "path": "./tsconfig.node.json" }] -} diff --git a/dev-packages/e2e-tests/test-applications/lighthouse-react/tsconfig.node.json b/dev-packages/e2e-tests/test-applications/lighthouse-react/tsconfig.node.json deleted file mode 100644 index 42872c59f5b0..000000000000 --- a/dev-packages/e2e-tests/test-applications/lighthouse-react/tsconfig.node.json +++ /dev/null @@ -1,10 +0,0 @@ -{ - "compilerOptions": { - "composite": true, - "skipLibCheck": true, - "module": "ESNext", - "moduleResolution": "bundler", - "allowSyntheticDefaultImports": true - }, - "include": ["vite.config.ts"] -} diff --git a/dev-packages/e2e-tests/test-applications/lighthouse-react/vite.config.ts b/dev-packages/e2e-tests/test-applications/lighthouse-react/vite.config.ts deleted file mode 100644 index 4f312acb1a84..000000000000 --- a/dev-packages/e2e-tests/test-applications/lighthouse-react/vite.config.ts +++ /dev/null @@ -1,6 +0,0 @@ -import { defineConfig } from 'vite'; -import react from '@vitejs/plugin-react-swc'; - -export default defineConfig({ - plugins: [react()], -});