Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Related issue (if exists)
#3158
Summary
Adds the afterCompile hook needed for ProgressPlugin.
🤖 Generated by Copilot at 13aa843
This pull request adds a new hook
afterCompile
to the compiler and the plugin system. The hook allows plugins to run custom code after the compilation is done and before the output is emitted. The pull request modifies several files in thecrates
andpackages
directories to implement and support this new hook.Walkthrough
🤖 Generated by Copilot at 13aa843
afterCompile
to the plugin system that allows plugins to perform custom logic after the compilation is done and before the output is emitted (link, link, link, link, link, link, link, link, link, link, link, link, link, link, link, link)Hook::AfterCompile
incrates/node_binding/src/hook.rs
and handle its conversion from a string (link, link)after_compile
to theHooks
struct incrates/node_binding/src/js_values/hooks.rs
that holds the JavaScript function for the hook (link)after_compile_tsfn
to thePlugin
struct incrates/node_binding/src/plugins/mod.rs
that wraps the JavaScript function in aThreadsafeFunction
(link)after_compile
to thePlugin
struct incrates/node_binding/src/plugins/mod.rs
that calls theafter_compile_tsfn
with the currentCompilation
object (link)after_compile
method from thePlugin
struct incrates/node_binding/src/plugins/mod.rs
and create aThreadsafeFunction
from theafter_compile
JavaScript function in theinit
andnew
methods (link, link, link)after_compile
method of theplugin_driver
in thecompile
method of theCompiler
struct incrates/rspack_core/src/compiler/mod.rs
(link)after_compile
method to thePlugin
trait incrates/rspack_core/src/plugin/api.rs
(link)after_compile
to thePluginDriver
struct incrates/rspack_core/src/plugin/plugin_driver.rs
that iterates over the plugins and calls theirafter_compile
methods (link)afterCompile
to theCompiler
class inpackages/rspack/src/compiler.ts
that is an instance of thetapable.AsyncSeriesHook
class (link)afterCompile
property of theCompiler
class inpackages/rspack/src/compiler.ts
and pass it to the RustCompiler
struct in thecreateCompiler
function (link, link)afterCompile
property from thegetHooks
method of theCompiler
class inpackages/rspack/src/compiler.ts
and add a private method#afterCompile
that invokes the hook and updates the list of disabled hooks (link, link)