Skip to content
78 changes: 78 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,84 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
- Git integration (compare commits, branches)
- F# support via FSharp.Compiler.Service

## [0.8.0] - 2026-01-20

### Added

#### Impact Classification
- **Automatic Impact Classification** - Every change is categorized by its potential impact on consumers
- Breaking Public API - Changes that break external consumers (method signature changes, removed public members)
- Breaking Internal API - Changes that break internal consumers (internal method renames, parameter changes)
- Non-Breaking - Safe changes with no execution impact (private field renames, code reordering)
- Formatting Only - Pure whitespace/comment changes
- **Visibility Tracking** - Each change includes visibility information (public, internal, private, protected)
- **Caveat Warnings** - Warnings for edge cases (e.g., "parameter rename may break named arguments")
- **Impact Filtering** - Filter changes by impact level in JSON output

#### Whitespace Intelligence
- **4 Whitespace Modes** - Fine-grained whitespace handling
- Exact - Preserve all whitespace (default)
- IgnoreLeadingTrailing - Ignore leading/trailing whitespace
- IgnoreAll - Ignore all whitespace differences
- LanguageAware - Language-specific handling (exact for Python/YAML, normalized for C#/Java)
- **Automatic Issue Detection** - Detects indentation changes, mixed tabs/spaces, trailing whitespace, line ending changes
- **Whitespace Warnings** - Visual indicators in HTML output for whitespace issues
- **CLI Options** - `--whitespace-mode` and `-w` shortcut for `--whitespace-mode ignore-all`

#### Multi-Target Framework (Multi-TFM) Support
- **Target Framework Analysis** - Analyze code differences across multiple .NET target frameworks simultaneously
- **TFM-Specific Change Detection** - Identify which changes apply to specific target frameworks vs. all frameworks
- **Conditional Compilation Awareness** - Properly handles `#if` directives and framework-specific code
- **Per-TFM Semantic Analysis** - Runs full Roslyn analysis for each target framework with correct compilation symbols
- **Parallel TFM Processing** - Optimized multi-TFM analysis with parallel processing

#### CLI Enhancements
- `--impact-level` - Filter by impact: `breaking-public`, `breaking-internal`, `non-breaking`, `all`
- `--include-non-impactful` - Include non-breaking and formatting changes in JSON output
- `--include-formatting` - Include formatting-only changes
- `--whitespace-mode` - Whitespace handling mode
- `--target-framework` / `-t` - Specify one or more target frameworks for analysis (can be repeated)
- `-T` / `--target-frameworks` - Specify semicolon-separated list of target frameworks (e.g., "net8.0;net10.0")
- TFM validation with helpful error messages for invalid framework identifiers
- Support for common TFM formats: `net8.0`, `net10.0`, `netcoreapp3.1`, `netstandard2.0`, `net462`, etc.

#### Output Format Enhancements
- **Impact Indicators** - Color-coded impact badges in HTML, impact properties in JSON
- **Whitespace Warnings** - Visual indicators for whitespace issues in HTML output
- **TFM Annotations** - Target framework information in all output formats
- JSON: `targetFrameworks` array in metadata and `applicableToTfms` per change
- HTML: TFM badges and framework-specific indicators
- Text/Plain: TFM annotations like `[.NET 8.0]` for framework-specific changes

#### Architecture Improvements
- `ImpactClassifier` - Analyzes and classifies change impact
- `WhitespaceAnalyzer` - Detects whitespace issues
- `TfmSymbolResolver` - Maps TFMs to preprocessor symbols
- `TfmParser` - Validates and parses TFM strings
- `PreprocessorDirectiveDetector` - Pre-scan optimization for conditional compilation
- `TfmResultMerger` - Intelligent merging of per-TFM analysis results
- Enhanced `DiffResult` model with impact breakdown and TFM metadata
- Enhanced `Change` model with `Impact`, `Visibility`, `Caveats`, and `ApplicableToTfms` properties

#### Documentation
- **Impact Classification Guide** (`docs/impact-classification.md`) - Complete guide to impact levels, filtering, and use cases
- **Whitespace Handling Guide** (`docs/whitespace-handling.md`) - Whitespace modes and best practices
- **Multi-TFM Support Guide** (`docs/tfm-support.md`) - Multi-target framework analysis and conditional compilation
- Sample files demonstrating TFM scenarios and whitespace handling
- Updated API documentation with programmatic examples

### Changed
- Enhanced `DiffOptions` with `ImpactLevel`, `IncludeNonImpactful`, `IncludeFormatting`, `WhitespaceMode`, and `TargetFrameworks` properties
- Updated all output formatters to display impact, whitespace warnings, and TFM metadata
- JSON output defaults to showing only breaking changes (`IncludeNonImpactful: false`)
- HTML output defaults to showing all changes for review

### Performance
- Multi-TFM overhead is minimal (~2-2.5x for 3 frameworks vs. single framework)
- Pre-scan optimization skips multi-TFM analysis when no `#if` directives exist
- Parallel TFM processing where possible
- Efficient change correlation algorithms

## [0.5.0] - 2026-01-15

### Added
Expand Down
50 changes: 47 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,19 @@ Fine-grained whitespace handling with language-aware detection:

See [Whitespace Handling Guide](docs/whitespace-handling.md) for comprehensive details.

### Multi-Target Framework Analysis (v0.8.0) 🎯

Analyze code changes across multiple .NET target frameworks simultaneously:

- **Multi-TFM diff support**: Compare code compiled for different target frameworks (net8.0, net10.0, etc.)
- **Conditional compilation detection**: Identifies changes within `#if`, `#elif`, preprocessor blocks
- **Symbol resolution**: Automatically resolves TFM-specific symbols (NET8_0, NET10_0_OR_GREATER, etc.)
- **TFM-specific change tracking**: Each change indicates which frameworks it applies to
- **Performance optimized**: Pre-scan detects preprocessor directives, skips multi-TFM analysis when not needed
- **Parallel processing**: Analyzes multiple TFMs concurrently for faster results

See [Multi-TFM Support Guide](docs/tfm-support.md) for comprehensive details.

### Core Features

- **Semantic Diff** - Understands code structure, not just text changes
Expand Down Expand Up @@ -115,6 +128,25 @@ roslyn-diff diff old.cs new.cs --html report.html --open
roslyn-diff diff old.cs new.cs --git
```

### Multi-Target Framework Analysis

```bash
# Analyze for a single target framework
roslyn-diff diff old.cs new.cs -t net8.0

# Analyze multiple target frameworks (repeatable flag)
roslyn-diff diff old.cs new.cs -t net8.0 -t net10.0

# Analyze multiple TFMs (semicolon-separated)
roslyn-diff diff old.cs new.cs -T "net8.0;net10.0"

# Multi-TFM with JSON output
roslyn-diff diff old.cs new.cs -t net8.0 -t net10.0 --json

# Multi-TFM with HTML report
roslyn-diff diff old.cs new.cs -T "net8.0;net9.0;net10.0" --html report.html --open
```

### Compare Specific Classes

```bash
Expand Down Expand Up @@ -175,6 +207,12 @@ roslyn-diff diff <old-file> <new-file> [options]
| `--whitespace-mode <mode>` | | Whitespace handling: `exact`, `ignore-leading-trailing`, `ignore-all`, `language-aware` | `exact` |
| `--ignore-whitespace` | `-w` | Shortcut for `--whitespace-mode ignore-all` | `false` |

**Multi-TFM Options (v0.8.0):**
| Option | Short | Description | Default |
|--------|-------|-------------|---------|
| `--target-framework <tfm>` | `-t` | Target framework moniker (repeatable: `-t net8.0 -t net10.0`) | `null` (NET10_0 assumed) |
| `--target-frameworks <tfms>` | `-T` | Semicolon-separated TFMs (e.g., `"net8.0;net10.0"`) | `null` |

**Diff Mode Options:**
| Option | Short | Description | Default |
|--------|-------|-------------|---------|
Expand Down Expand Up @@ -249,8 +287,10 @@ roslyn-diff diff old.cs new.cs --json analysis.json
"version": "0.8.0",
"timestamp": "2026-01-19T22:45:12Z",
"mode": "roslyn",
"analyzedTfms": ["net8.0", "net10.0"],
"options": {
"includeNonImpactful": false
"includeNonImpactful": false,
"targetFrameworks": ["net8.0", "net10.0"]
}
},
"summary": {
Expand All @@ -272,6 +312,7 @@ roslyn-diff diff old.cs new.cs --json analysis.json
"name": "Process",
"impact": "breakingPublicApi",
"visibility": "public",
"applicableToTfms": ["net8.0", "net10.0"],
"caveats": ["Parameter rename may break callers using named arguments"]
}]
}]
Expand All @@ -284,6 +325,7 @@ See [Output Formats Guide](docs/output-formats.md) for complete schema documenta

Interactive HTML report with:
- **Impact classification badges** - Color-coded indicators (Breaking Public API, Breaking Internal API, Non-Breaking, Formatting Only)
- **TFM badges** - Framework-specific indicators (net8.0, net10.0) showing which TFMs each change applies to
- **Caveat warnings** - Yellow warning boxes for edge cases (e.g., "Parameter rename may break named arguments")
- **Whitespace issue indicators** - Warnings for indentation changes, mixed tabs/spaces, etc.
- Side-by-side diff view with syntax highlighting
Expand Down Expand Up @@ -313,13 +355,14 @@ roslyn-diff diff old.cs new.cs --text
```
Diff: old.cs -> new.cs
Mode: Roslyn (semantic)
Target Frameworks: net8.0, net10.0

Summary: +2 (2 total changes)

Changes:
File: new.cs
[+] Method: Multiply (line 5-8)
[+] Method: Divide (line 10-13)
[+] Method: Multiply (line 5-8) [net8.0, net10.0]
[+] Method: Divide (line 10-13) [net8.0, net10.0]
```

### Git Unified Diff (`--git`)
Expand Down Expand Up @@ -525,6 +568,7 @@ See the [Synaptic Canvas documentation](https://github.com/randlee/synaptic-canv

- **[Impact Classification Guide](docs/impact-classification.md)** - Complete guide to impact levels, filtering, caveats, and use cases (v0.7.0)
- **[Whitespace Handling Guide](docs/whitespace-handling.md)** - Whitespace modes, language-aware detection, and best practices (v0.8.0)
- **[Multi-TFM Support Guide](docs/tfm-support.md)** - Multi-target framework analysis, conditional compilation detection, and advanced scenarios (v0.8.0)
- [Output Formats](docs/output-formats.md) - Format specifications, JSON Schema v2, and feature comparison
- [Sample Outputs](samples/README.md) - Example diffs with impact classification

Expand Down
Loading