Repository navigation
Freeze the runtime and Extensions API shape before 1.0 - #381
Merged
Merged
Conversation
Breaking changes to the public API of Stunts and Stunts.Extensions, made now because none is possible after 1.0. - Rename the MethodInvoker delegate to InvokeHandler (it is ambiguous with System.Reflection.MethodInvoker), DefaultValueProvider.Deregister to Unregister, and ProceedExtension to ProceedExtensions. - IMethodInvocation.SkipBehaviors is ISet<Type>. - StuntFactory is a static class with UseAmbient, like BehaviorPipelineFactory; LocalDefault is gone. The Default setters and UseAmbient reject null. - Seal the classes and records that are not bases: MethodInvocation, ArgumentCollection, BehaviorPipeline, the built-in behaviors, Ref<T>, PointerRef, MethodReturn, Argument<T> and ObjectArgument. Ref is abstract. - Throw ArgumentOutOfRangeException from the index members of ArgumentCollection, InvalidOperationException from Proceed and StructRef, and TargetParameterCountException for every argument count mismatch. Setting an unknown argument name throws KeyNotFoundException instead of storing a hidden entry. - DefaultValueBehavior.Execute is public, and its provider cannot be null. - Enable nullable warnings on net8.0 and fix the annotations it hid. - StructRef<T>, SpanRef<T> and ReadOnlySpanRef<T> are types of a new net9.0 build of Stunts.dll instead of source generated into every consumer. SignatureRefGenerator is removed. - ObservabilityBehavior records the duration in seconds, tags stunts.type, stunts.member and error.type, and names activity arguments stunts.argument.<name>. Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com> Co-authored-by: CodeAlta <noreply@codealta.io>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Third step of the pre-1.0 API freeze: the breaking changes to the public API of
StuntsandStunts.Extensionsthat are only possible before 1.0.Breaking changes
delegate MethodInvokerdelegate InvokeHandler(it was ambiguous withSystem.Reflection.MethodInvoker)DefaultValueProvider.Deregister(Type)/Deregister<T>()Unregister(Type)/Unregister<T>()static class ProceedExtensionProceedExtensionsHashSet<Type> IMethodInvocation.SkipBehaviorsISet<Type>class StuntFactory : IStuntFactorystatic class StuntFactoryStuntFactory.LocalDefault { get; set; }StuntFactory.UseAmbient(IStuntFactory), returningIDisposable, likeBehaviorPipelineFactory.UseAmbientDefaultsetters andUseAmbientaccepted nullArgumentNullExceptionMethodInvocation,ArgumentCollection,BehaviorPipeline,DefaultEqualityBehavior,DefaultValueBehavior,TargetBehavior,RecordingBehavior,RecordedInvocation,NotifyPropertyChangeBehavior,Ref<T>,PointerRef, recordsMethodReturn,Argument<T>,ObjectArgumentinitsetters)class Refwith a public constructorabstract class RefArgumentCollectionindex members threwIndexOutOfRangeExceptionArgumentOutOfRangeExceptionarguments["unknown"] = xstored a hidden entryKeyNotFoundExceptionProceedwith a null awaitable threwNullReferenceExceptionInvalidOperationExceptionStructRefafter invalidation threwAccessViolationExceptionInvalidOperationExceptionMethodReturnargument count mismatch threwArgumentExceptionTargetParameterCountException, as everywhere elseDefaultValueBehaviorimplementedExecuteexplicitlyExecute; its provider cannot be nullStructRef<T>,SpanRef<T>,ReadOnlySpanRef<T>generated as public source into every consumer on .NET 9 or laternet9.0build ofStunts.dll.SignatureRefGeneratoris removedObservabilityBehavior: histogram inms, tagsstunt.type,member.name,status, activity tagsarg.<name>s), tagsstunts.type,stunts.member, anderror.typeon failure; activity tagsstunts.argument.<name>Not sealed, on purpose:
CompiledStuntFactory,DefaultValueProvider,StructRef,StuntGeneratorAttribute.Also
Equals(object?),Argument.Namereturns an empty string for an unnamed parameter).allows ref structdoes not compile fornetstandard2.0ornet8.0(CS9240), so the holders need thenet9.0target.ST023now asks whether the compilation seesStunts.StructRef<T>.ObservabilityBehaviorand its logging of argument values are unchanged.Verified locally: build, 469 of 469 tests, format checks, the package (
lib/netstandard2.0,lib/net8.0,lib/net9.0), the acceptance solution (13 tests in 7 projects), the Native AOT binary for net8.0 and net10.0, samples, and a consumer withSpan<T>,ReadOnlySpan<T>and a custom ref struct on net10.0 and net9.0 (ST023on net8.0). Not run locally:framework-compiler.ps1and the site build.This pull request was created by CodeAlta.
🤖 Generated with Claude Code