Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
103 commits
Select commit Hold shift + click to select a range
57af428
feat: Add lighthouse timespan
chrstph-dvx May 12, 2025
6bd16fb
Fix module import
chrstph-dvx May 12, 2025
fb0beb6
Run lighthouse during workflow
chrstph-dvx May 26, 2025
355c10b
Update job name
chrstph-dvx May 26, 2025
99d1077
update input
chrstph-dvx May 26, 2025
544ddd6
Fix build
chrstph-dvx May 26, 2025
f7981fa
Add debug
chrstph-dvx May 26, 2025
a18b7d9
Install chromium
chrstph-dvx May 26, 2025
0e99be8
Update package.json config
chrstph-dvx May 26, 2025
8cfa7f4
Update args
chrstph-dvx May 26, 2025
60e1fd0
Update chromium version
chrstph-dvx May 26, 2025
16e0872
Install dependencies
chrstph-dvx May 26, 2025
87f7f0f
WIP
chrstph-dvx May 26, 2025
5a25b16
Debug
chrstph-dvx May 26, 2025
b75153d
Cleanup
chrstph-dvx May 26, 2025
8a32e7f
WIP
chrstph-dvx May 26, 2025
b691f72
Debug
chrstph-dvx May 26, 2025
dd3295d
Update path
chrstph-dvx May 26, 2025
67e0e02
Add build and start
chrstph-dvx May 26, 2025
dff139c
Update environment variables
chrstph-dvx May 26, 2025
945d7f6
Update env
chrstph-dvx May 26, 2025
0649c82
Start server in the background
chrstph-dvx May 26, 2025
f8fcfef
Add poll
chrstph-dvx May 26, 2025
0bb4426
Update script
chrstph-dvx May 26, 2025
da20eea
WIP
chrstph-dvx May 26, 2025
af5cadf
WIP
chrstph-dvx May 27, 2025
8a3ba43
WIP
chrstph-dvx May 27, 2025
ce12781
WIP
chrstph-dvx May 27, 2025
abf65f1
WIP
chrstph-dvx May 27, 2025
f732c69
WIP
chrstph-dvx May 27, 2025
ea81148
WIP
chrstph-dvx May 27, 2025
3547921
WIP
chrstph-dvx May 27, 2025
f4ee771
Debug
chrstph-dvx May 27, 2025
4c171a1
Debug
chrstph-dvx May 27, 2025
64a00a7
Debug
chrstph-dvx May 27, 2025
5cf104d
Debug
chrstph-dvx May 27, 2025
51c21c9
Test
chrstph-dvx May 27, 2025
f24df20
Test
chrstph-dvx May 27, 2025
5b2f4f1
Test
chrstph-dvx May 27, 2025
e9a4b56
Test
chrstph-dvx May 27, 2025
0c8604e
Test
chrstph-dvx May 27, 2025
148b46b
Test
chrstph-dvx May 27, 2025
402270f
WIP
chrstph-dvx May 27, 2025
7feb4ac
Minimize diff
chrstph-dvx May 27, 2025
22c0dc8
WIP
chrstph-dvx May 27, 2025
87c579e
WIP
chrstph-dvx May 27, 2025
41d45e1
WIP
chrstph-dvx May 27, 2025
e10c638
WIP
chrstph-dvx May 27, 2025
6a689a8
WIP
chrstph-dvx May 27, 2025
48454b9
WIP
chrstph-dvx May 27, 2025
118cebf
WIP
chrstph-dvx May 27, 2025
a7f463d
Add Env variables
chrstph-dvx May 27, 2025
0fc4d7c
Add env variables to build
chrstph-dvx May 27, 2025
41b4134
WIP
chrstph-dvx May 27, 2025
14c331b
Cleanup, add long tasks
chrstph-dvx May 27, 2025
5cc87ca
Parsing
chrstph-dvx May 27, 2025
5fece24
Parsing
chrstph-dvx May 27, 2025
8df385f
Parsing
chrstph-dvx May 27, 2025
003be06
Parsing
chrstph-dvx May 27, 2025
ce5d0b3
Parsing
chrstph-dvx May 27, 2025
b036eca
Parsing
chrstph-dvx May 27, 2025
2c33625
Parsing
chrstph-dvx May 27, 2025
9823b1d
Parsing
chrstph-dvx May 27, 2025
4bcbfb3
Parsing
chrstph-dvx May 27, 2025
e02eece
Cleanup
chrstph-dvx May 27, 2025
57aceef
Run multiple tests
chrstph-dvx May 28, 2025
340d827
Run multiple tests
chrstph-dvx May 28, 2025
ca85f57
Run multiple lighthouse
chrstph-dvx May 30, 2025
cf526cc
Missing file
chrstph-dvx May 30, 2025
77e8bd0
WIP
chrstph-dvx May 30, 2025
a8e8f6d
Add tests
chrstph-dvx May 30, 2025
3c0f9e0
Format mock data
chrstph-dvx May 30, 2025
facce84
WIP
chrstph-dvx May 30, 2025
086bc45
Format
chrstph-dvx May 30, 2025
804d1c6
Add snapshot result
chrstph-dvx Jun 2, 2025
3cf295c
Text
chrstph-dvx Jun 2, 2025
6fe4e58
fix
chrstph-dvx Jun 2, 2025
aaae7ec
Add compare with lighthouse data
chrstph-dvx Jun 2, 2025
b2c7b83
Cleanup
chrstph-dvx Jun 2, 2025
7308be6
Upload artifacts
chrstph-dvx Jun 2, 2025
008225d
log
chrstph-dvx Jun 2, 2025
b007017
test
chrstph-dvx Jun 2, 2025
578a3d8
Add delta
chrstph-dvx Jun 2, 2025
c35c693
Format, upload report
chrstph-dvx Jun 2, 2025
cf825af
artifact
chrstph-dvx Jun 2, 2025
a53dbac
Update vite config
chrstph-dvx Jun 2, 2025
c59e536
WIP
chrstph-dvx Jun 2, 2025
80bcc58
WIP
chrstph-dvx Jun 2, 2025
46b0584
WIP
chrstph-dvx Jun 2, 2025
6c42dfb
WIP
chrstph-dvx Jun 2, 2025
ce01fc5
WIP
chrstph-dvx Jun 2, 2025
7c1fd9b
WIP
chrstph-dvx Jun 2, 2025
117bab1
format json
chrstph-dvx Jun 2, 2025
387f6e1
Remove ToS popup click
chrstph-dvx Jun 25, 2025
3d06b6e
Remove duplicate aria-label
chrstph-dvx Jun 25, 2025
98c2bc0
Fix
chrstph-dvx Jun 25, 2025
c7f95e0
Add bundle size metric
chrstph-dvx Jul 14, 2025
0f085c0
Update snapshot
chrstph-dvx Jul 14, 2025
428aab1
Debug
chrstph-dvx Jul 14, 2025
2a376a5
debug
chrstph-dvx Jul 14, 2025
ae61d18
debug
chrstph-dvx Jul 14, 2025
a820d32
Update baseline
chrstph-dvx Jul 14, 2025
db41337
Update unit
chrstph-dvx Jul 14, 2025
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
86 changes: 86 additions & 0 deletions .github/workflows/generate-lighthouse-diff.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,86 @@
name: Run Lighthouse Diff

on:
pull_request:
branches: ["master"]
types:
- opened
- reopened
- synchronize
# we skip ci for draft PRs
# https://github.com/reviewdog/action-eslint/issues/29#issuecomment-985939887
- ready_for_review
workflow_dispatch:
merge_group:

concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true

jobs:
generate_lighthouse_diff:
name: "Generate lighthouse diff"
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
token: ${{ secrets.GITHUB_TOKEN }}

- name: Setup Node.js
uses: actions/setup-node@v3
with:
node-version: '20'
cache: 'yarn'

- name: Install node_modules
uses: OffchainLabs/actions/node-modules/install@main

- name: Build scripts
run: yarn workspace scripts build

- name: Build the bridge
run: yarn build
env:
NEXT_PUBLIC_INFURA_KEY: ${{ secrets.NEXT_PUBLIC_INFURA_KEY }}
NEXT_PUBLIC_INFURA_KEY_ETHEREUM: https://mainnet.infura.io/v3/${{ secrets.NEXT_PUBLIC_INFURA_KEY }}
NEXT_PUBLIC_INFURA_KEY_SEPOLIA: https://sepolia.infura.io/v3/${{ secrets.NEXT_PUBLIC_INFURA_KEY }}
NEXT_PUBLIC_INFURA_KEY_ARBITRUM_ONE: https://arbitrum-mainnet.infura.io/v3/${{ secrets.NEXT_PUBLIC_INFURA_KEY }}
NEXT_PUBLIC_INFURA_KEY_BASE: https://base-mainnet.infura.io/v3/${{ secrets.NEXT_PUBLIC_INFURA_KEY }}
NEXT_PUBLIC_INFURA_KEY_ARBITRUM_SEPOLIA: https://arbitrum-sepolia.infura.io/v3/${{ secrets.NEXT_PUBLIC_INFURA_KEY }}
NEXT_PUBLIC_INFURA_KEY_BASE_SEPOLIA: https://base-sepolia.infura.io/v3/${{ secrets.NEXT_PUBLIC_INFURA_KEY }}
NEXT_PUBLIC_WALLETCONNECT_PROJECT_ID: ${{ secrets.NEXT_PUBLIC_WALLETCONNECT_PROJECT_ID }}
THE_GRAPH_NETWORK_API_KEY: ${{ secrets.THE_GRAPH_NETWORK_API_KEY }}

- name: Start server and wait
run: yarn start & npx wait-on http://localhost:3000

- name: Install linux dependencies
run: |
sudo apt-get update
sudo apt-get install --no-install-recommends -y \
fluxbox \
xvfb

- name: Run xvfb and fluxbox
run: |
Xvfb :0 -screen 0 1366x768x24 -listen tcp -ac &
fluxbox &
env:
DISPLAY: :0.0

- name: Run generateLighthouseDiff script
run: yarn workspace scripts generate-lighthouse-diff
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
NEXT_PUBLIC_INFURA_KEY: ${{ secrets.NEXT_PUBLIC_INFURA_KEY }}
DISPLAY: :0.0

- name: Upload reports
uses: actions/upload-artifact@v4
with:
name: lighthouse-reports-${{ github.sha }}
path: |
./lhreport.html
if-no-files-found: 'ignore'
continue-on-error: true
1 change: 1 addition & 0 deletions packages/arb-token-bridge-ui/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,7 @@
"start": "next start",
"test": "vitest --config vitest.config.ts --watch",
"test:ci": "vitest --config vitest.config.ts --run",
"test:perf": "ts-node ./tests/perf/switchNetwork.mts",
"lint": "tsc && eslint",
"lint:fix": "tsc && eslint --quiet --fix",
"prettier:format": "prettier --config-precedence file-override --write \"src/**/*.{tsx,ts,scss,md,json}\"",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -341,6 +341,7 @@ export function TokenRow({
onClick={() => onTokenSelected(token)}
style={{ ...style, minHeight: '84px' }}
disabled={!tokenIsBridgeable}
aria-label={`Select ${token?.symbol}`}
className={twMerge(
'flex w-full flex-row items-center justify-between px-4 py-3 transition duration-200 hover:bg-white/10',
tokenIsBridgeable
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -542,7 +542,6 @@ function TokensPanel({
errorMessage={errorMessage}
onSubmit={addNewToken}
SearchInputButton={AddButton}
dataCy="tokenSearchList"
isDialog={true}
>
<AutoSizer>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -155,6 +155,9 @@ export function NetworkButton({
)}
disabled={disabled}
onClick={onClick}
aria-label={
(isSource ? 'From: ' : 'To: ') + getNetworkName(selectedChainId)
}
>
<span className="max-w-[220px] truncate text-sm leading-[1.1] md:max-w-[250px] md:text-xl">
{isSource ? 'From:' : 'To: '} {getNetworkName(selectedChainId)}
Expand Down
11 changes: 2 additions & 9 deletions packages/arb-token-bridge-ui/tests/support/commands.ts
Original file line number Diff line number Diff line change
Expand Up @@ -163,20 +163,13 @@ export function typeAmount2(
export function findSourceChainButton(
chain: string
): Cypress.Chainable<JQuery<HTMLElement>> {
return cy
.findByRole('button', { name: `From: ${chain}` })
.should('be.visible')
return cy.get(`[aria-label="From: ${chain}"]`).should('be.visible')
}

export function findDestinationChainButton(
chain: string
): Cypress.Chainable<JQuery<HTMLElement>> {
return (
cy
//
.findByRole('button', { name: `To: ${chain}` })
.should('be.visible')
)
return cy.get(`[aria-label="To: ${chain}"]`).should('be.visible')
}

export function findGasFeeSummary(
Expand Down
5 changes: 4 additions & 1 deletion packages/scripts/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,8 @@
"test": "vitest",
"coverage": "vitest run --coverage",
"start": "node dist/index.js",
"add-orbit-chain": "node dist/scripts.cjs.js add-orbit-chain"
"add-orbit-chain": "node dist/scripts.cjs.js add-orbit-chain",
"generate-lighthouse-diff": "node dist/scripts.cjs.js generate-lighthouse-report"
},
"author": "",
"license": "ISC",
Expand All @@ -22,7 +23,9 @@
"commander": "^12.1.0",
"ethers": "^5.7.2",
"file-type": "^19.6.0",
"lighthouse": "^12.6.0",
"mime-types": "^2.1.35",
"puppeteer": "^24.9.0",
"sharp": "0.32.6",
"zod": "^3.23.8"
},
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,184 @@
import {
NavigationResult,
SnapshotResult,
TimespanResult,
} from "./parseLighthouseReports";
import { parseToFixedNumber } from "./parseToFixedNumber";

export async function compareLighthouseReports({
prevReport,
results,
}: {
prevReport: [NavigationResult, TimespanResult, SnapshotResult];
results: [NavigationResult, TimespanResult, SnapshotResult];
}): Promise<{
navigationDiff: NavigationResult;
timespanDiff: TimespanResult;
snapshotDiff: SnapshotResult;
}> {
// Compare Navigation Results
const prevNavigationResult = prevReport[0];
const navigationResult = results[0];
const navigationDiff = {
fcp: {
numericValue: parseToFixedNumber(
prevNavigationResult.fcp.numericValue -
navigationResult.fcp.numericValue,
3
),
score: parseToFixedNumber(
prevNavigationResult.fcp.score - navigationResult.fcp.score,
2
),
},
lcp: {
numericValue: parseToFixedNumber(
prevNavigationResult.lcp.numericValue -
navigationResult.lcp.numericValue,
3
),
score: parseToFixedNumber(
prevNavigationResult.lcp.score - navigationResult.lcp.score,
2
),
},
tbt: {
numericValue: parseToFixedNumber(
prevNavigationResult.tbt.numericValue -
navigationResult.tbt.numericValue,
3
),
score: parseToFixedNumber(
prevNavigationResult.tbt.score - navigationResult.tbt.score,
2
),
},
cls: {
numericValue: parseToFixedNumber(
prevNavigationResult.cls.numericValue -
navigationResult.cls.numericValue,
3
),
score: parseToFixedNumber(
prevNavigationResult.cls.score - navigationResult.cls.score,
2
),
},
speed: {
numericValue: parseToFixedNumber(
prevNavigationResult.speed.numericValue -
navigationResult.speed.numericValue,
3
),
score: parseToFixedNumber(
prevNavigationResult.speed.score - navigationResult.speed.score,
2
),
},
performance: parseToFixedNumber(
prevNavigationResult.performance - navigationResult.performance,
2
),
accessibility: parseToFixedNumber(
prevNavigationResult.accessibility - navigationResult.accessibility,
2
),
best_practices: parseToFixedNumber(
prevNavigationResult.best_practices - navigationResult.best_practices,
2
),
seo: parseToFixedNumber(prevNavigationResult.seo - navigationResult.seo, 2),
bundle_size: {
numericValue: parseToFixedNumber(
prevNavigationResult.bundle_size.numericValue -
navigationResult.bundle_size.numericValue,
3
),
score: parseToFixedNumber(
prevNavigationResult.bundle_size.score -
navigationResult.bundle_size.score,
2
),
},
} satisfies NavigationResult;

// Compare Timespan Results
const prevTimespanResult = prevReport[1];
const timespanResult = results[1];
const timespanDiff = {
tbt: {
numericValue: parseToFixedNumber(
prevTimespanResult.tbt.numericValue - timespanResult.tbt.numericValue,
3
),
score: parseToFixedNumber(
prevTimespanResult.tbt.score - timespanResult.tbt.score,
2
),
},
cls: {
numericValue: parseToFixedNumber(
prevTimespanResult.cls.numericValue - timespanResult.cls.numericValue,
3
),
score: parseToFixedNumber(
prevTimespanResult.cls.score - timespanResult.cls.score,
2
),
},
inp: {
numericValue: parseToFixedNumber(
prevTimespanResult.inp.numericValue - timespanResult.inp.numericValue,
3
),
score: parseToFixedNumber(
prevTimespanResult.inp.score - timespanResult.inp.score,
2
),
},
best_practices: parseToFixedNumber(
prevTimespanResult.best_practices - timespanResult.best_practices,
2
),
longTasks: {
durationMs: parseToFixedNumber(
prevTimespanResult.longTasks.durationMs -
timespanResult.longTasks.durationMs,
3
),
total: parseToFixedNumber(
prevTimespanResult.longTasks.total - timespanResult.longTasks.total,
2
),
},
performance: parseToFixedNumber(
prevTimespanResult.performance - timespanResult.performance,
2
),
} satisfies TimespanResult;

// Compare Snapshot Result
const prevSnapshotResult = prevReport[2];
const snapshotResult = results[2];
const snapshotDiff = {
performance: parseToFixedNumber(
prevSnapshotResult.performance - snapshotResult.performance,
2
),
accessibility: parseToFixedNumber(
prevSnapshotResult.accessibility - snapshotResult.accessibility,
2
),
best_practices: parseToFixedNumber(
prevSnapshotResult.best_practices - snapshotResult.best_practices,
2
),
seo: parseToFixedNumber(prevSnapshotResult.seo - snapshotResult.seo, 2),
} satisfies SnapshotResult;

return {
navigationDiff,
timespanDiff,
snapshotDiff,
};
}
Loading
Loading