Upgrade GutenbergKit from v0.11.1 to v0.15.2#22764
Conversation
Generated by 🚫 Danger |
Project dependencies changeslist+ New Dependencies
org.jetbrains.kotlinx:kotlinx-serialization-json:1.7.3
org.jetbrains.kotlinx:kotlinx-serialization-json-jvm:1.7.3
! Upgraded Dependencies
org.wordpress.gutenbergkit:android:v0.15.2, (changed from v0.11.1)tree++--- androidx.navigation:navigation-compose:2.9.7
+| \--- androidx.navigation:navigation-compose-android:2.9.7
+| \--- androidx.activity:activity:1.8.0 -> 1.10.1
+| \--- androidx.lifecycle:lifecycle-viewmodel-savedstate:2.6.1 -> 2.10.0
+| \--- androidx.lifecycle:lifecycle-viewmodel-savedstate-android:2.10.0
+| \--- androidx.savedstate:savedstate:1.4.0
+| \--- androidx.savedstate:savedstate-android:1.4.0
+| \--- org.jetbrains.kotlinx:kotlinx-serialization-core:1.7.3
+| \--- org.jetbrains.kotlinx:kotlinx-serialization-core-jvm:1.7.3
+| \--- org.jetbrains.kotlinx:kotlinx-serialization-bom:1.7.3
+| +--- org.jetbrains.kotlinx:kotlinx-serialization-json-jvm:1.7.3 (c)
+| \--- org.jetbrains.kotlinx:kotlinx-serialization-json:1.7.3 (c)
+--- project :libs:editor
-| \--- org.wordpress.gutenbergkit:android:v0.11.1
-| +--- org.jetbrains.kotlin:kotlin-parcelize-runtime:2.0.21 -> 2.3.20 (*)
-| +--- androidx.core:core-ktx:1.13.1 -> 1.16.0 (*)
-| +--- androidx.appcompat:appcompat:1.7.0 -> 1.7.1 (*)
-| +--- com.google.android.material:material:1.12.0 (*)
-| +--- androidx.webkit:webkit:1.11.0 -> 1.15.0 (*)
-| +--- com.google.code.gson:gson:2.8.9 -> 2.13.2
-| | \--- com.google.errorprone:error_prone_annotations:2.41.0
-| +--- org.jetbrains.kotlinx:kotlinx-coroutines-android:1.10.2 (*)
-| \--- org.jetbrains.kotlin:kotlin-stdlib:2.0.21 -> 2.3.20 (*)
+| \--- org.wordpress.gutenbergkit:android:v0.15.2
+| +--- org.jetbrains.kotlin:kotlin-parcelize-runtime:2.1.21 -> 2.3.20 (*)
+| +--- androidx.core:core-ktx:1.13.1 -> 1.16.0 (*)
+| +--- androidx.appcompat:appcompat:1.7.0 -> 1.7.1 (*)
+| +--- com.google.android.material:material:1.12.0 (*)
+| +--- androidx.webkit:webkit:1.11.0 -> 1.15.0 (*)
+| +--- com.google.code.gson:gson:2.8.9 -> 2.13.2
+| | \--- com.google.errorprone:error_prone_annotations:2.41.0
+| +--- org.jetbrains.kotlinx:kotlinx-coroutines-android:1.10.2 (*)
+| +--- org.jetbrains.kotlinx:kotlinx-serialization-json:1.7.3
+| | \--- org.jetbrains.kotlinx:kotlinx-serialization-json-jvm:1.7.3
+| | +--- org.jetbrains.kotlinx:kotlinx-serialization-bom:1.7.3 (*)
+| | +--- org.jetbrains.kotlin:kotlin-stdlib:2.0.20 -> 2.3.20 (*)
+| | \--- org.jetbrains.kotlinx:kotlinx-serialization-core:1.7.3 (*)
+| +--- org.jsoup:jsoup:1.18.1 -> 1.22.1
+| +--- com.squareup.okhttp3:okhttp:4.12.0 -> 5.3.2 (*)
+| \--- org.jetbrains.kotlin:kotlin-stdlib:2.1.21 -> 2.3.20 (*)
-\--- org.wordpress.gutenbergkit:android:v0.11.1 (*)
+\--- org.wordpress.gutenbergkit:android:v0.15.2 (*) |
|
|
|
|
d538543 to
865899d
Compare
e051e55 to
f861ada
Compare
Adapt to breaking API changes in GutenbergKit v0.15.0: - GutenbergView.createForEditor() removed: use GutenbergView constructor with configuration, dependencies, coroutineScope, and context parameters - gutenbergView.start(config) removed: EditorConfiguration must be provided at construction time - EditorConfiguration moved from org.wordpress.gutenberg to org.wordpress.gutenberg.model - EditorConfiguration.Builder() replaced with EditorConfiguration.builder(siteURL, siteApiRoot, postType) - setPostId(Int?) changed to setPostId(UInt?) - GutenbergView.warmup() removed: warmup helper is now a no-op The fragment's two-phase flow (create view now, start with editor settings later) is replaced by providing the full EditorConfiguration at fragment/view construction time.
f861ada to
6cfa2a2
Compare
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## trunk #22764 +/- ##
=======================================
Coverage 37.40% 37.40%
=======================================
Files 2320 2320
Lines 123674 123661 -13
Branches 16791 16795 +4
=======================================
+ Hits 46256 46260 +4
+ Misses 73707 73690 -17
Partials 3711 3711 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
* feat: Send GutenbergKit the latest content when requested Allow GutenbergKit to retrieve the latest content persisted in the host app as needed. This is important for allowing GutenbergKit to display the latest content after the WebView reloads or re-initializes from memory pressure or backgrounding. * feat: Set GutenbergKit post status * build: Update GutenbergKit version Integrate an unrelated content loss fix that is necessary for testing this branch's focus on content preservation.
|
Beginning code review now, noting my testing results with one issue observed. Testing went well for me. I tested various aspects of the block editor—text editing, undo/redo, media uploads, various block types. I test Simple, WoW, and self-hosted sites. I tested new and existing entires, both posts and pages. I encountered one issue where existing pages do not load but display a Pages error screen recording
Screen_Recording_20260409_113005_Jetpack.Debug.mp4 |
dcalhoun
left a comment
There was a problem hiding this comment.
Code changes look good overall.
I note two issues we should solve:
- Failure loading existing pages - this appears addressed in GBK trunk, I'll publish a release and integrate in to this PR
@mentionslack prefix character and empty block contents - I'll open a fix in GBK and include it in the aforementioned release
WordPress/src/main/java/org/wordpress/android/ui/posts/EditorConfigurationBuilder.kt
Show resolved
Hide resolved
WordPress/src/main/java/org/wordpress/android/ui/posts/editor/GutenbergKitEditorFragment.kt
Show resolved
Hide resolved
WordPress/src/main/java/org/wordpress/android/ui/posts/editor/GutenbergKitEditorFragment.kt
Show resolved
Hide resolved
* build: Integrate GutenbergKit PostTypeDetails API changes Update GutenbergKit to version 446-e44fddffa326f38a3551a5bde9529b060e667a2c and migrate from String-based postType to PostTypeDetails, which encapsulates REST API namespace and base path for different post types. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> * build: Update GutenbergKit to v0.15.2 --------- Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Re-add section-organizing and explanatory comments that were accidentally dropped in the API migration. Only comments whose described code still exists are restored.
Re-add the method documentation that was removed during the GutenbergKit v0.15.0 upgrade, minus the stale @param editorSettings that no longer exists.
…itor getContent() was returning an empty string after the v0.15.0 upgrade. Delegate to getTitleAndContent() and return the content portion so callers get the actual editor content.
dcalhoun
left a comment
There was a problem hiding this comment.
Latest changes tested well for me. Previous reported issues no longer occur. 🚀


Summary
Minimal upgrade of GutenbergKit from v0.11.1 to v0.15.0, adapting to breaking API changes without additional refactoring.
Breaking changes addressed:
GutenbergView.createForEditor()removed → useGutenbergView(configuration, dependencies, coroutineScope, context)constructorgutenbergView.start(config)removed →EditorConfigurationprovided at construction timeEditorConfigurationmoved fromorg.wordpress.gutenbergtoorg.wordpress.gutenberg.modelEditorConfiguration.Builder()replaced withEditorConfiguration.builder(siteURL, siteApiRoot, postType)(required params)setPostId(Int?)→setPostId(UInt?)GutenbergView.warmup()removed → warmup helper is now a no-op (to be reimplemented separately)The fragment's two-phase flow (create view now, start with editor settings later via
onEditorSettingsChanged) is replaced by providing the fullEditorConfigurationat fragment/view construction time.The existing
GutenbergKitSettingsBuilderwith its config data classes is unchanged — refactoring that is a separate effort.Test plan
./gradlew :WordPress:testJetpackDebugUnitTest --tests "*GutenbergKit*"— all tests pass