Skip to content

feat(sandbox): perf stress tests, shared sidebar, tailwind benchmark#5719

Merged
quantizor merged 6 commits into
mainfrom
feat/sandbox-stress-test
Apr 4, 2026
Merged

feat(sandbox): perf stress tests, shared sidebar, tailwind benchmark#5719
quantizor merged 6 commits into
mainfrom
feat/sandbox-stress-test

Conversation

@quantizor

Copy link
Copy Markdown
Contributor

Summary

  • Performance stress test scenarios: 5 pages exercising styled-components at scale—1000-cell data grid, dashboard with deep tree/attrs, 30-input form with attrs chains, 50-item inbox list with unmount/remount, and 110-definition type stress test
  • Auto-run benchmarking: pages auto-run 50 iterations on visit with sticky timer display showing median/min/max stats, seeded PRNG for deterministic SSR/client hydration
  • Shared sidebar navigation: replaces per-page back links and home cards, theme toggle moved to sidebar footer via context
  • Tailwind benchmark: adds Tailwind CSS v4 as benchmark competitor, removes obsolete puppeteer headless runner
  • Hydration fixes: seeded PRNG (mulberry32) eliminates Math.random/Date.now mismatches, void element fix for styled.input with children, empty src fix for styled.img

…runner

Adds Tailwind CSS v4 as a benchmark competitor using @tailwindcss/webpack.
Removes the puppeteer-based headless runner (benchmarks are run via
browser now). Alphabetizes peerDependencies and devDependencies in
styled-components package.json.
Replace per-page back links and home cards with a persistent sidebar.
Theme toggle moved from fixed-position button to sidebar footer via
ThemeToggleContext (useCallback + useMemo for stable references).
Delete dead home-content.tsx and back-link.tsx. Fix root .gitignore
lib -> /lib to stop matching app/lib/ in sandbox.
Five scenarios exercising styled-components at scale:
- Data Grid: 1000 cells with dynamic status/priority props
- Dashboard: deep tree with attrs, stat cards, table, activity list
- Form: 30 inputs with 3-level attrs chains, validate/reset cycles
- List: 50 inbox items, shuffle forces full unmount/remount
- Types: 110 styled definitions stressing TS type checker

Shared utilities: seeded PRNG (mulberry32) for deterministic SSR/client
data, render timer hook with auto-run (50x on page visit), sticky
timer display with median/min/max stats and tabular-nums layout.
@changeset-bot

changeset-bot Bot commented Apr 3, 2026

Copy link
Copy Markdown

⚠️ No Changeset found

Latest commit: 9e0b060

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR expands the sandbox and benchmarks to support repeatable performance stress testing scenarios, introduces a shared sidebar-based navigation layout (with theme toggle moved into it), and adds a Tailwind v4 benchmark implementation.

Changes:

  • Add multiple sandbox /perf/* stress-test pages plus shared timing/auto-run utilities and deterministic data generation.
  • Replace per-page navigation elements with a shared sidebar + theme-toggle context, and simplify the home page.
  • Add Tailwind v4 as a benchmark implementation and wire it into the webpack build (removing the Puppeteer headless runner).

Reviewed changes

Copilot reviewed 44 out of 46 changed files in this pull request and generated 3 comments.

Show a summary per file
File Description
pnpm-lock.yaml Adds Tailwind + loader deps
packages/styled-components/package.json Minor dev/peer dep ordering
packages/sandbox/app/rsc/page.tsx Removes BackLink; formatting tweaks
packages/sandbox/app/rsc/layout.tsx JSX layout formatting
packages/sandbox/app/perf/types/page.tsx New TS type stress page
packages/sandbox/app/perf/list/page.tsx New list unmount/remount test
packages/sandbox/app/perf/lib/use-render-timer.ts New render timer + auto-run hooks
packages/sandbox/app/perf/lib/timer-display.tsx New sticky timer UI
packages/sandbox/app/perf/lib/data-generators.ts Seeded PRNG + test data
packages/sandbox/app/perf/form/page.tsx New attrs-heavy form test
packages/sandbox/app/perf/data-grid/page.tsx New 1000-cell grid test
packages/sandbox/app/perf/dashboard/page.tsx New deep-tree dashboard test
packages/sandbox/app/page.tsx New simpler home content
packages/sandbox/app/lib/theme.ts Theme contract via createTheme
packages/sandbox/app/lib/test-themes.ts Adds light/dark theme presets
packages/sandbox/app/lib/registry.tsx New Next.js styled-components registry
packages/sandbox/app/lib/dark-theme-script.ts Generates CSS var overrides
packages/sandbox/app/layout.tsx Adds shared sidebar + content shell
packages/sandbox/app/global-style-test/toggle-client.tsx Formatting changes
packages/sandbox/app/global-style-test/page.tsx Formatting changes
packages/sandbox/app/global-style-test/page-b/page.tsx Formatting changes
packages/sandbox/app/global-style-test/page-a/page.tsx Formatting changes
packages/sandbox/app/global-style-test/nav-client.tsx Formatting changes
packages/sandbox/app/global-style-test/layout.tsx Removes BackLink; formatting
packages/sandbox/app/global-style-test/global-style-checks.tsx Formatting changes
packages/sandbox/app/global-style-test/autopilot-client.tsx Formatting changes
packages/sandbox/app/components/theme-provider.tsx Theme toggle via context
packages/sandbox/app/components/test-summary.tsx Formatting changes
packages/sandbox/app/components/sidebar.tsx New shared sidebar nav
packages/sandbox/app/components/home-content.tsx Removed (replaced by sidebar UX)
packages/sandbox/app/components/back-link.tsx Removed (replaced by sidebar UX)
packages/sandbox/app/components/auto-test.tsx Formatting changes
packages/sandbox/app/client-example/testing-harness.tsx Formatting changes
packages/sandbox/app/client-example/page.tsx Removes BackLink usage
packages/benchmarks/webpack.config.js Adds Tailwind webpack loader
packages/benchmarks/src/implementations/tailwind/View.js Tailwind View primitive
packages/benchmarks/src/implementations/tailwind/styles.css Tailwind CSS import
packages/benchmarks/src/implementations/tailwind/Provider.js Tailwind provider passthrough
packages/benchmarks/src/implementations/tailwind/index.js Tailwind impl entrypoint
packages/benchmarks/src/implementations/tailwind/Dot.js Tailwind Dot component
packages/benchmarks/src/implementations/tailwind/Box.js Tailwind Box component
packages/benchmarks/src/impl.js Registers Tailwind in impl map
packages/benchmarks/run-headless.js Removed Puppeteer runner
packages/benchmarks/package.json Adds Tailwind deps; CSS sideEffects
AGENTS.md Updates TS perf guidance
.gitignore Narrows ignore from lib to /lib
Files not reviewed (1)
  • pnpm-lock.yaml: Language not supported

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread packages/sandbox/app/lib/registry.tsx
Comment thread packages/sandbox/app/perf/dashboard/page.tsx
Comment thread packages/benchmarks/package.json Outdated
margin: -var(...) is invalid CSS — var() returns a token sequence
that can't take unary minus. Tailwind v4 oxide requires Node >=20.
@quantizor quantizor merged commit 67c528f into main Apr 4, 2026
5 checks passed
@quantizor quantizor deleted the feat/sandbox-stress-test branch April 4, 2026 02:57
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.

2 participants