Skip to content

use no ssr image zoom#1807

Merged
carlosabadia merged 3 commits intomainfrom
carlos/move-some-components-to-no-ssr
Apr 2, 2026
Merged

use no ssr image zoom#1807
carlosabadia merged 3 commits intomainfrom
carlos/move-some-components-to-no-ssr

Conversation

@carlosabadia
Copy link
Copy Markdown
Collaborator

@carlosabadia carlosabadia commented Apr 2, 2026

@greptile-apps
Copy link
Copy Markdown
Contributor

greptile-apps bot commented Apr 2, 2026

Greptile Summary

This PR replaces the external reflex-image-zoom PyPI package with an equivalent internal ImageZoom component (pcweb/components/image_zoom.py) that extends rx.NoSSRComponent. The motivation is to disable server-side rendering for the zoom widget (depends on reflex-dev/reflex#6276), avoiding hydration mismatches that NoSSRComponent prevents. The reflex-image-zoom dependency is removed from pyproject.toml and uv.lock, and every import across the ~50 markdown/Python files is updated from from reflex_image_zoom import image_zoom to from pcweb.components.image_zoom import image_zoom.

Key observations:

  • New component (pcweb/components/image_zoom.py): clean implementation — wraps react-medium-image-zoom@5.4.2, sets is_default = True, and injects the required CSS via _get_custom_code. The NoSSRComponent base class correctly prevents SSR for this client-only widget.
  • Dependency cleanup: reflex-image-zoom is fully removed from pyproject.toml and uv.lock.
  • Documentation mismatch in blog/custom-components.md: the blog post still tells readers to run pip install reflex-image-zoom, but the demo code block now imports from the internal pcweb.components.image_zoom path, creating a confusing inconsistency for blog readers.

Confidence Score: 5/5

  • Safe to merge once the dependent reflex PR #6276 lands on main; only remaining finding is a minor documentation inconsistency.
  • All findings are P2. The sole issue is a documentation mismatch in one blog post — the pip install instruction doesn't match the updated demo import. There are no runtime bugs, data-integrity issues, or correctness problems introduced by the code changes.
  • blog/custom-components.md — the pip install reflex-image-zoom prose no longer matches the demo import.

Important Files Changed

Filename Overview
pcweb/components/image_zoom.py New internal ImageZoom component using rx.NoSSRComponent; wraps react-medium-image-zoom@5.4.2 and injects styles via _get_custom_code.
blog/custom-components.md Import updated to pcweb.components.image_zoom but prose still instructs readers to pip install reflex-image-zoom, creating a mismatch with the demo code.
pyproject.toml reflex-image-zoom dependency removed now that the component is inlined; uv.lock updated accordingly.
pcweb/pages/customers/views/app_preview_card.py Import updated to use the new internal image_zoom component; no functional change.

Class Diagram

%%{init: {'theme': 'neutral'}}%%
classDiagram
    class NoSSRComponent {
        <<rx.NoSSRComponent>>
    }
    class ImageZoom {
        +library: str = "react-medium-image-zoom@5.4.2"
        +tag: str = "Zoom"
        +is_default: bool = True
        +_get_custom_code() str
    }
    NoSSRComponent <|-- ImageZoom
    ImageZoom ..> image_zoom : create alias
    note for ImageZoom "Replaces reflex-image-zoom PyPI package\nSSR disabled via NoSSRComponent"
Loading

Reviews (2): Last reviewed commit: "bump" | Re-trigger Greptile

@carlosabadia carlosabadia marked this pull request as draft April 2, 2026 11:27
@carlosabadia carlosabadia marked this pull request as ready for review April 2, 2026 17:47
@carlosabadia carlosabadia merged commit 31795b5 into main Apr 2, 2026
10 checks passed
@carlosabadia carlosabadia deleted the carlos/move-some-components-to-no-ssr branch April 2, 2026 18:54
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