-
Notifications
You must be signed in to change notification settings - Fork 9.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
refactor(core): Replace typedi with our custom DI system (no-changelog) #12389
base: master
Are you sure you want to change the base?
Conversation
Codecov ReportAttention: Patch coverage is 📢 Thoughts on this report? Let us know! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🎉
/** Clears all instantiated instances from the container while preserving type registrations */ | ||
reset(): void { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Would it be more accurate to rename as clearInstanceCache
? factory
remains.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think the jsdoc should describe the details. The name reset
is fine IMO.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
while preserving type registrations
→ I'm not clear on what's a type registration. If it means the factory
let's use that?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
More ideas to test if you like
- Circular dependencies
- Ensure
get
afterreset
creates a new instance - Resolution stack gets cleared after an error
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I did add tests for circular dependencies, but had to remove them because circular dependency between 2 classes in the same file causes one of them to be undefined
, leading to compile-time, and runtime unhandled error.
in part 2, I'll add more tests after I add the testing related stuff.
n8n Run #8570
Run Properties:
|
Project |
n8n
|
Branch Review |
n8n-di
|
Run status |
Passed #8570
|
Run duration | 04m 49s |
Commit |
2393a43772: 🌳 🖥️ browsers:node18.12.0-chrome107 🤖 netroy 🗃️ e2e/*
|
Committer | Iván Ovejero |
View all properties for this run ↗︎ |
Test results | |
---|---|
Failures |
0
|
Flaky |
1
|
Pending |
0
|
Skipped |
0
|
Passing |
484
|
View all changes introduced in this branch ↗︎ |
✅ All Cypress E2E specs passed |
Summary
This PR replaces
typedi
with a DI system that we can maintain and have full control over.Review / Merge checklist
release/backport
(if the PR is an urgent fix that needs to be backported)