mirror of
https://github.com/Abdulazizzn/n8n-enterprise-unlocked.git
synced 2025-12-16 09:36:44 +00:00
refactor(core): Use an IoC container to manage singleton classes [Part-1] (no-changelog) (#5509)
* add typedi * convert ActiveWorkflowRunner into an injectable service * convert ExternalHooks into an injectable service * convert InternalHooks into an injectable service * convert LoadNodesAndCredentials into an injectable service * convert NodeTypes and CredentialTypes into an injectable service * convert ActiveExecutions into an injectable service * convert WaitTracker into an injectable service * convert Push into an injectable service * convert ActiveWebhooks and TestWebhooks into an injectable services * handle circular references, and log errors when a circular dependency is found
This commit is contained in:
committed by
GitHub
parent
aca94bb995
commit
52f740b9e8
12
patches/typedi@0.10.0.patch
Normal file
12
patches/typedi@0.10.0.patch
Normal file
@@ -0,0 +1,12 @@
|
||||
diff --git a/cjs/container-instance.class.js b/cjs/container-instance.class.js
|
||||
index e473b1e652aa0b6e7462f7ba93fcef2812483b20..1e2ac7e5cb7943f5226a2bc25fa83bee0470f90c 100644
|
||||
--- a/cjs/container-instance.class.js
|
||||
+++ b/cjs/container-instance.class.js
|
||||
@@ -234,6 +234,7 @@ class ContainerInstance {
|
||||
*/
|
||||
initializeParams(target, paramTypes) {
|
||||
return paramTypes.map((paramType, index) => {
|
||||
+ if (paramType === undefined) throw new ReferenceError('Cannot inject an `undefined` dependency. Possibly a circular dependency detected');
|
||||
const paramHandler = container_class_1.Container.handlers.find(handler => {
|
||||
/**
|
||||
* @Inject()-ed values are stored as parameter handlers and they reference their target
|
||||
Reference in New Issue
Block a user