Repository navigation
v10.2.0 #339
sanelli
announced in
Announcements
v10.2.0
#339
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Mappa 10.2.0 expands mapping control with reference handling and compile-time cycle breaking,
IQueryableprojection, nested property paths, dependency-injection registrars, inaccessible-member mapping, object factories, before/after hooks, and richer enum / settings options. Benchmarks, coverage tooling, and generator performance also improve.Full changelog: v10.1.0...v10.2.0
Breaking changes
When upgrading from 10.1.0, see the upgrade guide.
Relaxed nullability matching for existing map methods
#nullable enable, nested mappings may now invoke an existing map method on the mapper, a dependency, or a matching polymorphic method when the underlying types match even if nullability annotations differ.TTarget?→ may invoke a method returningTTarget; nested needsTSource→ may invoke a method acceptingTSource?.Reference handling
ReferenceReusing), limit runtime nesting (MaxRuntimeDepth), and guard generator discovery (MaxCompileTimeDepth+ compile-time mapping-cycle detection). Not supported onIQueryableprojection.TTargetreference reuse and codegen polish (#320, #321, #322, #333) — Key reuse by source identity andtypeof(TTarget), omit redundantAddReferencePaircalls, and cache the reference-manager local.BreakCompileTimeCycles(#306, #311) — Optionally break compile-time mapping cycles by synthesizing private map methods; emits MP00078 when a cycle is auto-broken.New features
IQueryableprojection (ProjectTo-style) (#245, #284) — Map methods withIQueryable<TSource>→IQueryable<TTarget>emit provider-translatableSelectprojections. Not compatible with Native AOT ([RequiresDynamicCode])."Address.City"onMappaUseProperty, invoke, constant, context, and ignore attributes for flattening/unflattening.MappaObjectFactory(#253, #291) — Construct target types via named factory methods instead ofnew.MappaBeforeMap/MappaAfterMap(#250, #281) — Invoke named hooks immediately before and after the generated root mapping body.MappaMustMapTargetProperty(#20, #298) — Require listed (or all) non-required target properties to be mapped on the empty-constructor path; otherwise MP00065.MappaAllowInaccessibleSourceMembers/MappaAllowInaccessibleTargetMembersto read/write private or protected members (and invoke inaccessible constructors) viaUnsafeAccessor.MappaTypeMapping<TTarget, TSource>andMappaTypeMappingDefault<TDefault>over non-generic forms.Dependency injection
MappaDependencyInjectionattribute (#299, #302) — GenerateIServiceCollectionregistration methods for[Mappa]mappers; static DI mappers are skipped with MP00073.InjectFromAssemblies(#301, #317) — Discover[Mappa]mappers across assemblies for DI registration; Bson and Protobuf DI packages migrate to generated registrars.MappaSettingsand mapping behaviourDictionaryAssignment(#34, #273) — Choose indexer orAddinsertion for dictionary-to-dictionary mapping.PreventEnumerableCount(#108, #285) — AvoidEnumerable.Countfor fixed-size targets when the source length is unknown.CompatibleMapMethod(#13, #296) — Opt-in reuse of existing map methods when the source is a base/interface type and the method returns a compatible derived type.MappaMapEnumMember,MappaMapEnumIgnore, andMappaMapEnumDefault.Projection polish
{MethodName}ElementfromIQueryableprojections (#303, #304) — Stop emitting unused local helpers in projection-generated code.Generator quality and performance
CancellationToken(#323, #325, #335) — Attribute-driven incremental discovery viaForAttributeWithMetadataName, and cooperative cancellation on hot paths.MappaContextdocumentation corrections.Benchmarks and CI tooling
Test infrastructure
HasNextSyntaxNodewalks and full validation afterHaveGeneratedSourceCode().HaveDiagnostics(n)orNotHaveDiagnostics()on generator test chains.Maintenance
10.2.0-alpha.*to stable10.2.0.All pull requests
DictionaryAssignmentMappaSettings for dictionary-to-dictionary mappingHasNextSyntaxNodeassertionsIQueryableprojection (ProjectTo)PreventEnumerableCountMappaSettings optionMappaMustMapTargetPropertyattributeMappaDependencyInjectionAttributeMethodNameElementfromIQueryableprojectionsHaveDiagnostics(count)on generator test diagnostic assertionsMAPPA-BENCHMARK-COMPARISON.svgwinner table and reorder README benchmarksInjectFromAssembliesfor cross-assembly DI mapper discoveryMappa.GeneratorMappaContextdocsTTargetkeys, omit redundant Add, cache manager localCancellationTokenMappa.Generatorbranch coverage and comparison chart annotationsThis discussion was created from the release v10.2.0.
All reactions