Repository navigation
refactor(ideal-image): remove unused code from the internalized react-ideal-image fork (AI-assisted) - #12762
Merged
Conversation
…-ideal-image fork (AI-assisted) - MediaWithDefaults: never imported - Commented-out getScreenWidth(), supportsWebp() and fetchLoader() - Commented-out tests, and the test import they left unused Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
✅ [V2]
To edit notification comments on pull requests, go to your Netlify project configuration. |
|
Size Change: 0 B Total Size: 12.1 MB ℹ️ View Unchanged
|
⚡️ Lighthouse report for the deploy preview of this PR
|
|
Size Change: 0 B Total Size: 12.1 MB ℹ️ View Unchanged
|
|
The latest updates on your projects. Learn more about Argos notifications ↗︎
|
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.
Motivation
Remove dead code from the react-ideal-image fork internalized in #11010 (
packages/docusaurus-plugin-ideal-image/src/theme/IdealImageLegacy/). No behavior change.components/MediaWithDefaults/(index.js+README.md): never imported. The defaulticonsandthemecome fromIdealImageWithDefaults(the fork's entry point), andIdealImageforwards them toMedia.components/helpers.js: the commented-outgetScreenWidth()/screenWidth, and the commented-out asyncsupportsWebp()+ webp promise. Both were already commented out upstream when we copied the fork. WebP detection uses the synchronousdetectWebpSupport(), which stays.components/loaders.js: the commented-outfetchLoader(), plus the 2 "Caveat" comments above it that only describefetchLoader(). The caveats abovexhrLoader()stay.__tests__/helpers.js: the commented-outguessMaxImageWidthandfallbackParamstest suites, and the imports they left unused.__tests__/helpers.node.jsalready tests both functions.The commented-out
propTypesblocks inMediaandIdealImagestay: they document the component props.This PR was written with AI assistance (AI-assisted).
Test Plan
rg -a MediaWithDefaults packages websitefinds nothing outsidelib/andnode_modules/pnpm test packages/docusaurus-plugin-ideal-imagepassespnpm --filter @docusaurus/plugin-ideal-image buildpassesTest links
Deploy preview: https://deploy-preview-12762--docusaurus-2.netlify.app/
Related issues/PRs
🤖 Generated with Claude Code
Summary by CodeRabbit