Skip to content

test(e2e-rspack): expand to 3-scenario matrix (legacy + modern, rspack 1 + 2)#957

Merged
layershifter merged 1 commit into
microsoft:mainfrom
layershifter:feat/rspack-e2e-matrix
May 20, 2026
Merged

test(e2e-rspack): expand to 3-scenario matrix (legacy + modern, rspack 1 + 2)#957
layershifter merged 1 commit into
microsoft:mainfrom
layershifter:feat/rspack-e2e-matrix

Conversation

@layershifter
Copy link
Copy Markdown
Member

Summary

Restores coverage that #806 dropped (the legacy @griffel/webpack-extraction-plugin + @griffel/webpack-loader setup) and adds a Rspack 1.x permutation. The e2e/rspack project now runs three scenarios sequentially:

Scenario Rspack version Griffel setup
legacy-rspack-1 1.7.11 (pin) webpack-extraction-plugin + webpack-loader
legacy-rspack-2 workspace webpack-extraction-plugin + webpack-loader
modern-rspack-2 workspace webpack-plugin

Layout

  • e2e/rspack/src/shared/src/ — single source tree consumed by every scenario (drops the prior fake-module / fake-colors alias indirection).
  • e2e/rspack/src/scenarios/<name>/rspack.config.js — per-scenario config.
  • e2e/rspack/src/snapshots/<name>.css — per-scenario snapshot (all byte-identical today; per-scenario files leave room for divergence later).

test.ts iterates a SCENARIOS array. rspackVersion is optional — only legacy-rspack-1 pins, the other two pick up @rspack/{cli,core} from workspace devDeps via the bare-name form of installPackages.

Notable plumbing

  • compareSnapshots gains an update option. UPDATE_SNAPSHOTS=1 yarn nx run @griffel/e2e-rspack:test writes prettier-formatted output via the existing formatCSS helper instead of a raw copy.
  • e2e/rspack/package.json declares the real workspace deps the scenario sources import, so import-x/no-extraneous-dependencies is satisfied and a lint target can be added.
  • dependsOn gains { target: 'build-cjs', dependencies: true } so packages whose main is a CJS bundle (e.g. @griffel/core, @griffel/react) ship a populated lib/ in the tarball that gets packed into the e2e temp dir.
  • implicitDependencies is removed: the real package.json dep graph now covers everything Nx needs to build before this target runs.

Test plan

  • yarn nx run @griffel/e2e-rspack:test — all 3 scenarios pass from a cold nx reset + empty dist/
  • yarn nx run @griffel/e2e-rspack:lint — clean
  • yarn nx run @griffel/e2e-rspack:type-check — clean
  • yarn check-dependencies — clean
  • UPDATE_SNAPSHOTS=1 writes prettier-formatted snapshots that match a subsequent verify run

🤖 Generated with Claude Code

…k 1 + 2)

Restores coverage that PR microsoft#806 dropped and adds a Rspack 1.x permutation.
The e2e/rspack project now runs three scenarios sequentially:

| Scenario          | Rspack version | Griffel setup                                  |
| ----------------- | -------------- | ---------------------------------------------- |
| legacy-rspack-1   | 1.7.11 (pin)   | webpack-extraction-plugin + webpack-loader     |
| legacy-rspack-2   | workspace      | webpack-extraction-plugin + webpack-loader     |
| modern-rspack-2   | workspace      | webpack-plugin                                 |

Layout:
- e2e/rspack/src/shared/src/ — single source tree used by every scenario
  (drops the fake-module / fake-colors alias indirection)
- e2e/rspack/src/scenarios/<name>/rspack.config.js — per-scenario config
- e2e/rspack/src/snapshots/<name>.css — per-scenario snapshot

test.ts iterates a SCENARIOS array. rspackVersion is optional: only
legacy-rspack-1 pins, the other two pick up @rspack/{cli,core} from
workspace devDeps via the bare-name form of installPackages.

compareSnapshots gains an `update` option so UPDATE_SNAPSHOTS=1 writes
prettier-formatted output through the existing formatCSS helper instead
of a raw copy. All three committed snapshots are byte-identical.

Project wiring:
- Add @griffel/{e2e-utils,react,webpack-{plugin,extraction-plugin,loader}}
  to e2e/rspack/package.json so lint's import-x rule is satisfied.
- Add lint and build-cjs to the test target's dependsOn — covers core/react
  packages whose CJS bundle the e2e tarballs need.
- implicitDependencies dropped: real package.json deps + dep graph cover it.
@github-actions
Copy link
Copy Markdown
Contributor

📊 Bundle size report

✅ No changes found

@layershifter layershifter marked this pull request as ready for review May 20, 2026 08:48
@layershifter layershifter requested a review from a team as a code owner May 20, 2026 08:48
@layershifter layershifter enabled auto-merge (squash) May 20, 2026 08:49
@layershifter layershifter merged commit 6109bd6 into microsoft:main May 20, 2026
4 checks passed
@layershifter layershifter deleted the feat/rspack-e2e-matrix branch May 20, 2026 09:02
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