You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
We have just released Metalama 2024.2.2-preview, which contains all changes from 2024.2.1-preview and 2024.1.14 plus the following:
Improved
Reference validator granularity
The reference validator feature has now a concept of validator granularity, which can be set to Compilation, Type, Member, or Declaration. The idea is the validator is invariant within its level of granularity. For instance, if a validator granularity is set to Namespace, then all references within that namespace will be either all valid or all invalid.
The validator granularity concept is essential to improve the performance validators, as references can be validated collectively instead of one by one.
Code written against the previous API will get obsolescence warnings. We suggest porting your validators to the new API and choosing the coarsest possible granularity.
Other improvements
Fabrics: The right side of query operators like IAspectReceiver.SelectMany() now execute concurrently.
Fabrics: When a part of a query is used several times (typically by storing the query in a local variable), its result is cached.
New method IAspectReceiver.Tag: Adds an arbitrary tag that is carried on and available for all lambdas on the right side of the Tag method for new overloads of almost all IAspectReceiver methods.
New method IAspectReceiver.SelectTypes: Gets all types in the current context (typically namespace, compilation, or current type).
New method IAspectReceiver.SelectTypesDerivedFrom: Gets all types in the current context derived from a given type.
New extension method IAspectReceiver<ICompilation>.SelectReferencedAssembly: Gets a referenced assembly.
New extension method IAspectReceiver<ICompilation>.SelectType: Gets a type given by System.Type.
The new class Metalama.Extensions.Architecture.Predicates.ReferenceEndPredicate serves as a base for predicates that depend on a single end of the reference to validate. This is a preparation for some next feature, allowing the validation of inbound references instead of just outbound references.
Changed
The IAmender.Outbound property is now redundant and has been marked as [Obsolete]. The IAmender interface now exposes IAspectReceiver interface, which was previously exposed by the Outbound property. The Outbound property is still required for IAspectBuilder.
Breaking Changes
The Metalama.Extensions.Architecture.Predicates.ReferencePredicate class has a new abstract member Granularity. Its constructor now requires a ReferencePredicateBuilder.
ReferenceValidationContext no longer reports several ReferenceKinds, but only the deepest one. For instance, in class A : List<C>;, the reference to C is of kind GenericArgument and no longer BaseType | GenericArgument. Combined flags added complexity and we did not see a use case for them.
Projects that were using transitive reference validators (or architecture constraints), if they were built with a previous version of Metalama, must be rebuilt.
Fixed
Dependency injection introduction generates a warning about non-nullable fields.
Design-time: Solution analysis doesn't resume after the build in VS Code.
Perf: A fabric that applies aspects to many declarations causes a long single-threaded interval.
Perf: Caching of license key data.
Architecture: cannot verify namespaces in bulk.
Design-time: record struct is generated with incorrect SyntaxKind.
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
We have just released Metalama 2024.2.2-preview, which contains all changes from 2024.2.1-preview and 2024.1.14 plus the following:
Improved
Reference validator granularity
The reference validator feature has now a concept of validator granularity, which can be set to Compilation, Type, Member, or Declaration. The idea is the validator is invariant within its level of granularity. For instance, if a validator granularity is set to Namespace, then all references within that namespace will be either all valid or all invalid.
The validator granularity concept is essential to improve the performance validators, as references can be validated collectively instead of one by one.
Code written against the previous API will get obsolescence warnings. We suggest porting your validators to the new API and choosing the coarsest possible granularity.
Other improvements
IAspectReceiver.SelectMany()
now execute concurrently.IAspectReceiver.Tag
: Adds an arbitrary tag that is carried on and available for all lambdas on the right side of theTag
method for new overloads of almost allIAspectReceiver
methods.IAspectReceiver.SelectTypes
: Gets all types in the current context (typically namespace, compilation, or current type).IAspectReceiver.SelectTypesDerivedFrom
: Gets all types in the current context derived from a given type.IAspectReceiver<ICompilation>.SelectReferencedAssembly
: Gets a referenced assembly.IAspectReceiver<ICompilation>.SelectType
: Gets a type given by System.Type.Metalama.Extensions.Architecture.Predicates.ReferenceEndPredicate
serves as a base for predicates that depend on a single end of the reference to validate. This is a preparation for some next feature, allowing the validation of inbound references instead of just outbound references.Changed
IAmender.Outbound
property is now redundant and has been marked as[Obsolete]
. TheIAmender
interface now exposesIAspectReceiver
interface, which was previously exposed by theOutbound
property. TheOutbound
property is still required forIAspectBuilder
.Breaking Changes
Metalama.Extensions.Architecture.Predicates.ReferencePredicate
class has a new abstract memberGranularity
. Its constructor now requires aReferencePredicateBuilder
.ReferenceValidationContext
no longer reports severalReferenceKinds
, but only the deepest one. For instance, inclass A : List<C>;
, the reference toC
is of kindGenericArgument
and no longerBaseType | GenericArgument
. Combined flags added complexity and we did not see a use case for them.Fixed
Beta Was this translation helpful? Give feedback.
All reactions