feat: Migrate to Webpack Built-in Infrastructure Logger with Backward… - #738
feat: Migrate to Webpack Built-in Infrastructure Logger with Backward…#738ronakmaheshwari wants to merge 3 commits into
Conversation
🦋 Changeset detectedLatest commit: 242e5dd The changes in this PR will be included in the next version bump. This PR includes changesets to release 1 package
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
|
|
|
Thanks! Could you follow the pull request template? |
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #738 +/- ##
==========================================
+ Coverage 85.35% 86.54% +1.18%
==========================================
Files 17 17
Lines 1065 1159 +94
Branches 387 415 +28
==========================================
+ Hits 909 1003 +94
Misses 142 142
Partials 14 14 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
|
Will do it today it self |
| }); | ||
| }); | ||
|
|
||
| describe("parity methods", () => { |
There was a problem hiding this comment.
Is there some type-level protection that makes sure the parity methods are kept in sync with what webpack has? I'm a bit worried about adding so many new methods in here and I wonder if there would be an alternative solution that wouldn't require us to match all the other webpack logger methods.
There was a problem hiding this comment.
Yes in my latest commit ii have added a simplified approach. I have replaced the boilerplate with a proxy which will automatically delegates all Webpack logger methods directly to the underlying logger.
|
Also check the coverage report, some methods seem to bail out and not be tested |
alexander-akait
left a comment
There was a problem hiding this comment.
I like this improvement
|
Hii @valscion I have made the changes Can you review it please |
This pull request updates the logging system of the
webpack-bundle-analyzerplugin to integrate with Webpack's native infrastructure logger when available. It introduces a new adapter for compatibility, deprecates the plugin'slogLeveloption in favor of Webpack'sinfrastructureLogging, and updates documentation and type annotations accordingly.Logging integration and deprecation:
compiler.getInfrastructureLogger('webpack-bundle-analyzer')when available, providing better integration with Webpack's logging system.logLeveloption is deprecated in favor of Webpack'sinfrastructureLogging.level, with documentation and type comments updated to reflect this change. A deprecation warning is shown iflogLevelis used. [1] [2] [3] [4] [5]Logger implementation and type updates:
InfrastructureLoggerAdapterinLogger.jsto bridge between the plugin's logger interface and Webpack's infrastructure logger, supporting log level filtering and deprecation warnings. [1] [2] [3]src/analyzer.js,src/utils.js,src/viewer.js) to accept either the customLoggeror Webpack's infrastructure logger for improved type safety and compatibility. [1] [2] [3] [4] [5] [6] [7]These changes ensure that logging is consistent with Webpack's ecosystem and prepare for the eventual removal of the plugin's custom
logLeveloption compatibility#358
@valscion if you can review it