Skip to content

THE-11: define and enforce popup/script performance budgets#75

Merged
ConduciveMammal merged 2 commits intocodex/theme-explorer-v2from
codex/the-11-performance-budget
Feb 12, 2026
Merged

THE-11: define and enforce popup/script performance budgets#75
ConduciveMammal merged 2 commits intocodex/theme-explorer-v2from
codex/the-11-performance-budget

Conversation

@ConduciveMammal
Copy link
Owner

@ConduciveMammal ConduciveMammal commented Feb 12, 2026

Summary

This PR completes THE-11 by adding enforceable performance budgets for extension footprint and popup load timing, and by wiring those checks into release QA.

New checks

1) Static footprint budget check

Script: scripts/qa/check-performance-budget.js

What it validates from the production build (build-vite):

  • popupJsBytes
  • popupCssBytes
  • popupAssetBytes
  • popupFootprintBytes
  • contentScriptBytes
  • injectScriptBytes
  • backgroundScriptBytes

Behaviour:

  • Reads thresholds + baselines from config/performance-budget.json
  • Prints a formatted report with current/baseline/budget/delta
  • Fails with non-zero exit code if any metric exceeds budget

2) Popup render-time budget check

Script: scripts/qa/check-popup-render-time.js

How it works:

  • Serves build-vite locally
  • Launches headless Chrome
  • Loads src/pages/Popup/index.html
  • Reads data-theme-explorer-popup-first-render-ms from the rendered DOM

Behaviour:

  • Compares measured popupFirstRenderMs against budget in config/performance-budget.json
  • Outputs PASS/FAIL with delta from baseline
  • Fails with non-zero exit code on budget breach

Runtime instrumentation

  • src/pages/Popup/Popup.jsx now records first terminal render duration and exposes it as:
    • window.__THEME_EXPLORER_PERF__.popupFirstRenderMs
    • data-theme-explorer-popup-first-render-ms on <html>

QA / CI integration

  • package.json
    • qa:performance now runs both checks:
      • check-performance-budget.js
      • check-popup-render-time.js
    • qa:verify-build invokes qa:performance
  • .github/workflows/qa-release-candidate.yml
    • Adds Chrome setup (browser-actions/setup-chrome@v1)
    • Passes CHROME_PATH into QA step for deterministic CI execution

Documentation updates

  • Added docs/qa/performance-budget.md
  • Updated:
    • docs/qa/release-checklist.md
    • docs/qa/release-pipeline.md

Validation performed

  • npm run build:prod
  • npm run qa:performance
  • npm run qa:verify-build

All checks passed locally on commit b734255.

@ConduciveMammal ConduciveMammal merged commit eb47983 into codex/theme-explorer-v2 Feb 12, 2026
1 check passed
@ConduciveMammal ConduciveMammal deleted the codex/the-11-performance-budget branch February 12, 2026 19:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant