-
-
Notifications
You must be signed in to change notification settings - Fork 605
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
feat: add rsdoctor native plugin #8930
base: main
Are you sure you want to change the base?
Conversation
✅ Deploy Preview for rspack ready!
To edit notification comments on pull requests, go to your Netlify site configuration. |
CodSpeed Performance ReportMerging #8930 will not alter performanceComparing 🎉 Hooray!
|
28500f1
to
31b909c
Compare
fn stage(&self) -> i32 { | ||
self.stage | ||
} | ||
} |
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.
perhaps we can move definations of the plugin hooks to the plugin folder
9b7b783
to
c85ad4b
Compare
c85ad4b
to
2c83723
Compare
Summary
Relate to web-infra-dev/rsdoctor#689
This pull request introduces
rspack.experiments.RsdoctorPlugin
to improve build performance of the projects that use Rsdoctor.This plugin will collect datas from module graph and chunk graph according
features
in the plugin options, and then transfer them to js side by plugin hooks.The defination of plugin options is:
If the
features
is set totrue
, it will collect all the data. And if it is set tofalse
, it will not collect any data.If the
features
is set to an array, it will collect the data according to the array.graph
means that needs to get the basic graph data.other
means that needs to get other data based on the graph data. Ifgraph
is not in the array, it will panic.The data can be obtained by the following hooks:
This is a example of how to use the plugin and the hooks:
This pull request introduces the integration of the
rsdoctor
plugin into the project. The changes span across multiple files to add the necessary configurations and hooks for thersdoctor
plugin.Integration of
rsdoctor
Plugin:Configuration Changes:
Cargo.toml
: Addedrspack_plugin_rsdoctor
with version0.2.0
to the dependencies.crates/node_binding/Cargo.toml
: Addedrspack_plugin_rsdoctor
to the workspace.crates/rspack_binding_values/Cargo.toml
: Addedrspack_plugin_rsdoctor
to the workspace.Code Changes:
crates/node_binding/src/plugins/interceptor.rs
: Added imports and hooks forrsdoctor
plugin, includingRsdoctorAssetPatch
,RsdoctorChunkGraph
,RsdoctorModuleGraph
, and others. [1] [2] [3] [4] [5] [6] [7]crates/node_binding/src/plugins/mod.rs
: Integratedrsdoctor
plugin hooks into theJsHooksAdapterPlugin
and added the necessary hook implementations. [1] [2] [3] [4] [5] [6]crates/rspack_binding_values/src/lib.rs
: Addedrsdoctor
module and re-exported it. [1] [2]crates/rspack_binding_values/src/raw_options/raw_builtins/mod.rs
: AddedRsdoctorPlugin
to the list of built-in plugins and implemented its integration. [1] [2] [3] [4]Core Changes:
crates/rspack_core/src/chunk_graph/chunk_graph_module.rs
: Added a method to get module chunks.crates/rspack_core/src/chunk_group.rs
: Madechildren
field public.crates/rspack_core/src/compiler/compilation.rs
: Added a new hookCompilationAfterCodeGeneration
. [1] [2]Checklist