chore(css-modules): 🤖 initial css modules setup#810
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
🦋 Changeset detectedLatest commit: dc3dbf8 The changes in this PR will be included in the next version bump. This PR includes changesets to release 1 package
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
77d9494 to
076d438
Compare
EvandroLG
left a comment
There was a problem hiding this comment.
Both tokens-dark.css and tokens-light.css are generated files, so we might run into annoying merge conflicts. Maybe we should add them to .gitignore and generate them at build time instead, WDYT?
Also, I’d add a comment to these files warning that they shouldn’t be edited manually. Something like:
/* AUTO-GENERATED — DO NOT EDIT */…ria-busy={loading}
…emove generate quotes,e tc
…re, e.g. remove babel plugins
…shimmer animation.
- aria-disabled={(disabled || loading) || undefined}
- aria-busy={loading || undefined} due to accessibility
21669c4 to
dc3dbf8
Compare
|
Claude finished @punkbit's task in 3m 13s —— View job Code Review
Great work on this foundational PR! The CSS Modules setup is clean and well-structured. Here's the full review of the current state. ✅ Previously flagged issues — all resolved
✅ What's solid
💡 Suggestion (non-blocking)
/* current */
transition: font var(--click-transition-default);The CSS Acknowledged / Deferred
The build pipeline, BEM naming, token usage, accessibility attributes, and test coverage are all well-done. Ready to merge once the dependency on #773 and #784 is satisfied. 🙌 |
📚 Storybook Preview Deployed✅ Preview URL: https://click-qi04bmplb-clickhouse.vercel.app Built from commit: |
Why?
Provide the initial setup foundations for CSS Modules for migrating from Styled-Components in a sustainable and iterative manner.
This library will now use CSS Modules for styling and is distributed unbundled, giving your application full control over bundling and optimisations. This means you only include what you actually use, resulting in smaller bundle sizes and better performance!
Regression risk assessment
The migration workflow provides visual regression tests, including changes to tests to include every relevant component state. For example, the following are implementations of it in practice:
chore: 🤖 support local visual regression testing via docker
#931
chore: 🤖 GitHub action for visual regression (development environment based [initial version])
#932
It ensures consistent visual regression snapshots by enabling local testing within a Dockerized environment. This prevents false positive diffs caused by operating system variations, e.g., macOS vs. linux.
Introduces a GitHub Action for visual regression testing within the CI/CD pipeline. Unlike our existing Chromatic implementation, which relies on Storybook stories and cloud-managed snapshots, this action executes tests using screenshots managed directly within the development environment (curated by author). This ensures snapshots remain tightly coupled with the implementation code.
It's important to note that the CI/CD process runs in every pull request contribution, under a matching Linux instance encountered in the local dev setup for an accelerated feedback loop.
Furthermore, these visual regression tests differ from the cloud-based regression testing Chromatic, as they're closer to local development setup, e.g. a contributor can run them in their environment immediately. Comparatively, the Chromatic setup provides feedback at a later stage of contribution, e.g. only running in the Cloud, causing the feedback loop to be much slower. While Chromatic automatically generates tests based on Storybook story screenshots, the local regression test suite allows the contributor to curate these for proper assessment and more in line with the intended implementation and behaviour checkup, e.g. can assess components singularly, compose scenarios with multiple components, and run interactive userflows to cause state changes.
Finally, it runs on Playwright but is adapted to Chromatic's extension, allowing for easier interchangeability.
Bug tracking
The Click UI has issues tracked, which can further any reports found during any test or release.
For example, during the migration process, there's an opportunity to snapshot and enhance checkups for proper testing against expected behaviour. If differences or unexpected behaviour's detected, these can be compared to the original Styled Component version and resolved comparatively, e.g. on visual regression testing, a local development suit is made available to help catch during time of contribution. Before, visual regression tests are solely base in Chromatic, which are autogenerated.
How?
Preview?
demo-button-ss-to-css-migration-states.mov
Demonstrates computed CSS Module in DOM
Distribution showcasing Button.module.css (in-place)