From 0f2b7aa56aa1cc189d576df4bf1e11cb060553d7 Mon Sep 17 00:00:00 2001 From: David Calhoun Date: Sun, 24 Aug 2025 08:08:06 -0400 Subject: [PATCH 1/3] refactor: Remove unused Jetpack global configuration This configuration is now unnecessary, as the relevant globals were replaced with new globals. The new globals are set via remote JavaScript loaded into the WebView rather than manually setting the globals via GutenbergKit configuration. - Removal: https://github.com/Automattic/jetpack/pull/44133 - New globals: https://github.com/Automattic/jetpack/pull/44077 --- .../android/ui/posts/GutenbergKitActivity.kt | 12 ------------ .../ui/posts/editor/GutenbergKitEditorFragment.kt | 5 ----- 2 files changed, 17 deletions(-) diff --git a/WordPress/src/main/java/org/wordpress/android/ui/posts/GutenbergKitActivity.kt b/WordPress/src/main/java/org/wordpress/android/ui/posts/GutenbergKitActivity.kt index 517fd5ac317f..041b47e61ad7 100644 --- a/WordPress/src/main/java/org/wordpress/android/ui/posts/GutenbergKitActivity.kt +++ b/WordPress/src/main/java/org/wordpress/android/ui/posts/GutenbergKitActivity.kt @@ -233,8 +233,6 @@ import org.wordpress.android.widgets.WPSnackbar.Companion.make import org.wordpress.android.widgets.WPViewPager import org.wordpress.gutenberg.GutenbergJsException import org.wordpress.gutenberg.GutenbergView -import org.wordpress.gutenberg.WebViewGlobal -import org.wordpress.gutenberg.WebViewGlobalValue import java.io.File import java.util.regex.Matcher import java.util.regex.Pattern @@ -2341,16 +2339,6 @@ class GutenbergKitActivity : BaseAppCompatActivity(), EditorFragmentActivity, Ed "plugins" to shouldUsePlugins(applicationPassword), "locale" to wpcomLocaleSlug, "cookies" to editPostAuthViewModel.getCookiesForPrivateSites(site, privateAtomicCookie), - "webViewGlobals" to listOf( - WebViewGlobal( - "_currentSiteType", - when { - siteModel.isWPComAtomic -> WebViewGlobalValue.StringValue("atomic") - siteModel.isWPCom -> WebViewGlobalValue.StringValue("simple") - else -> WebViewGlobalValue.NullValue - } - ) - ) ) } diff --git a/WordPress/src/main/java/org/wordpress/android/ui/posts/editor/GutenbergKitEditorFragment.kt b/WordPress/src/main/java/org/wordpress/android/ui/posts/editor/GutenbergKitEditorFragment.kt index af53e2c13645..12e6831e5f93 100644 --- a/WordPress/src/main/java/org/wordpress/android/ui/posts/editor/GutenbergKitEditorFragment.kt +++ b/WordPress/src/main/java/org/wordpress/android/ui/posts/editor/GutenbergKitEditorFragment.kt @@ -42,7 +42,6 @@ import org.wordpress.gutenberg.GutenbergView.TitleAndContentCallback import org.wordpress.gutenberg.GutenbergWebViewPool.getPreloadedWebView import org.wordpress.gutenberg.GutenbergWebViewPool.recycleWebView import org.wordpress.gutenberg.Media -import org.wordpress.gutenberg.WebViewGlobal import java.io.Serializable import java.util.concurrent.CountDownLatch @@ -238,8 +237,6 @@ class GutenbergKitEditorFragment : GutenbergKitEditorFragmentBase() { private fun Map.getStringArray(key: String): Array = getSetting>(key)?.asSequence()?.filterNotNull()?.toList()?.toTypedArray() ?: emptyArray() - private fun Map.getWebViewGlobals(key: String): List = - getSetting>(key) ?: emptyList() // View extension functions private fun View?.setVisibleOrGone(visible: Boolean) { @@ -441,7 +438,6 @@ class GutenbergKitEditorFragment : GutenbergKitEditorFragmentBase() { val editorAssetsEndpoint = "${siteApiRoot}wpcom/v2/${firstNamespace}editor-assets" val cookies = getSetting>("cookies") ?: emptyMap() val namespaceExcludedPaths = getStringArray("namespaceExcludedPaths") - val webViewGlobals = getWebViewGlobals("webViewGlobals") EditorConfiguration.Builder() .setTitle(getSetting("postTitle") ?: "") @@ -454,7 +450,6 @@ class GutenbergKitEditorFragment : GutenbergKitEditorFragmentBase() { .setSiteApiNamespace(siteApiNamespace) .setNamespaceExcludedPaths(namespaceExcludedPaths) .setAuthHeader(getSetting("authHeader") ?: "") - .setWebViewGlobals(webViewGlobals) .setEditorSettings(editorSettings) .setLocale(getSetting("locale")) .setEditorAssetsEndpoint(editorAssetsEndpoint) From 5abe00491d4644866ae66cfba00979b784789068 Mon Sep 17 00:00:00 2001 From: David Calhoun Date: Mon, 25 Aug 2025 10:18:14 -0400 Subject: [PATCH 2/3] build: Update GutenbergKit version --- gradle/libs.versions.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gradle/libs.versions.toml b/gradle/libs.versions.toml index 44fc1a418f7b..26eccbc7310f 100644 --- a/gradle/libs.versions.toml +++ b/gradle/libs.versions.toml @@ -73,7 +73,7 @@ google-play-services-auth = '20.4.1' google-services = '4.4.3' gravatar = '2.5.0' greenrobot-eventbus = '3.3.1' -gutenberg-kit = 'v0.8.0-alpha.0' +gutenberg-kit = '172-960519724e853ba705a6c6f87897ed597e602f50' gutenberg-mobile = 'v1.121.0' indexos-media-for-mobile = '43a9026f0973a2f0a74fa813132f6a16f7499c3a' jackson-databind = '2.12.7.1' From 59e4ba43e94c3feb4d41faabecc9003b89b3902e Mon Sep 17 00:00:00 2001 From: David Calhoun Date: Mon, 25 Aug 2025 16:59:16 -0400 Subject: [PATCH 3/3] build: Upgrade GutenbergKit version --- gradle/libs.versions.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gradle/libs.versions.toml b/gradle/libs.versions.toml index 26eccbc7310f..77d4d0210e17 100644 --- a/gradle/libs.versions.toml +++ b/gradle/libs.versions.toml @@ -73,7 +73,7 @@ google-play-services-auth = '20.4.1' google-services = '4.4.3' gravatar = '2.5.0' greenrobot-eventbus = '3.3.1' -gutenberg-kit = '172-960519724e853ba705a6c6f87897ed597e602f50' +gutenberg-kit = 'v0.8.0-alpha.2' gutenberg-mobile = 'v1.121.0' indexos-media-for-mobile = '43a9026f0973a2f0a74fa813132f6a16f7499c3a' jackson-databind = '2.12.7.1'