Skip to content

chore: setup test (unit, e2e)#41

Merged
2wheeh merged 8 commits into
mainfrom
chore/test-setup
May 7, 2026
Merged

chore: setup test (unit, e2e)#41
2wheeh merged 8 commits into
mainfrom
chore/test-setup

Conversation

@2wheeh
Copy link
Copy Markdown
Owner

@2wheeh 2wheeh commented Apr 30, 2026

No description provided.

@changeset-bot
Copy link
Copy Markdown

changeset-bot Bot commented Apr 30, 2026

⚠️ No Changeset found

Latest commit: 6a197ba

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

@vercel
Copy link
Copy Markdown

vercel Bot commented Apr 30, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
react-virtual-masonry-docs Ready Ready Preview, Comment May 2, 2026 2:18am

2wheeh and others added 5 commits May 2, 2026 00:23
Adds vitest unit harness in `package/` and a playwright e2e harness
driving an `examples/tanstack-start/` app with client-only, SSR, and
SSR-debug routes. The harness exists to validate TanStack Virtual's
SSR behavior under our Masonry component before RFC-0002 implementation.

Verified empirically:
- `useWindowVirtualizer` is SSR-safe (no crash, all DOM access guarded)
- `getVirtualItems()` returns `[]` server-side (no rect)
- `measurementsCache` (public field) is populated as a side effect of
  `getVirtualItems()` even on the server, exposing the lane-assignment
  output without DOM
- `getMeasurements()` itself is `private` in TanStack's d.ts — public
  workaround documented in the SSR debug route

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Brings the example closer to the official `start-basic` shape from
TanStack Router so it reads as an idiomatic Start app rather than a
bespoke harness:

- Drop `@tanstack/router-plugin` dep — covered by `tanstackStart` plugin
- Move port config from `--port` CLI flags into `vite.config.ts`
- Pass `srcDirectory: 'src'` to `tanstackStart` (matches official)
- Simplify build script to `vite build && tsc -p tsconfig.typecheck.json`
- Keep `tsr generate` only in standalone `check-types` (still required
  for the monorepo's turbo-driven typecheck path)

Also strips planning-doc references from test names, comments, and route
copy so the harness reads on its own merits. Renames
`ssr-hypothesis.spec.ts` → `virtualizer-ssr.spec.ts` for the same reason.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Adds a CI workflow that runs on every PR and on pushes to main:

- `lint` — oxlint
- `check-types` — turbo-driven tsc across workspaces
- `test` — vitest unit suite in `package/`
- `e2e` — playwright suite against the tanstack-start example,
  with Playwright browser caching keyed by `pnpm-lock.yaml`

E2E uploads the playwright-report as an artifact on every run for
post-mortem analysis. Concurrency is grouped by ref so PR pushes
cancel in-flight runs while main commits do not.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Vite 7 resolves SSR builds with a separate condition list that does not
inherit from `resolve.conditions` by default. Anywhere we rely on the
workspace `customConditions` to read sibling packages from source, the
SSR resolver must be configured the same way or it falls back to
`import` and demands a built `dist/`.

Updates two configs that prerender or run on the server:

- `docs/vocs.config.ts`: dev-mode-only mirror of the existing client
  conditions, matching vocs's existing dev/prod split (prod still uses
  the published `dist/` of workspace packages, as before).
- `examples/tanstack-start/vite.config.ts`: always-on, both client and
  ssr resolve from source. The example exists to validate SSR layout
  patterns; testing the lib's published shape is a separate concern
  covered by the package's own build pipeline.

`demo` (SPA, no SSR) and `package`'s vitest config (no SSR) need no
change.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@2wheeh 2wheeh changed the title Chore/test setup chore: setup test (unit, e2e) May 7, 2026
@2wheeh 2wheeh marked this pull request as ready for review May 7, 2026 08:10
@2wheeh 2wheeh merged commit e49bd44 into main May 7, 2026
5 checks passed
@2wheeh 2wheeh deleted the chore/test-setup branch May 7, 2026 08:11
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