fix: plugin loading order#661
Conversation
… to respect the configured order at execution
WalkthroughThe code refactors the loading logic for both health checks and middleware by introducing new private methods to handle module imports and extraction of default exports. Batch loading functions now collect all modules first, then add them in order, ensuring the configured sequence is maintained. Changes
Sequence Diagram(s)sequenceDiagram
participant Config as Configuration
participant Manager as MiddlewareManager
participant Module as Middleware Module
Config->>Manager: get middleware filenames
loop for each filename (in order)
Manager->>Module: import module
Module-->>Manager: default export (Middleware)
Manager->>Manager: collect Middleware instance
end
loop for each Middleware (in order)
Manager->>Manager: addMiddleware(Middleware)
end
Assessment against linked issues
Poem
Warning There were issues while running some tools. Please review the errors and either fix the tool's configuration or disable the tool if it's a critical failure. 🔧 ESLint
npm error Exit handler never called! 📜 Recent review detailsConfiguration used: CodeRabbit UI 📒 Files selected for processing (2)
🧰 Additional context used🧬 Code Graph Analysis (1)packages/health/src/HealthManager.ts (1)
🔇 Additional comments (6)
✨ Finishing Touches
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
SupportNeed help? Create a ticket on our support page for assistance with any issues or questions. Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
CodeRabbit Configuration File (
|
|



Fixes #660
Changes proposed in this pull request:
@MaskingTechnology/jitar
Summary by CodeRabbit