Release Date: 2024-12-13
Type: Patch Release (Experimental Alpha)
The main improvement in this release is simplified installation:
Before (v0.1.0-alpha):
<PackageReference Include="AnAspect.OneOf" Version="0.1.0-alpha" />
<PackageReference Include="AnAspect.OneOf.SourceGenerator" Version="0.1.0-alpha" />
<PackageReference Include="AnAspect.OneOf.Attributes" Version="0.1.0-alpha" />Now (v0.1.1-alpha):
<PackageReference Include="AnAspect.OneOf" Version="0.1.1-alpha" />
<!-- Other packages auto-installed as dependencies! -->- 🔒 Hidden dependency packages - Only main package visible in NuGet search
- 📦 Automatic dependency resolution - SourceGenerator and Attributes install automatically
- 📝 Updated documentation - Clearer installation instructions
- ✨ Better package descriptions - Users know which package to install
Simple - Just install the main package:
<ItemGroup>
<PackageReference Include="Fody" Version="6.8.0" PrivateAssets="all" />
<PackageReference Include="AnAspect.OneOf" Version="0.1.1-alpha" />
</ItemGroup>Add FodyWeavers.xml:
<?xml version="1.0" encoding="utf-8"?>
<Weavers>
</Weavers>That's it! The source generator and attributes are included automatically.
This is still an experimental alpha release. See EXPERIMENTAL-WARNING.md for important limitations.
- ✅ OneOf<T1, T2> with From/Is/As patterns
- ✅ 30-57% memory reduction
- ✅ IL weaving via Fody
- ✅ Full type safety at compile time
- Only OneOf<T1, T2> supported (no T3, T4, etc.)
- TryGet methods not optimized
- Only local variables optimized (not fields/parameters)
Same performance as v0.1.0-alpha:
- 30.9% memory reduction for reference types
- 57.1% memory reduction for value types
- Zero-cost type checking (direct
isoperator)
If you're using v0.1.0-alpha:
-
Update version in your
.csproj:<PackageReference Include="AnAspect.OneOf" Version="0.1.1-alpha" />
-
Remove explicit references to SourceGenerator and Attributes:
<!-- Remove these - they're auto-included now --> <!-- <PackageReference Include="AnAspect.OneOf.SourceGenerator" Version="0.1.0-alpha" /> --> <!-- <PackageReference Include="AnAspect.OneOf.Attributes" Version="0.1.0-alpha" /> -->
-
Restore packages:
dotnet restore
No code changes required - this is a packaging improvement only.
This is an experimental project. Your feedback is valuable!
- Report bugs: https://github.com/Pouria7/AnAspect.OneOf/issues
- Suggest features: https://github.com/Pouria7/AnAspect.OneOf/issues
License: MIT
Author: Pouria7