Skip to content

Conversation

@claudiucelfilip
Copy link
Contributor

Part of DOTDEV-258

Proposed Changes

  • adds a missing check for the document element
  • replaces the use-subscription module, which doesn't work server-side, with the native React equivalent that does

Why are these changes being made?

  • needed to implement the Plugins redesign

Testing Instructions

  • Checkout this branch
  • Log out
  • Run the calypso build using the markerplace-redesign feature flag: ENABLE_FEATURES=marketplace-redesign yarn start
  • Disable JS
  • Go to http://calypso.localhost:3000/plugins and http://calypso.localhost:3000/ar/plugins
  • The pages should be rendered and the carousel arrows show point in the correct directions
LTR RTL
Screenshot 2025-11-14 at 16 00 18 Screenshot 2025-11-14 at 15 59 47

Pre-merge Checklist

  • Has the general commit checklist been followed? (PCYsg-hS-p2)
  • Have you written new tests for your changes?
  • Have you tested the feature in Simple (P9HQHe-k8-p2), Atomic (P9HQHe-jW-p2), and self-hosted Jetpack sites (PCYsg-g6b-p2)?
  • Have you checked for TypeScript, React or other console errors?
  • Have you tested accessibility for your changes? Ensure the feature remains usable with various user agents (e.g., browsers), interfaces (e.g., keyboard navigation), and assistive technologies (e.g., screen readers) (PCYsg-S3g-p2).
  • Have you used memoizing on expensive computations? More info in Memoizing with create-selector and Using memoizing selectors and Our Approach to Data
  • Have we added the "[Status] String Freeze" label as soon as any new strings were ready for translation (p4TIVU-5Jq-p2)?
    • For UI changes, have we tested the change in various languages (for example, ES, PT, FR, or DE)? The length of text and words vary significantly between languages.
  • For changes affecting Jetpack: Have we added the "[Status] Needs Privacy Updates" label if this pull request changes what data or activity we track or use (p4TIVU-aUh-p2)?

@claudiucelfilip claudiucelfilip requested a review from a team as a code owner November 14, 2025 14:20
@matticbot matticbot added [Status] Needs Review The PR is ready for review. This also triggers e2e canary tests and wp-desktop tests automatically. labels Nov 14, 2025
@github-actions
Copy link

github-actions bot commented Nov 14, 2025

@claudiucelfilip claudiucelfilip requested review from a team and Copilot November 14, 2025 14:23
@claudiucelfilip claudiucelfilip self-assigned this Nov 14, 2025
Copilot finished reviewing on behalf of claudiucelfilip November 14, 2025 14:25
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR fixes Server Side Rendering (SSR) compatibility for the Dot Pager component by addressing two SSR-related issues: adding a check for the document object in the swipeable component and replacing the deprecated use-subscription module with React's native useSyncExternalStore hook in the RTL functionality.

Key changes:

  • Migrated from use-subscription to useSyncExternalStore in the RTL hook for better SSR support
  • Added a document undefined check in the swipeable component to prevent SSR errors

Reviewed Changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.

File Description
packages/i18n-calypso/src/rtl.js Replaced use-subscription with useSyncExternalStore for SSR-compatible RTL detection
packages/components/src/swipeable/index.js Added check for document existence to prevent SSR errors when detecting touch events

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@matticbot
Copy link
Contributor

This PR modifies the release build for the following Calypso Apps:

For info about this notification, see here: PCYsg-OT6-p2

  • blaze-dashboard
  • help-center
  • notifications
  • odyssey-stats
  • wpcom-block-editor

To test WordPress.com changes, run install-plugin.sh $pluginSlug fix/ssr-dotpager on your sandbox.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

[Status] Needs Review The PR is ready for review. This also triggers e2e canary tests and wp-desktop tests automatically.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants