Skip to content

refactor: remove bypassPlatformImageOptimization flag - #1596

Merged
guitavano merged 1 commit into
mainfrom
remove-bypass-platform-image-optimization
May 21, 2026
Merged

refactor: remove bypassPlatformImageOptimization flag#1596
guitavano merged 1 commit into
mainfrom
remove-bypass-platform-image-optimization

Conversation

@guitavano

@guitavano guitavano commented May 21, 2026

Copy link
Copy Markdown
Contributor

Summary

  • Removes the BYPASS_PLATFORM_IMAGE_OPTIMIZATION env var, client-side feature flag, and conditional guard
  • Platform image optimizations (VTEX, Shopify, Wake, VNDA, Sourei, Magento) now always run unconditionally

Test plan

  • Verify images from each platform (VTEX, Shopify, Wake, VNDA, Sourei, Magento) are still optimized correctly
  • Verify deco CDN fallback still works for non-platform images

🤖 Generated with Claude Code


Summary by cubic

Removed the BYPASS_PLATFORM_IMAGE_OPTIMIZATION flag and now always apply platform-specific image optimizations. VTEX, Shopify, Wake, VNDA, Sourei, and Magento URLs are optimized by default.

  • Refactors

    • Simplified getOptimizedMediaUrl to always run platform optimizers.
    • Removed the bypassPlatformImageOptimization helper and related checks.
    • Dropped feature flag wiring from Events.tsx.
  • Migration

    • Remove BYPASS_PLATFORM_IMAGE_OPTIMIZATION from envs and client feature flags (now a no-op).
    • To bypass Deco CDN for non-platform images, continue using BYPASS_DECO_IMAGE_OPTIMIZATION if needed.

Written for commit 35505c4. Summary will update on new commits. Review in cubic

Summary by CodeRabbit

  • Chores
    • Removed the platform image optimization bypass flag; platform-specific image optimizations are now consistently applied.
    • Simplified analytics feature flags configuration.

Review Change Stack

Platform image optimizations (VTEX, Shopify, Wake, VNDA, Sourei, Magento)
now always run unconditionally. Removes the BYPASS_PLATFORM_IMAGE_OPTIMIZATION
env var, the client-side feature flag, and the wrapping conditional.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@github-actions

Copy link
Copy Markdown
Contributor

Tagging Options

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

  • 👍 for Patch 0.151.3 update
  • 🎉 for Minor 0.152.0 update
  • 🚀 for Major 1.0.0 update

@coderabbitai

coderabbitai Bot commented May 21, 2026

Copy link
Copy Markdown
Contributor

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 60623944-e56e-4c2d-b3e6-27f44e8f4f51

📥 Commits

Reviewing files that changed from the base of the PR and between 7d59c61 and 35505c4.

📒 Files selected for processing (2)
  • website/components/Events.tsx
  • website/components/Image.tsx
💤 Files with no reviewable changes (1)
  • website/components/Events.tsx

📝 Walkthrough

Walkthrough

The PR removes the bypassPlatformImageOptimization feature flag and its associated conditional logic. Events.tsx no longer declares or exports this flag; Image.tsx no longer gates platform-specific image optimizers behind it, making those optimizations unconditional.

Changes

Platform Bypass Feature Flag Removal

Layer / File(s) Summary
Remove feature flag type and constant from Events.tsx
website/components/Events.tsx
The FeatureFlags type definition is narrowed by removing the bypassPlatformImageOptimization field. The BYPASS_PLATFORM_IMAGE_OPTIMIZATION environment-derived constant is deleted.
Update analytics featureFlags payload
website/components/Events.tsx
The featureFlags object passed to the embedded analytics snippet no longer assigns bypassPlatformImageOptimization; it now passes only bypassDecoImageOptimization and cdnHost.
Unwrap platform-specific optimizers in Image.tsx
website/components/Image.tsx
The bypassPlatformImageOptimization helper function is removed. In getOptimizedMediaUrl, platform-specific optimizer branches (Magento, Wake, VNDA, Shopify, VTEX, Soureicdn) are now evaluated directly without the outer conditional gate, so they execute unconditionally when their source patterns match.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~12 minutes

Possibly related PRs

  • deco-cx/apps#1577: Modifies the same storefront image-optimization pipeline in website/components/Image.tsx and website/components/Events.tsx feature-flag shape.
  • deco-cx/apps#1507: Modifies website/components/Image.tsx's getOptimizedMediaUrl logic around platform image URL optimization with Magento-specific routing.
  • deco-cx/apps#1501: Adds Wake-specific optimization path in website/components/Image.tsx's getOptimizedMediaUrl logic around host-specific optimizers.

Suggested reviewers

  • vibe-dex
  • aka-sacci-ccr
  • mcandeia

Poem

🐰 Flags once gated the image machine,
But now the optimizers flow free and keen!
Platform-specific paths run uncaged,
A simpler directive, no longer staged.

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 inconclusive)

Check name Status Explanation Resolution
Description check ❓ Inconclusive The description covers the key changes and includes a test plan, but does not follow the repository template structure (missing sections like 'What is this Contribution About?', 'Issue Link', and 'Demonstration Link'). Restructure the description to match the template: add explicit 'What is this Contribution About?' section, include 'Issue Link' section, and provide a 'Demonstration Link' if available.
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed The title accurately and concisely summarizes the main change—removing the bypassPlatformImageOptimization flag—which aligns with the primary objective of the pull request.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch remove-bypass-platform-image-optimization

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.

@cubic-dev-ai cubic-dev-ai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

No issues found across 2 files

Re-trigger cubic

@guitavano
guitavano merged commit 1dea09a into main May 21, 2026
8 of 9 checks passed
@guitavano
guitavano deleted the remove-bypass-platform-image-optimization branch May 21, 2026 19:25
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.

2 participants