Skip to content

Conversation

@guitavano
Copy link
Contributor

@guitavano guitavano commented Dec 8, 2025

Summary by CodeRabbit

  • Refactor
    • Enhanced asset URL configuration system for improved flexibility when working with multiple asset delivery services.
    • Optimized image processing logic to more efficiently handle and transform asset URLs across different sources.
    • Refined URL normalization process while maintaining consistent image optimization behavior.

✏️ Tip: You can customize this high-level summary in your review settings.

@github-actions
Copy link
Contributor

github-actions bot commented Dec 8, 2025

Tagging Options

Should a new tag be published when this PR is merged?

  • 👍 for Patch 0.133.16 update
  • 🎉 for Minor 0.134.0 update
  • 🚀 for Major 1.0.0 update

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Dec 8, 2025

Caution

Review failed

The pull request is closed.

Walkthrough

The PR refactors URL replacement logic in the image optimization component by replacing two hard-coded asset base URL constants with a reusable array, and updates the stripping mechanism to remove all occurrences of any URL in that array using a reduce operation instead of sequential removals.

Changes

Cohort / File(s) Summary
Image optimization URL handling
website/components/Image.tsx
Replaced hard-coded DECO_CACHE_URL and S3_URL constants with a new ASSET_URLS_TO_REPLACE array; updated getOptimizedMediaUrl to use reduce-based replacement for stripping all asset base URLs from originalSrc; maintains existing behavior for query parameter removal

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~8 minutes

  • Verify the reduce-based replacement logic correctly handles all occurrences of URLs from the new ASSET_URLS_TO_REPLACE array
  • Confirm the new array includes all necessary asset base URLs to maintain backward compatibility with the previous hard-coded replacements

Possibly related PRs

Suggested reviewers

  • vibe-dex

Poem

🐰 Constants once locked in place now dance and play,
An array born to flex in every way,
URL stripping flows like rabbit streams,
Reduce and replace—fulfilling our schemes! ✨

✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch asset_urls_to_replace

📜 Recent review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between ecc4a9d and 65f79b5.

📒 Files selected for processing (1)
  • website/components/Image.tsx (2 hunks)

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@guitavano guitavano merged commit c1ceeef into main Dec 8, 2025
3 of 4 checks passed
@guitavano guitavano deleted the asset_urls_to_replace branch December 8, 2025 17:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants