![Create React App Officially Deprecated Amid React 19 Compatibility Issues](https://cdn.sanity.io/images/cgdhsj6q/production/04fa08cf844d798abc0e1a6391c129363cc7e2ab-1024x1024.webp?w=400&fit=max&auto=format)
Security News
Create React App Officially Deprecated Amid React 19 Compatibility Issues
Create React App is officially deprecated due to React 19 issues and lack of maintenance—developers should switch to Vite or other modern alternatives.
chromatic
Advanced tools
Automate visual testing across browsers. Gather UI feedback. Versioned documentation.
The npm package 'chromatic' is a tool designed to help developers automate visual testing for their UI components. It captures snapshots of components and runs visual regression tests to ensure that changes do not break the visual appearance of applications. Chromatic integrates with Storybook to manage component libraries and streamline the testing process.
Visual Testing
This code sample demonstrates how to add a visual test for a simple button component using Chromatic with Storybook. The 'withChromatic' decorator is used to enable Chromatic's snapshot capabilities for the component.
import { storiesOf } from '@storybook/react';
import { withChromatic } from 'chromatic/isolated';
storiesOf('Button', module)
.addDecorator(withChromatic)
.add('default', () => <button>Click me</button>);
Snapshot Management
This code configures Chromatic to take snapshots after a delay and at specified screen widths, facilitating responsive visual testing. It helps in managing how snapshots are captured based on different device widths.
import { configure } from '@storybook/react';
import { setChromaticOptions } from 'chromatic';
setChromaticOptions({
delay: 300, // Delay in ms before taking a snapshot
widths: [320, 1200] // Array of widths for responsive testing
});
configure(() => require('./stories'), module);
Storybook is a user interface development environment and playground for UI components. It facilitates building UI components in isolation and structuring a component library. While it does not offer visual regression testing by itself, it is often used in conjunction with Chromatic to provide that functionality.
Percy by BrowserStack is a visual testing and review platform that integrates with your CI/CD pipeline. It captures screenshots of web pages and components, compares them against the baseline, and highlights visual changes. Percy offers a more comprehensive CI/CD integration compared to Chromatic, which is more tightly coupled with Storybook.
BackstopJS automates visual regression testing of web applications by comparing DOM screenshots over time. It is a standalone tool that can be used without Storybook, providing a different approach to visual testing compared to Chromatic's dependency on Storybook for component management.
Publishes your Storybook to Chromatic and kicks off tests if they're enabled.
👉 Read the Chromatic CLI docs
📝 View the Changelog
next
versionFrom time to time we pre-publish a next
version of the package to test new features. To use the
next branch you can either:
npx
Change your script to use the next
dist-tag:
npx chromatic@next --project-token ...
package.json
Update to the latest next
version with:
yarn add --dev chromatic@next
# or
npm i --save-dev chromatic@next
Use our chromatic-next
action:
- uses: chromaui/action-next@v1
Contributions of any kind are welcome! We're available to chat via the Intercom widget on the documentation site.
Compatibility is guaranteed between this package and Chromatic like so:
To facilitate upgrading in the future, removing and adding features, this is the process:
Before publishing, make sure you've done the following:
We have three types of releases:
canary
releases are intended for testing purposes and should not be used in production, as they may only work against a staging or dev environment.next
releases should be valid, working releases that can potentially be used by early adopters of new features, for example to handle a support request.latest
releases are the general audience production releases, used by most people.For GitHub Actions, we publish
chromaui/action-canary
andchromaui/action-next
, which contain the latestcanary
ornext
release, respectively. Alatest
release will also automatically updatechromaui/action-next
(besideschromaui/action
), in order to keep users who happen to depend onchromaui/action-next
up to date with thelatest
release.
A script is provided to create new releases:
yarn release <major|minor|patch> <canary|next|latest> [--dry-run]
This script ensures the version is bumped properly, the tag is set correctly and the corresponding GitHub Action is updated.
yarn release patch canary
Releases e.g. 6.6.1-canary.0
.
yarn release major latest
Releases e.g. 7.0.0
.
6.8.0 - 2022-08-26
--only
to --only-story-names
but keep it as a deprecated alias--preserve-missing
and raise a warning if it's being usedpreserveMissing
In order to support advanced use cases where only a subset of stories would be included in a Storybook, the --preserve-missing
flag could be used to prevent excluded stories from being marked as "removed" in Chromatic. This behavior could lead to problematic situations regarding infrastructure upgrades and cause truly removed stories to never be removed from Chromatic. That's why we are sunsetting the "preserve missing" behavior. As of v6.8.0, using this flag will raise a warning message in the CLI. In a future major version, the flag will be removed completely, and continuing to use it with an older CLI version will start to fail your build.
To upgrade, you should remove the --preserve-missing
flag from your CI and/or package.json
scripts. If you use our GitHub Action, you should remove the preserveMissing
input (with: ...
) from your workflow config file. Furthermore, you should make sure that your build-storybook
script builds all stories, not just a subset. Check your stories
configuration in .storybook/main.js
so it doesn't omit any stories (e.g. based on an environment variable).
Most likely you were using preserveMissing
to cut down on the number of snapshots taken by Chromatic. To achieve the same goal, you have three options:
--only-story-names
to only snapshot stories matching a glob pattern by component/story name.--only-story-files
to only snapshot stories matching a glob pattern by story filename.In each of these cases, any stories that aren't captured are "inherited" from their baseline.
FAQs
Automate visual testing across browsers. Gather UI feedback. Versioned documentation.
The npm package chromatic receives a total of 2,184,264 weekly downloads. As such, chromatic popularity was classified as popular.
We found that chromatic demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 0 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Create React App is officially deprecated due to React 19 issues and lack of maintenance—developers should switch to Vite or other modern alternatives.
Security News
Oracle seeks to dismiss fraud claims in the JavaScript trademark dispute, delaying the case and avoiding questions about its right to the name.
Security News
The Linux Foundation is warning open source developers that compliance with global sanctions is mandatory, highlighting legal risks and restrictions on contributions.