Introducing DiffShot: Instantly Visualize Your Git Changes with Zero Setup
Developers often face the challenge of ensuring UI changes are correctly reflected across different devices and viewports. Manual testing and writing extensive end-to-end tests can be time-consuming and cumbersome. To streamline this process, we’ve created DiffShot, a powerful tool that automatically captures visual snapshots of your UI modificationsโwithout any configuration needed.
What is DiffShot?
DiffShot is a command-line tool designed to analyze your code changes, identify the impacted UI components, and generate visual comparisons by taking screenshots across various device viewports. The best part? It requires no test scripts, configuration files, or manual setupโsimply run it after coding, and it takes care of the rest.
How Does It Work?
Using DiffShot is straightforward. After making your code modifications, execute:
bash
diffshot --compare main
The tool then proceeds to:
- Detect affected components: Analyzes your code to identify which parts of your UI have changed.
- Start your development environment: Launches your local server automatically.
- Capture screenshots: Automates viewport-specific screenshots of the altered components.
- Organize outputs: Saves all images in
.diffshot/screenshots/
. - Generate summaries: Creates a Markdown snippet suitable for inclusion in pull request comments.
Why Choose DiffShot?
- Minimal setup: Just point it at your projectโno configuration required.
- No extensive testing needed: Eliminates the need to write and maintain end-to-end tests for visual validation.
- Smart detection: Automatically recognizes your development server commands.
- Built-in authentication handling: Handles login flows and session management seamlessly.
- Framework agnostic: Compatible with React, Vue, Laravel, and any other framework.
Practical Applications
- Conduct quick visual reviews before committing code.
- Share visual snapshots directly within code review comments.
- Confirm responsive and theme-specific UI updates effortlessly.
Technical Details
Built with TypeScript and powered by Playwright, DiffShot integrates smoothly into your development workflow. It leverages git for change detection and is designed to be flexible across different project setups.
Looking Ahead
Weโre excited to open-source DiffShot in the coming weeks and are currently seeking a small group of early adopters. If youโre interested in testing this tool, helping us identify edge cases, and shaping its future, leave a comment below or reach out directly.
If youโve ever