test(e2e-rspack): expand to 3-scenario matrix (legacy + modern, rspack 1 + 2)#957
Merged
Merged
Conversation
…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.
Contributor
📊 Bundle size report✅ No changes found |
bsunderhus
approved these changes
May 20, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Restores coverage that #806 dropped (the legacy
@griffel/webpack-extraction-plugin+@griffel/webpack-loadersetup) and adds a Rspack 1.x permutation. Thee2e/rspackproject now runs three scenarios sequentially:legacy-rspack-1webpack-extraction-plugin+webpack-loaderlegacy-rspack-2webpack-extraction-plugin+webpack-loadermodern-rspack-2webpack-pluginLayout
e2e/rspack/src/shared/src/— single source tree consumed by every scenario (drops the priorfake-module/fake-colorsalias 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.tsiterates aSCENARIOSarray.rspackVersionis optional — onlylegacy-rspack-1pins, the other two pick up@rspack/{cli,core}from workspace devDeps via the bare-name form ofinstallPackages.Notable plumbing
compareSnapshotsgains anupdateoption.UPDATE_SNAPSHOTS=1 yarn nx run @griffel/e2e-rspack:testwrites prettier-formatted output via the existingformatCSShelper instead of a raw copy.e2e/rspack/package.jsondeclares the real workspace deps the scenario sources import, soimport-x/no-extraneous-dependenciesis satisfied and alinttarget can be added.dependsOngains{ target: 'build-cjs', dependencies: true }so packages whosemainis a CJS bundle (e.g.@griffel/core,@griffel/react) ship a populatedlib/in the tarball that gets packed into the e2e temp dir.implicitDependenciesis removed: the realpackage.jsondep 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 coldnx reset+ emptydist/yarn nx run @griffel/e2e-rspack:lint— cleanyarn nx run @griffel/e2e-rspack:type-check— cleanyarn check-dependencies— cleanUPDATE_SNAPSHOTS=1writes prettier-formatted snapshots that match a subsequent verify run🤖 Generated with Claude Code