Skip to content

Commit 7917828

Browse files
authored
Merge pull request #35 from github/more-examples
More examples
2 parents 6e1cb90 + 378452c commit 7917828

37 files changed

Lines changed: 1798 additions & 242 deletions

.changeset/better-ideas-watch.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
'@github-ui/storybook-addon-performance-panel': patch
3+
---
4+
5+
Improve forced reflow detection by instrumenting CSS style property setters. Previously only layout-triggering getter reads were monitored, so write-then-read patterns using `element.style.width = '...'` or `style.setProperty()` were missed. The collector now intercepts writes to layout-affecting CSS properties (width, height, margin, padding, position, etc.) to correctly mark layout as dirty before a subsequent reflow-triggering read.
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
'@github-ui/storybook-addon-performance-panel': patch
3+
---
4+
5+
Fix Element Timing collector not clearing on reset or story switch. Entries from the browser's performance timeline persisted across resets because `buffered: true` replayed stale entries. The collector now tracks an epoch timestamp and filters out entries recorded before the last reset/start.

.github/workflows/ci.yml

Lines changed: 4 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -71,13 +71,9 @@ jobs:
7171
- run: npm run tsc
7272

7373
test:
74-
name: Test (${{ matrix.browser }})
74+
name: Test
7575
needs: install
7676
runs-on: ubuntu-latest
77-
strategy:
78-
fail-fast: false
79-
matrix:
80-
browser: [chromium, firefox, webkit]
8177
steps:
8278
- uses: actions/checkout@v6
8379
- uses: actions/setup-node@v6
@@ -93,40 +89,15 @@ jobs:
9389
- uses: actions/cache@v5
9490
with:
9591
path: ~/.cache/ms-playwright
96-
key: playwright-${{ matrix.browser }}-${{ hashFiles('**/package-lock.json') }}
97-
- run: npx playwright install --with-deps ${{ matrix.browser }}
92+
key: playwright-${{ hashFiles('**/package-lock.json') }}
93+
- run: npx playwright install --with-deps chromium firefox webkit
9894
- run: npx vitest run --project browser
9995
working-directory: packages/storybook-addon-performance-panel
100-
env:
101-
VITEST_BROWSER: ${{ matrix.browser }}
102-
103-
build:
104-
name: Build Docs
105-
needs: install
106-
runs-on: ubuntu-latest
107-
steps:
108-
- uses: actions/checkout@v6
109-
- uses: actions/setup-node@v6
110-
with:
111-
node-version-file: '.nvmrc'
112-
- uses: actions/cache/restore@v5
113-
with:
114-
path: |
115-
node_modules
116-
packages/*/node_modules
117-
packages/storybook-addon-performance-panel/dist
118-
key: deps-${{ github.sha }}
119-
- run: npm run build-storybook -w @github-ui/docs
120-
- uses: actions/upload-artifact@v6
121-
with:
122-
name: addon-dist
123-
path: packages/storybook-addon-performance-panel/dist/
124-
retention-days: 7
12596

12697
ci:
12798
name: CI
12899
if: always()
129-
needs: [lint, typecheck, test, build]
100+
needs: [lint, typecheck, test]
130101
runs-on: ubuntu-latest
131102
steps:
132103
- run: |

eslint.config.ts

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ import eslint from '@eslint/js'
22
import type {Linter} from 'eslint'
33
import type {ESLint} from 'eslint'
44
import {defineConfig} from 'eslint/config'
5+
import jsxA11y from 'eslint-plugin-jsx-a11y'
56
import eslintPluginPrettier from 'eslint-plugin-prettier/recommended'
67
import eslintPluginReact from 'eslint-plugin-react'
78
import eslintPluginReactHooks from 'eslint-plugin-react-hooks'
@@ -13,6 +14,10 @@ export default defineConfig(
1314
{
1415
ignores: ['**/dist/**', '**/node_modules/**', '**/storybook-static/**'],
1516
},
17+
{
18+
// ESLint 9 ignores dotfiles by default; explicitly include .storybook
19+
files: ['**/.storybook/**/*.{ts,tsx}'],
20+
},
1621
eslint.configs.recommended,
1722
tseslint.configs.strictTypeChecked,
1823
tseslint.configs.stylisticTypeChecked,
@@ -33,6 +38,8 @@ export default defineConfig(
3338
settings: {react: {version: 'detect'}},
3439
},
3540
eslintPluginReact.configs.flat['jsx-runtime'] as Linter.Config,
41+
42+
jsxA11y.flatConfigs.strict,
3643
{
3744
plugins: {'react-hooks': eslintPluginReactHooks as unknown as ESLint.Plugin},
3845
rules: eslintPluginReactHooks.configs.recommended.rules,

0 commit comments

Comments
 (0)