fix(cache): release compilation-scoped plugin state on rebuild#14788
Closed
matthewdavis-oai wants to merge 1 commit into
Closed
Conversation
Contributor
Author
|
Superseded by #14772, where the validated changes are now stacked for a single review surface. |
Contributor
Merging this PR will not alter performance
Comparing Footnotes
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Summary
Release compilation-scoped plugin maps when a watch rebuild replaces the preceding compilation.
The native CSS, SRI, and Rsdoctor plugins retain several maps keyed by monotonically increasing
CompilationId; the corresponding entries were not fully removed fromclear_cache(old_id). Repeated rebuilds can therefore retain hooks, integrity/context state, or diagnostic/module metadata for every prior generation.This change uses the existing plugin lifecycle hook and only removes state for the completed compilation:
COMPILATION_HOOKS_MAP;COMPILATION_INTEGRITY_MAPandCOMPILATION_CONTEXT_MAP;No public API, option, or compilation behavior changes.
Validation
rustfmt --edition 2024 --check crates/rspack_plugin_css/src/plugin/impl_plugin_for_css_plugin.rs crates/rspack_plugin_sri/src/lib.rs crates/rspack_plugin_rsdoctor/src/plugin.rsandgit diff --checkpass.This is independent of the
ModuleGraphConnectionWrapperlifecycle fix in #14772.