Repository navigation
Patch Changes
-
6459120: Fix dependency resolution and component decorator defects:
- Concurrent
resolve()calls for the same or overlapping components no longer fail with a falseCircular dependency detectederror. - A boot-time circular dependency error now lists the full loop (for example
A -> B -> A) instead of naming only one component. - A
@Middlewareclass withouthandle()(or avalidator: trueclass without a validator method) now throws a descriptive error at definition time instead of exiting the process with code 0, so broken apps and test files fail CI. - A
resolveAll()called from a prototype's start hook or post-processor that would rebuild its own caller now throwsCircularDependencyErrorinstead of recursing until memory runs out. AresolveAll()inside a hook may therefore throw where it used to hang.
- Concurrent
-
6a215e1: Compile the package under
strictand fix what that surfaced:- A class-based
@Inject(Class)is looked up by the dependency's registered name at boot as well as at resolve time, so a dependency listed after its dependent boots.discoverInjectedFields(),discoverInjectedFieldsFromClass(),createWebTest()and the devtools dependency graph report the same name. @OnStart,@PostConstructand@OnStopaccept symbol-keyed methods and run them like string-named ones. A symbol-keyed@OnStopused to abortserver.stop()with aTypeError.@Inject(Class)and@Strategy(Class)of a class that is not a registered component fall back to the class name, as the container already does when it reads component names.AsenaWebSocketService.to()throwsWebSocket server is not attachedwhen no server is attached, and a static serve class that is not a component throwsStatic Serve service <name> not found.instead of resolving an undefined key.
Public type changes:
Container.getStartHooks()andContainer.getStopHooks()return(string | symbol)[](wasstring[]).Container.resolveAll()is inferred as returningnullin addition to the array; strict callers must handle it.DEFAULT_PARAMSis typed withmiddlewares,summaryanddescriptionrequired;generateHandlerParams()returnsOmit<ApiParams, 'method'>, and fields passed asundefinednow fall back to their defaults.defineComponent(params?),IocEngine.setConfig(config?: IocConfig | null)andreadJson(path: string)(wasany).prepare()ofPrepareConfigService,PrepareStaticServeConfigService,PrepareValidatorServiceandPrepareWebsocketServicemay resolve toundefined;PrepareStaticServeConfigService.prepare()acceptsundefined.- Type declarations now state what the runtime already returns:
staticServeandvalidatoron route params are optional,BaseStaticServeParamsfields are optional,InjectableComponent.interfacemay beundefined,AsenaSocket.binaryTypemay beundefined, andAsenaWebSocketService.servermay benullbefore it is attached.
- A class-based