Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

MU WPCOM: Replace @wordpress/react-i18n with @wordpress/i18n #38823

Merged
merged 3 commits into from
Aug 12, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
Significance: patch
Type: fixed

MU WPCOM: Fix the “page-patterns” plugin has encountered an error and cannot be rendered"
2 changes: 1 addition & 1 deletion projects/packages/jetpack-mu-wpcom/package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"private": true,
"name": "@automattic/jetpack-mu-wpcom",
"version": "5.54.2",
"version": "5.54.3-alpha",
"description": "Enhances your site with features powered by WordPress.com",
"homepage": "https://github.com/Automattic/jetpack/tree/HEAD/projects/packages/jetpack-mu-wpcom/#readme",
"bugs": {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
* Jetpack_Mu_Wpcom main class.
*/
class Jetpack_Mu_Wpcom {
const PACKAGE_VERSION = '5.54.2';
const PACKAGE_VERSION = '5.54.3-alpha';
const PKG_DIR = __DIR__ . '/../';
const BASE_DIR = __DIR__ . '/';
const BASE_FILE = __FILE__;
Expand Down Expand Up @@ -174,7 +174,7 @@ public static function load_etk_features_flags() {
define( 'MU_WPCOM_STARTER_PAGE_TEMPLATES', true );
define( 'MU_WPCOM_TAGS_EDUCATION', true );
define( 'MU_WPCOM_BLOCK_DESCRIPTION_LINKS', true );
define( 'MU_WPCOM_BLOCK_EDITOR_NUX', false );
define( 'MU_WPCOM_BLOCK_EDITOR_NUX', true );
define( 'MU_WPCOM_POSTS_LIST_BLOCK', true );
define( 'MU_WPCOM_JETPACK_COUNTDOWN_BLOCK', true );
define( 'MU_WPCOM_JETPACK_TIMELINE_BLOCK', true );
Expand Down Expand Up @@ -218,6 +218,7 @@ public static function load_etk_features() {
require_once __DIR__ . '/features/paragraph-block-placeholder/paragraph-block-placeholder.php';
require_once __DIR__ . '/features/tags-education/tags-education.php';
require_once __DIR__ . '/features/wpcom-block-description-links/wpcom-block-description-links.php';
require_once __DIR__ . '/features/wpcom-block-editor-nux/class-wpcom-block-editor-nux.php';
require_once __DIR__ . '/features/wpcom-blocks/a8c-posts-list/a8c-posts-list.php';
require_once __DIR__ . '/features/wpcom-blocks/event-countdown/event-countdown.php';
require_once __DIR__ . '/features/wpcom-blocks/timeline/timeline.php';
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
import { Button, Flex } from '@wordpress/components';
import { createInterpolateElement } from '@wordpress/element';
import { sprintf } from '@wordpress/i18n';
import { __, sprintf } from '@wordpress/i18n';
import { Icon, close } from '@wordpress/icons';
import { useI18n } from '@wordpress/react-i18n';
import maximize from '../icons/maximize';
import type { MinimizedTourRendererProps } from '../../../types';

Expand All @@ -12,7 +11,6 @@ const WpcomTourKitMinimized: React.FunctionComponent< MinimizedTourRendererProps
onDismiss,
currentStepIndex,
} ) => {
const { __ } = useI18n();
const lastStepIndex = steps.length - 1;
const page = currentStepIndex + 1;
const numberOfPages = lastStepIndex + 1;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { Button } from '@wordpress/components';
import { useState } from '@wordpress/element';
import { useI18n } from '@wordpress/react-i18n';
import { __ } from '@wordpress/i18n';
import clsx from 'clsx';
import { useTourKitContext } from '../../../index';
import thumbsDown from '../icons/thumbs_down';
Expand All @@ -12,7 +12,6 @@ const WpcomTourKitRating: React.FunctionComponent = () => {
const context = useTourKitContext();
const config = context.config as unknown as WpcomConfig;
const tourRating = config.options?.tourRating?.useTourRating?.() ?? tempRating;
const { __ } = useI18n();

let isDisabled = false;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { Button } from '@wordpress/components';
import { useI18n } from '@wordpress/react-i18n';
import { __ } from '@wordpress/i18n';
import WpcomTourKitPaginationControl from './wpcom-tour-kit-pagination-control';
import type { WpcomTourStepRendererProps } from '../../../types';

Expand All @@ -14,7 +14,6 @@ const WpcomTourKitStepCardNavigation: React.FunctionComponent< Props > = ( {
setInitialFocusedElement,
steps,
} ) => {
const { __ } = useI18n();
const isFirstStep = currentStepIndex === 0;
const lastStepIndex = steps.length - 1;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { Button, Flex } from '@wordpress/components';
import { __ } from '@wordpress/i18n';
import { close } from '@wordpress/icons';
import { useI18n } from '@wordpress/react-i18n';
import minimize from '../icons/minimize';
import type { TourStepRendererProps } from '../../../types';

Expand All @@ -13,8 +13,6 @@ const WpcomTourKitStepCardOverlayControls: React.FunctionComponent< Props > = (
onMinimize,
onDismiss,
} ) => {
const { __ } = useI18n();

return (
<div className="wpcom-tour-kit-step-card-overlay-controls">
<Flex>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { Button, Card, CardBody, CardFooter, CardMedia } from '@wordpress/components';
import { useViewportMatch } from '@wordpress/compose';
import { __ } from '@wordpress/i18n';
import { Icon } from '@wordpress/icons';
import { useI18n } from '@wordpress/react-i18n';
import clsx from 'clsx';
import WpcomTourKitRating from './wpcom-tour-kit-rating';
import WpcomTourKitStepCardNavigation from './wpcom-tour-kit-step-card-navigation';
Expand All @@ -18,7 +18,6 @@ const WpcomTourKitStepCard: React.FunctionComponent< WpcomTourStepRendererProps
onPreviousStep,
setInitialFocusedElement,
} ) => {
const { __ } = useI18n();
const lastStepIndex = steps.length - 1;
const { descriptions, heading, imgSrc, imgLink } = steps[ currentStepIndex ].meta;
const isLastStep = currentStepIndex === lastStepIndex;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
import { Modal, Button } from '@wordpress/components';
import { useDispatch, useSelect } from '@wordpress/data';
import { useEffect, useRef, useState } from '@wordpress/element';
import { __ } from '@wordpress/i18n';
import { Icon, globe, link as linkIcon } from '@wordpress/icons';
import { store as noticesStore } from '@wordpress/notices';
import { useI18n } from '@wordpress/react-i18n';
import clsx from 'clsx';
import React from 'react';
import postPublishedImage from '../../../../assets/images/illo-share.svg';
Expand Down Expand Up @@ -42,7 +42,6 @@ const SharingModalInner: React.FC = () => {
const isDismissedDefault = window?.sharingModalOptions?.isDismissed || false;
const { launchpadScreenOption } = window?.launchpadOptions || {};
const { isDismissed, updateIsDismissed } = useSharingModalDismissed( isDismissedDefault );
const { __ } = useI18n();
const isPrivateBlog = window?.wpcomGutenberg?.blogPublic === '-1';

const {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@ import { Button, FormTokenField } from '@wordpress/components';
import { TokenItem } from '@wordpress/components/build-types/form-token-field/types';
import { useDispatch, useSelect } from '@wordpress/data';
import { useEffect } from '@wordpress/element';
import { __, _n } from '@wordpress/i18n';
import { store as noticesStore } from '@wordpress/notices';
import { useI18n } from '@wordpress/react-i18n';
import * as React from 'react';
import { wpcomTrackEvent } from '../../../../common/tracks';
import useAddTagsToPost from './use-add-tags-to-post';
Expand Down Expand Up @@ -37,7 +37,6 @@ type SuggestedTagsProps = {
* @param props - The props of the component.
*/
function SuggestedTags( props: SuggestedTagsProps ) {
const { __, _n } = useI18n();
const localeSlug = useLocale();
const { id: postId, meta: postMeta } = useSelect(
select => ( select( 'core/editor' ) as CoreEditorPlaceholder ).getCurrentPost(),
Expand Down