Skip to content
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

fix: correctly iterate over plugins when using removePlugin #1507

Merged
merged 1 commit into from
Oct 21, 2024

Conversation

Yukiniro
Copy link
Contributor

Summary

When calling modifyConfig, if some plugins call removePlugin or addPlugin, the index of the plugin in this.#plugins will change. Since addPlugin uses push, it will not affect the index of other plugins. If it is removePlugin, it is necessary to consider whether the plugin to be removed is before the current traversal index. If so, the plugins after the index will move forward 1 in this.#plugins. If not, there will be no impact.

Related Issue

Closes #1487

Checklist

  • Tests updated (or not required).
  • Documentation updated (or not required).

Copy link

netlify bot commented Oct 20, 2024

Deploy Preview for aquamarine-blini-95325f ready!

Name Link
🔨 Latest commit 35fc9d9
🔍 Latest deploy log https://app.netlify.com/sites/aquamarine-blini-95325f/deploys/6714a7ca7fecdf0008d86755
😎 Deploy Preview https://deploy-preview-1507--aquamarine-blini-95325f.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.
Lighthouse
Lighthouse
1 paths audited
Performance: 95 (🟢 up 1 from production)
Accessibility: 97 (no change from production)
Best Practices: 92 (no change from production)
SEO: 92 (no change from production)
PWA: -
View the detailed breakdown and full score reports

To edit notification comments on pull requests, go to your Netlify site configuration.

@Yukiniro Yukiniro changed the title fix: correctly iterate over plugins when using removePlugin fix: correctly iterate over plugins when using removePlugin Oct 20, 2024
Copy link
Contributor

@Timeless0911 Timeless0911 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@Timeless0911 Timeless0911 merged commit 7caec92 into web-infra-dev:main Oct 21, 2024
9 checks passed
@Yukiniro Yukiniro deleted the a1amvofc branch October 21, 2024 05:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Bug]: will not traverse all plugins if a plugin uses remove removePlugin or addPlugin API
2 participants