diff --git a/projects/packages/backup/changelog/update-wp-61-backcompat-janitorial b/projects/packages/backup/changelog/update-wp-61-backcompat-janitorial
new file mode 100644
index 0000000000000..de23d7843b671
--- /dev/null
+++ b/projects/packages/backup/changelog/update-wp-61-backcompat-janitorial
@@ -0,0 +1,4 @@
+Significance: patch
+Type: changed
+
+General: remove WP 6.1 backwards compatibility checks
diff --git a/projects/packages/backup/src/js/index.js b/projects/packages/backup/src/js/index.js
index f6b6a40fdcd35..2f07534eaf42d 100644
--- a/projects/packages/backup/src/js/index.js
+++ b/projects/packages/backup/src/js/index.js
@@ -1,6 +1,6 @@
import { ThemeProvider } from '@automattic/jetpack-components';
import { createReduxStore, register } from '@wordpress/data';
-import * as WPElement from '@wordpress/element';
+import { render } from '@wordpress/element';
import React from 'react';
import Admin from './components/Admin';
import { STORE_ID, storeConfig } from './store';
@@ -11,24 +11,19 @@ register( store );
/**
* Initial render function.
*/
-function render() {
+function renderDash() {
const container = document.getElementById( 'jetpack-backup-root' );
if ( null === container ) {
return;
}
- // @todo: Remove fallback when we drop support for WP 6.1
- const component = (
+ render(
-
+ ,
+ container
);
- if ( WPElement.createRoot ) {
- WPElement.createRoot( container ).render( component );
- } else {
- WPElement.render( component, container );
- }
}
-render();
+renderDash();
diff --git a/projects/packages/connection/changelog/update-wp-61-backcompat-janitorial b/projects/packages/connection/changelog/update-wp-61-backcompat-janitorial
new file mode 100644
index 0000000000000..de23d7843b671
--- /dev/null
+++ b/projects/packages/connection/changelog/update-wp-61-backcompat-janitorial
@@ -0,0 +1,4 @@
+Significance: patch
+Type: changed
+
+General: remove WP 6.1 backwards compatibility checks
diff --git a/projects/packages/connection/tests/php/bootstrap.php b/projects/packages/connection/tests/php/bootstrap.php
index 7c950bc97fabe..a7711b487e0f5 100644
--- a/projects/packages/connection/tests/php/bootstrap.php
+++ b/projects/packages/connection/tests/php/bootstrap.php
@@ -10,10 +10,6 @@
*/
require_once __DIR__ . '/../../vendor/autoload.php';
-// Disable warning about deprecated request library.
-// @todo Remove this once we drop support for WordPress 6.1
-define( 'REQUESTS_SILENCE_PSR0_DEPRECATIONS', true );
-
// Work around WordPress bug when `@runInSeparateProcess` is used.
if ( empty( $_SERVER['SCRIPT_FILENAME'] ) ) {
$_SERVER['SCRIPT_FILENAME'] = __DIR__ . '/vendor/phpunit/phpunit/phpunit';
diff --git a/projects/packages/identity-crisis/changelog/update-wp-61-backcompat-janitorial b/projects/packages/identity-crisis/changelog/update-wp-61-backcompat-janitorial
new file mode 100644
index 0000000000000..de23d7843b671
--- /dev/null
+++ b/projects/packages/identity-crisis/changelog/update-wp-61-backcompat-janitorial
@@ -0,0 +1,4 @@
+Significance: patch
+Type: changed
+
+General: remove WP 6.1 backwards compatibility checks
diff --git a/projects/packages/identity-crisis/src/_inc/admin.jsx b/projects/packages/identity-crisis/src/_inc/admin.jsx
index a64151633ee0e..40856f20bdc5a 100644
--- a/projects/packages/identity-crisis/src/_inc/admin.jsx
+++ b/projects/packages/identity-crisis/src/_inc/admin.jsx
@@ -1,5 +1,5 @@
import { IDCScreen } from '@automattic/jetpack-idc';
-import * as WPElement from '@wordpress/element';
+import { render } from '@wordpress/element';
import React from 'react';
import './admin-bar.scss';
@@ -8,7 +8,7 @@ import './style.scss';
/**
* The initial renderer function.
*/
-function render() {
+function renderIdc() {
if ( ! window.hasOwnProperty( 'JP_IDENTITY_CRISIS__INITIAL_STATE' ) ) {
return;
}
@@ -36,7 +36,6 @@ function render() {
} = window.JP_IDENTITY_CRISIS__INITIAL_STATE;
if ( ! isSafeModeConfirmed ) {
- // @todo: Remove fallback when we drop support for WP 6.1
const component = (
);
-
- if ( WPElement.createRoot ) {
- WPElement.createRoot( container ).render( component );
- } else {
- WPElement.render( component, container );
- }
+ render( component, container );
}
}
-window.addEventListener( 'load', () => render() );
+window.addEventListener( 'load', () => renderIdc() );
diff --git a/projects/packages/my-jetpack/_inc/admin.jsx b/projects/packages/my-jetpack/_inc/admin.jsx
index f7cbe3fc9267b..6300f8246750b 100644
--- a/projects/packages/my-jetpack/_inc/admin.jsx
+++ b/projects/packages/my-jetpack/_inc/admin.jsx
@@ -2,7 +2,7 @@
* External dependencies
*/
import { ThemeProvider } from '@automattic/jetpack-components';
-import * as WPElement from '@wordpress/element';
+import { render } from '@wordpress/element';
import React, { useEffect } from 'react';
import { HashRouter, Navigate, Routes, Route, useLocation } from 'react-router-dom';
/**
@@ -74,18 +74,13 @@ const MyJetpack = () => (
/**
* The initial renderer function.
*/
-function render() {
+function renderMyJetpack() {
const container = document.getElementById( 'my-jetpack-container' );
if ( null === container ) {
return;
}
- // @todo: Remove fallback when we drop support for WP 6.1
- if ( WPElement.createRoot ) {
- WPElement.createRoot( container ).render( );
- } else {
- WPElement.render( , container );
- }
+ render( , container );
}
-render();
+renderMyJetpack();
diff --git a/projects/packages/my-jetpack/changelog/update-wp-61-backcompat-janitorial b/projects/packages/my-jetpack/changelog/update-wp-61-backcompat-janitorial
new file mode 100644
index 0000000000000..de23d7843b671
--- /dev/null
+++ b/projects/packages/my-jetpack/changelog/update-wp-61-backcompat-janitorial
@@ -0,0 +1,4 @@
+Significance: patch
+Type: changed
+
+General: remove WP 6.1 backwards compatibility checks
diff --git a/projects/packages/search/changelog/update-wp-61-backcompat-janitorial b/projects/packages/search/changelog/update-wp-61-backcompat-janitorial
new file mode 100644
index 0000000000000..de23d7843b671
--- /dev/null
+++ b/projects/packages/search/changelog/update-wp-61-backcompat-janitorial
@@ -0,0 +1,4 @@
+Significance: patch
+Type: changed
+
+General: remove WP 6.1 backwards compatibility checks
diff --git a/projects/packages/search/src/dashboard/index.jsx b/projects/packages/search/src/dashboard/index.jsx
index 023ab3fb946b3..417a1624a365b 100644
--- a/projects/packages/search/src/dashboard/index.jsx
+++ b/projects/packages/search/src/dashboard/index.jsx
@@ -1,5 +1,5 @@
import { createReduxStore, register } from '@wordpress/data';
-import * as WPElement from '@wordpress/element';
+import { render } from '@wordpress/element';
import React from 'react';
import SearchDashboard from './components/dashboard/wrapped-dashboard';
import { STORE_ID, storeConfig } from './store';
@@ -17,12 +17,7 @@ function init() {
return;
}
- // @todo: Remove fallback when we drop support for WP 6.1
- if ( WPElement.createRoot ) {
- WPElement.createRoot( container ).render( );
- } else {
- WPElement.render( , container );
- }
+ render( , container );
}
// Initialize the dashboard when DOMContentLoaded is fired, or immediately if it already has been.
diff --git a/projects/packages/videopress/changelog/update-wp-61-backcompat-janitorial b/projects/packages/videopress/changelog/update-wp-61-backcompat-janitorial
new file mode 100644
index 0000000000000..de23d7843b671
--- /dev/null
+++ b/projects/packages/videopress/changelog/update-wp-61-backcompat-janitorial
@@ -0,0 +1,4 @@
+Significance: patch
+Type: changed
+
+General: remove WP 6.1 backwards compatibility checks
diff --git a/projects/packages/videopress/src/client/admin/index.js b/projects/packages/videopress/src/client/admin/index.js
index b3cfd95e09c8c..acc2252e3970f 100644
--- a/projects/packages/videopress/src/client/admin/index.js
+++ b/projects/packages/videopress/src/client/admin/index.js
@@ -2,7 +2,7 @@
* External dependencies
*/
import { ThemeProvider } from '@automattic/jetpack-components';
-import * as WPElement from '@wordpress/element';
+import { render } from '@wordpress/element';
import { __ } from '@wordpress/i18n';
import { useEffect } from 'react';
import { HashRouter, Switch, Route, useLocation } from 'react-router-dom';
@@ -66,19 +66,14 @@ const VideoPress = () => {
/**
* Initial render function.
*/
-function render() {
+function renderVideopress() {
const container = document.getElementById( 'jetpack-videopress-root' );
if ( null === container ) {
return;
}
- // @todo: Remove fallback when we drop support for WP 6.1
- if ( WPElement.createRoot ) {
- WPElement.createRoot( container ).render( );
- } else {
- WPElement.render( , container );
- }
+ render( , container );
}
-render();
+renderVideopress();
diff --git a/projects/packages/wordads/changelog/update-wp-61-backcompat-janitorial b/projects/packages/wordads/changelog/update-wp-61-backcompat-janitorial
new file mode 100644
index 0000000000000..de23d7843b671
--- /dev/null
+++ b/projects/packages/wordads/changelog/update-wp-61-backcompat-janitorial
@@ -0,0 +1,4 @@
+Significance: patch
+Type: changed
+
+General: remove WP 6.1 backwards compatibility checks
diff --git a/projects/packages/wordads/src/dashboard/index.jsx b/projects/packages/wordads/src/dashboard/index.jsx
index 59a0823c662a5..4608224762ee8 100644
--- a/projects/packages/wordads/src/dashboard/index.jsx
+++ b/projects/packages/wordads/src/dashboard/index.jsx
@@ -1,6 +1,6 @@
import { ThemeProvider } from '@automattic/jetpack-components';
import { createReduxStore, register } from '@wordpress/data';
-import * as WPElement from '@wordpress/element';
+import { render } from '@wordpress/element';
import React from 'react';
import WordAdsDashboard from './components/dashboard';
import { STORE_ID, storeConfig } from './store';
@@ -18,17 +18,12 @@ function init() {
return;
}
- // @todo: Remove fallback when we drop support for WP 6.1
- const component = (
+ render(
-
+ ,
+ container
);
- if ( WPElement.createRoot ) {
- WPElement.createRoot( container ).render( component );
- } else {
- WPElement.render( component, container );
- }
}
// Initialize the dashboard when DOMContentLoaded is fired, or immediately if it already has been.
diff --git a/projects/plugins/boost/app/assets/src/js/elements/ReactComponent.svelte b/projects/plugins/boost/app/assets/src/js/elements/ReactComponent.svelte
index 30c1c3eb38bb4..ffaa7d29b8bb6 100644
--- a/projects/plugins/boost/app/assets/src/js/elements/ReactComponent.svelte
+++ b/projects/plugins/boost/app/assets/src/js/elements/ReactComponent.svelte
@@ -7,16 +7,11 @@
let root;
afterUpdate( () => {
const { this: component, children, ...props } = $$props;
- // @todo: Remove fallback when we drop support for WP 6.1
- if ( WPElement.createRoot ) {
- root = WPElement.createRoot( container );
- } else {
- const theContainer = container;
- root = {
- render: theComponent => WPElement.render( theComponent, theContainer ),
- unmount: () => WPElement.unmountComponentAtNode( theContainer ),
- };
- }
+ const theContainer = container;
+ root = {
+ render: theComponent => WPElement.render( theComponent, theContainer ),
+ unmount: () => WPElement.unmountComponentAtNode( theContainer ),
+ };
root.render( React.createElement( component, props, children ) );
} );
onDestroy( () => {
diff --git a/projects/plugins/boost/changelog/update-wp-61-backcompat-janitorial b/projects/plugins/boost/changelog/update-wp-61-backcompat-janitorial
new file mode 100644
index 0000000000000..de23d7843b671
--- /dev/null
+++ b/projects/plugins/boost/changelog/update-wp-61-backcompat-janitorial
@@ -0,0 +1,4 @@
+Significance: patch
+Type: changed
+
+General: remove WP 6.1 backwards compatibility checks
diff --git a/projects/plugins/jetpack/_inc/client/activation-modal-entry.js b/projects/plugins/jetpack/_inc/client/activation-modal-entry.js
index e62d67a13934b..18c18511a9d31 100644
--- a/projects/plugins/jetpack/_inc/client/activation-modal-entry.js
+++ b/projects/plugins/jetpack/_inc/client/activation-modal-entry.js
@@ -1,4 +1,4 @@
-import * as WPElement from '@wordpress/element';
+import { render } from '@wordpress/element';
import React from 'react';
import { Provider } from 'react-redux';
import store from 'state/redux-store-minimal';
@@ -10,17 +10,12 @@ import ActivationModal from './portals/activation-modal';
function initActivationModalApp() {
const container = document.getElementById( 'jetpack-plugin-portal-app' );
- // @todo: Remove fallback when we drop support for WP 6.1
- const component = (
+ render(
-
+ ,
+ container
);
- if ( WPElement.createRoot ) {
- WPElement.createRoot( container ).render( component );
- } else {
- WPElement.render( component, container );
- }
}
if ( document.readyState !== 'loading' ) {
diff --git a/projects/plugins/jetpack/_inc/client/admin.js b/projects/plugins/jetpack/_inc/client/admin.js
index 0bc2fd6897ad4..1bff8182f8089 100644
--- a/projects/plugins/jetpack/_inc/client/admin.js
+++ b/projects/plugins/jetpack/_inc/client/admin.js
@@ -1,4 +1,4 @@
-import * as WPElement from '@wordpress/element';
+import { render } from '@wordpress/element';
import { _x } from '@wordpress/i18n';
import accessibleFocus from 'lib/accessible-focus';
import { assign } from 'lodash';
@@ -20,19 +20,18 @@ if ( 'undefined' !== typeof window && process.env.NODE_ENV === 'development' ) {
} );
}
-render();
+renderApp();
/**
- *
+ * Initial render function.
*/
-function render() {
+function renderApp() {
const container = document.getElementById( 'jp-plugin-container' );
if ( container === null ) {
return;
}
- // @todo: Remove fallback when we drop support for WP 6.1
const component = (
@@ -100,11 +99,7 @@ function render() {
);
- if ( WPElement.createRoot ) {
- WPElement.createRoot( container ).render( component );
- } else {
- WPElement.render( component, container );
- }
+ render( component, container );
}
/**
diff --git a/projects/plugins/jetpack/_inc/client/components/root-child/index.jsx b/projects/plugins/jetpack/_inc/client/components/root-child/index.jsx
index eb1990da31dfc..085e4e1ed7bf8 100644
--- a/projects/plugins/jetpack/_inc/client/components/root-child/index.jsx
+++ b/projects/plugins/jetpack/_inc/client/components/root-child/index.jsx
@@ -19,16 +19,11 @@ export default class RootChild extends React.Component {
componentDidMount() {
this.container = document.createElement( 'div' );
document.body.appendChild( this.container );
- // @todo: Remove fallback when we drop support for WP 6.1
- if ( WPElement.createRoot ) {
- this.containerRoot = WPElement.createRoot( this.container );
- } else {
- const theContainer = this.container;
- this.containerRoot = {
- render: component => WPElement.render( component, theContainer ),
- unmount: () => WPElement.unmountComponentAtNode( theContainer ),
- };
- }
+ const theContainer = this.container;
+ this.containerRoot = {
+ render: component => WPElement.render( component, theContainer ),
+ unmount: () => WPElement.unmountComponentAtNode( theContainer ),
+ };
this.renderChildren();
}
diff --git a/projects/plugins/jetpack/_inc/client/plugins-entry.js b/projects/plugins/jetpack/_inc/client/plugins-entry.js
index 8d4eb6d418a11..421a03f295bb7 100644
--- a/projects/plugins/jetpack/_inc/client/plugins-entry.js
+++ b/projects/plugins/jetpack/_inc/client/plugins-entry.js
@@ -1,4 +1,4 @@
-import * as WPElement from '@wordpress/element';
+import { render } from '@wordpress/element';
import React from 'react';
import { Provider } from 'react-redux';
import store from 'state/redux-store-minimal';
@@ -10,17 +10,12 @@ import PluginDeactivation from './portals/plugin-deactivation';
function initPluginsPageApp() {
const container = document.getElementById( 'jetpack-plugin-portal-app' );
- // @todo: Remove fallback when we drop support for WP 6.1
- const component = (
+ render(
-
+ ,
+ container
);
- if ( WPElement.createRoot ) {
- WPElement.createRoot( container ).render( component );
- } else {
- WPElement.render( component, container );
- }
}
if ( document.readyState !== 'loading' ) {
diff --git a/projects/plugins/jetpack/_inc/client/search-dashboard-entry.js b/projects/plugins/jetpack/_inc/client/search-dashboard-entry.js
index 6e4596cb7c353..a64e4bcc1e97e 100644
--- a/projects/plugins/jetpack/_inc/client/search-dashboard-entry.js
+++ b/projects/plugins/jetpack/_inc/client/search-dashboard-entry.js
@@ -1,4 +1,4 @@
-import * as WPElement from '@wordpress/element';
+import { render } from '@wordpress/element';
import React from 'react';
import { Provider } from 'react-redux';
import store from 'state/redux-store';
@@ -14,17 +14,12 @@ function init() {
return;
}
- // @todo: Remove fallback when we drop support for WP 6.1
- const component = (
+ render(
-
+ ,
+ container
);
- if ( WPElement.createRoot ) {
- WPElement.createRoot( container ).render( component );
- } else {
- WPElement.render( component, container );
- }
}
// Initialize the dashboard when DOMContentLoaded is fired, or immediately if it already has been.
diff --git a/projects/plugins/jetpack/_inc/lib/admin-pages/class-jetpack-redux-state-helper.php b/projects/plugins/jetpack/_inc/lib/admin-pages/class-jetpack-redux-state-helper.php
index 1e90e31ef16d4..479377f5e81fa 100644
--- a/projects/plugins/jetpack/_inc/lib/admin-pages/class-jetpack-redux-state-helper.php
+++ b/projects/plugins/jetpack/_inc/lib/admin-pages/class-jetpack-redux-state-helper.php
@@ -205,10 +205,8 @@ public static function get_initial_state() {
'support' => array(
'infinite-scroll' => current_theme_supports( 'infinite-scroll' ) || in_array( $current_theme->get_stylesheet(), $inf_scr_support_themes, true ),
'widgets' => current_theme_supports( 'widgets' ),
- 'webfonts' => (
- // @todo Remove conditional once we drop support for WordPress 6.1
- function_exists( 'wp_theme_has_theme_json' ) ? wp_theme_has_theme_json() : WP_Theme_JSON_Resolver::theme_has_support()
- ) && function_exists( 'wp_register_webfont_provider' ) && function_exists( 'wp_register_webfonts' ),
+ 'webfonts' => wp_theme_has_theme_json()
+ && ( function_exists( 'wp_register_webfont_provider' ) || function_exists( 'wp_register_webfonts' ) ),
),
),
'jetpackStateNotices' => array(
diff --git a/projects/plugins/jetpack/changelog/update-wp-61-backcompat-janitorial b/projects/plugins/jetpack/changelog/update-wp-61-backcompat-janitorial
new file mode 100644
index 0000000000000..e59be9d344d05
--- /dev/null
+++ b/projects/plugins/jetpack/changelog/update-wp-61-backcompat-janitorial
@@ -0,0 +1,4 @@
+Significance: patch
+Type: compat
+
+General: remove WP 6.1 backwards compatibility checks.
diff --git a/projects/plugins/jetpack/tests/php/bootstrap.php b/projects/plugins/jetpack/tests/php/bootstrap.php
index 4c9536a9cabfb..04e10fc5c6b02 100644
--- a/projects/plugins/jetpack/tests/php/bootstrap.php
+++ b/projects/plugins/jetpack/tests/php/bootstrap.php
@@ -141,10 +141,6 @@ function jetpack_full_sync_immediately_off( $modules ) {
require $test_root . '/includes/bootstrap.php';
-// Disable warning about deprecated request library.
-// @todo Remove this once we drop support for WordPress 6.1
-define( 'REQUESTS_SILENCE_PSR0_DEPRECATIONS', true );
-
// Load the shortcodes module to test properly.
if ( ! function_exists( 'shortcode_new_to_old_params' ) && ! in_running_uninstall_group() ) {
require __DIR__ . '/../../modules/shortcodes.php';
diff --git a/projects/plugins/migration/changelog/update-wp-61-backcompat-janitorial b/projects/plugins/migration/changelog/update-wp-61-backcompat-janitorial
new file mode 100644
index 0000000000000..de23d7843b671
--- /dev/null
+++ b/projects/plugins/migration/changelog/update-wp-61-backcompat-janitorial
@@ -0,0 +1,4 @@
+Significance: patch
+Type: changed
+
+General: remove WP 6.1 backwards compatibility checks
diff --git a/projects/plugins/migration/src/js/index.js b/projects/plugins/migration/src/js/index.js
index 15ed85e6cf956..338aa7ca02208 100644
--- a/projects/plugins/migration/src/js/index.js
+++ b/projects/plugins/migration/src/js/index.js
@@ -1,29 +1,24 @@
import { ThemeProvider } from '@automattic/jetpack-components';
-import * as WPElement from '@wordpress/element';
+import { render } from '@wordpress/element';
import React from 'react';
import AdminPage from './components/admin-page';
/**
* Initial render function.
*/
-function render() {
+function renderMigrationApp() {
const container = document.getElementById( 'wpcom-migration-root' );
if ( null === container ) {
return;
}
- // @todo: Remove fallback when we drop support for WP 6.1
- const component = (
+ render(
-
+ ,
+ container
);
- if ( WPElement.createRoot ) {
- WPElement.createRoot( container ).render( component );
- } else {
- WPElement.render( component, container );
- }
}
-render();
+renderMigrationApp();
diff --git a/projects/plugins/protect/changelog/update-wp-61-backcompat-janitorial b/projects/plugins/protect/changelog/update-wp-61-backcompat-janitorial
new file mode 100644
index 0000000000000..de23d7843b671
--- /dev/null
+++ b/projects/plugins/protect/changelog/update-wp-61-backcompat-janitorial
@@ -0,0 +1,4 @@
+Significance: patch
+Type: changed
+
+General: remove WP 6.1 backwards compatibility checks
diff --git a/projects/plugins/protect/src/js/index.js b/projects/plugins/protect/src/js/index.js
index 14379f827c303..0531d9ec10426 100644
--- a/projects/plugins/protect/src/js/index.js
+++ b/projects/plugins/protect/src/js/index.js
@@ -1,5 +1,5 @@
import { ThemeProvider } from '@automattic/jetpack-components';
-import * as WPElement from '@wordpress/element';
+import { render } from '@wordpress/element';
import React, { useEffect } from 'react';
import { HashRouter, Routes, Route, useLocation } from 'react-router-dom';
import FirewallPage from './components/firewall-page';
@@ -26,14 +26,13 @@ function ScrollToTop() {
/**
* Initial render function.
*/
-function render() {
+function renderProtectApp() {
const container = document.getElementById( 'jetpack-protect-root' );
if ( null === container ) {
return;
}
- // @todo: Remove fallback when we drop support for WP 6.1
const component = (
@@ -46,11 +45,7 @@ function render() {
);
- if ( WPElement.createRoot ) {
- WPElement.createRoot( container ).render( component );
- } else {
- WPElement.render( component, container );
- }
+ render( component, container );
}
-render();
+renderProtectApp();
diff --git a/projects/plugins/social/changelog/update-wp-61-backcompat-janitorial b/projects/plugins/social/changelog/update-wp-61-backcompat-janitorial
new file mode 100644
index 0000000000000..de23d7843b671
--- /dev/null
+++ b/projects/plugins/social/changelog/update-wp-61-backcompat-janitorial
@@ -0,0 +1,4 @@
+Significance: patch
+Type: changed
+
+General: remove WP 6.1 backwards compatibility checks
diff --git a/projects/plugins/social/src/js/index.js b/projects/plugins/social/src/js/index.js
index a74e2f8009c6f..cb2c3e6d1c41c 100644
--- a/projects/plugins/social/src/js/index.js
+++ b/projects/plugins/social/src/js/index.js
@@ -1,29 +1,24 @@
import { ThemeProvider } from '@automattic/jetpack-components';
-import * as WPElement from '@wordpress/element';
+import { render } from '@wordpress/element';
import React from 'react';
import AdminPage from './components/admin-page';
/**
* Initial render function.
*/
-function render() {
+function renderSocialApp() {
const container = document.getElementById( 'jetpack-social-root' );
if ( null === container ) {
return;
}
- // @todo: Remove fallback when we drop support for WP 6.1
- const component = (
+ render(
-
+ ,
+ container
);
- if ( WPElement.createRoot ) {
- WPElement.createRoot( container ).render( component );
- } else {
- WPElement.render( component, container );
- }
}
-render();
+renderSocialApp();
diff --git a/projects/plugins/starter-plugin/changelog/update-wp-61-backcompat-janitorial b/projects/plugins/starter-plugin/changelog/update-wp-61-backcompat-janitorial
new file mode 100644
index 0000000000000..de23d7843b671
--- /dev/null
+++ b/projects/plugins/starter-plugin/changelog/update-wp-61-backcompat-janitorial
@@ -0,0 +1,4 @@
+Significance: patch
+Type: changed
+
+General: remove WP 6.1 backwards compatibility checks
diff --git a/projects/plugins/starter-plugin/src/js/index.js b/projects/plugins/starter-plugin/src/js/index.js
index e31b6774eec84..4d74e399536fd 100644
--- a/projects/plugins/starter-plugin/src/js/index.js
+++ b/projects/plugins/starter-plugin/src/js/index.js
@@ -1,29 +1,24 @@
import { ThemeProvider } from '@automattic/jetpack-components';
-import * as WPElement from '@wordpress/element';
+import { render } from '@wordpress/element';
import React from 'react';
import AdminPage from './components/admin-page';
/**
* Initial render function.
*/
-function render() {
+function renderApp() {
const container = document.getElementById( 'jetpack-starter-plugin-root' );
if ( null === container ) {
return;
}
- // @todo: Remove fallback when we drop support for WP 6.1
- const component = (
+ render(
-
+ ,
+ container
);
- if ( WPElement.createRoot ) {
- WPElement.createRoot( container ).render( component );
- } else {
- WPElement.render( component, container );
- }
}
-render();
+renderApp();