Conversation
📝 WalkthroughWalkthroughDev and prod webpack configs updated to ignore test files from loaders and add ignore-loader rules; PluginMenuResolver now restricts dynamic plugin-metadata imports with webpackInclude, uses optional chaining and spread-push merging, replaces sortMenu with sortParentMenu, and adds error handling for metadata loads. (≤50 words) Changes
Sequence Diagram(s)sequenceDiagram
autonumber
participant DevServer as Dev Server (webpack)
participant IgnoreLoader as Ignore Loader
participant TSLoader as TS/JS Loaders
participant ModuleGraph as Module Graph
rect rgb(213,245,227)
note over DevServer,ModuleGraph: Dev build ignores test files during module discovery
end
DevServer->>IgnoreLoader: scan srcDir/pluginsDir for files
IgnoreLoader-->>DevServer: filter out *.test.js / *.test.ts / *.test.tsx
DevServer->>TSLoader: process remaining .ts/.tsx/.js (node_modules & tests excluded)
TSLoader-->>ModuleGraph: emit modules
ModuleGraph-->>DevServer: bundle for dev
sequenceDiagram
autonumber
participant App as App
participant Importer as Dynamic Importer
participant PluginFile as plugin-metadata.js/ts
participant Merger as Menu/Route Aggregator
rect rgb(255,240,194)
note over Importer,PluginFile: Dynamic import restricted by webpackInclude
end
App->>Importer: request plugin metadata (async)
Importer->>PluginFile: import(/* webpackInclude: ... */ plugin-metadata)
PluginFile-->>Importer: metadata (default?.menus / default?.routes) or fail
alt success
Importer->>Merger: push(...menus) / push(...routes) then sortParentMenu
Merger-->>App: aggregated menus/routes
else failure
Importer-->>App: log warning, return empty arrays
Merger-->>App: continue with other plugins
end
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~25 minutes
Poem
Pre-merge checks and finishing touches✅ Passed checks (2 passed)
✨ Finishing touches
🧪 Generate unit tests (beta)
📜 Recent review detailsConfiguration used: CodeRabbit UI Review profile: ASSERTIVE Plan: Pro 📒 Files selected for processing (1)
🔇 Additional comments (2)
Comment |
There was a problem hiding this comment.
Actionable comments posted: 1
📜 Review details
Configuration used: CodeRabbit UI
Review profile: ASSERTIVE
Plan: Pro
📒 Files selected for processing (1)
admin-ui/config/webpack.config.client.dev.ts(2 hunks)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (2)
- GitHub Check: Analyze (javascript)
- GitHub Check: Analyze (python)
🔇 Additional comments (2)
admin-ui/config/webpack.config.client.dev.ts (2)
180-180: LGTM! Babel exclusion pattern correctly updated.The exclusion pattern now prevents babel-loader from processing
.test.tsand.test.tsxfiles, which addresses the module parse failure. This works in conjunction with the ignore-loader rules below to provide defense-in-depth.
192-203: The webpack ignore-loader fix is valid, but the root cause diagnosis is incorrect.The ignore-loader rules in the webpack config (lines 192-203) are a correct and defensive approach to prevent test files from being bundled. However, the review comment's assertion that "ScopeAddPage.test.tsx was being imported through plugins/PluginMenuResolver.js" is contradicted by the code:
- PluginMenuResolver.js uses dynamic imports to load
plugin-metadatafiles only- The auth-server plugin-metadata.js imports
ScopeAddPage(production file at./components/Scopes/ScopeAddPage), not the test file- No test files are actually imported anywhere in the production codebase
The webpack rules added in this PR are still beneficial as a defensive guard against accidental test file inclusion, but they're solving a different issue than what the review comment describes. The test file is not being imported through the plugin resolver as claimed.
Likely an incorrect or invalid review comment.
|



Description
Summary by CodeRabbit