Adds IContentCrudService registration to UmbracoBuilder alongside IContentService. Both services are now resolvable from DI. Includes integration test verifying successful resolution. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
3.6 KiB
3.6 KiB
date, researcher, git_commit, branch, repository, topic, tags, status, last_updated, last_updated_by, type
| date | researcher | git_commit | branch | repository | topic | tags | status | last_updated | last_updated_by | type | |||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 2025-12-13T04:47:12+00:00 | Claude | 45edc5916b |
refactor/Utf8ToAsciiConverter | Umbraco-CMS | Utf8ToAsciiConverter Refactoring Analysis |
|
complete | 2025-12-13 | Claude | analysis |
Handoff: Utf8ToAsciiConverter Refactoring Analysis
Task(s)
Completed:
- Cyclomatic complexity comparison between original and refactored implementation
- Test count comparison before and after refactoring
Critical References
src/Umbraco.Core/Strings/Utf8ToAsciiConverter.cs- New SIMD-optimized implementationsrc/Umbraco.Core/Strings/Utf8ToAsciiConverterOriginal.cs- Original implementation (disabled with#if false)tests/Umbraco.Tests.UnitTests/Umbraco.Core/Strings/TestData/golden-mappings.json- 1,308 character mappings for regression testing
Recent changes
No code changes made in this session - analysis only.
Learnings
Cyclomatic Complexity Reduction
- Original: ~287 total complexity (dominated by ~280 in single switch statement with 276 case groups)
- New: 25 total complexity (distributed across 4 focused methods)
- Reduction: 91% overall, 97% for maximum method complexity
Architectural Changes
- Switch Statement → Dictionary Lookup: 3,400-line switch replaced by
FrozenDictionary<char, string>loaded from JSON - Unicode Normalization: ~180 case groups eliminated by using
NormalizationForm.FormDfor accented Latin characters - SIMD Fast Path: Uses
SearchValues<char>for vectorized ASCII detection - Separation of Concerns: Logic split into
Convert(),ProcessNonAscii(),TryNormalize()
Test Coverage Added
- Before: 0 dedicated tests existed
- After: 2,649 test cases across 4 test files
- Golden file testing validates all 1,308 character mappings from original implementation
Artifacts
Analysis results documented in conversation - no files created.
Key files analyzed:
src/Umbraco.Core/Strings/Utf8ToAsciiConverter.cs:1-209- New implementation (~210 LOC)src/Umbraco.Core/Strings/Utf8ToAsciiConverterOriginal.cs:1-3633- Original implementation (~3,600 LOC)tests/Umbraco.Tests.UnitTests/Umbraco.Core/Strings/Utf8ToAsciiConverterTests.cs- 30 test casestests/Umbraco.Tests.UnitTests/Umbraco.Core/Strings/Utf8ToAsciiConverterGoldenTests.cs- 2,616 test casestests/Umbraco.Tests.UnitTests/Umbraco.Core/Strings/Utf8ToAsciiConverterInterfaceTests.cs- 2 teststests/Umbraco.Tests.UnitTests/Umbraco.Core/Strings/Utf8ToAsciiConverterNormalizationCoverageTests.cs- 1 analysis test
Action Items & Next Steps
The refactoring analysis is complete. Potential follow-up:
- Review benchmark results in
docs/benchmarks/utf8-converter-final-2025-11-27.md - Consider merging branch to main if all tests pass
- Document normalization coverage findings from
Utf8ToAsciiConverterNormalizationCoverageTests
Other Notes
Key Metrics Summary
| Metric | Before | After | Change |
|---|---|---|---|
| Cyclomatic Complexity | ~287 | 25 | -91% |
| Lines of Code | ~3,600 | ~210 | -94% |
| Switch Cases | 276 | 0 | -100% |
| Test Cases | 0 | 2,649 | +2,649 |
Branch Status
The branch refactor/Utf8ToAsciiConverter contains 16 commits implementing the SIMD-optimized converter with:
- Interface abstraction (
IUtf8ToAsciiConverter) - DI integration via
ICharacterMappingLoader - Static wrapper for backwards compatibility (
Utf8ToAsciiConverterStatic) - Comprehensive test suite with golden file validation