Skip to content

Upgrade GutenbergKit from v0.11.1 to v0.15.2#22764

Merged
jkmassel merged 7 commits intotrunkfrom
jkmassel/gutenbergkit-settings-refactor
Apr 9, 2026
Merged

Upgrade GutenbergKit from v0.11.1 to v0.15.2#22764
jkmassel merged 7 commits intotrunkfrom
jkmassel/gutenbergkit-settings-refactor

Conversation

@jkmassel
Copy link
Copy Markdown
Contributor

@jkmassel jkmassel commented Apr 3, 2026

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 → use GutenbergView(configuration, dependencies, coroutineScope, context) constructor
  • gutenbergView.start(config) removed → EditorConfiguration provided at construction time
  • EditorConfiguration moved from org.wordpress.gutenberg to org.wordpress.gutenberg.model
  • EditorConfiguration.Builder() replaced with EditorConfiguration.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 full EditorConfiguration at fragment/view construction time.

The existing GutenbergKitSettingsBuilder with its config data classes is unchanged — refactoring that is a separate effort.

Test plan

  • Verify the GutenbergKit block editor opens correctly for new posts and existing posts
  • Verify editor loads for both WP.com and self-hosted sites with application passwords
  • Verify media insertion, undo/redo, and HTML mode toggle still work
  • Run ./gradlew :WordPress:testJetpackDebugUnitTest --tests "*GutenbergKit*" — all tests pass

@jkmassel jkmassel requested a review from a team as a code owner April 3, 2026 20:38
@jkmassel jkmassel requested review from adalpari and removed request for a team April 3, 2026 20:38
@dangermattic
Copy link
Copy Markdown
Collaborator

dangermattic commented Apr 3, 2026

1 Warning
⚠️ This PR is larger than 300 lines of changes. Please consider splitting it into smaller PRs for easier and faster reviews.

Generated by 🚫 Danger

@wpmobilebot
Copy link
Copy Markdown
Contributor

wpmobilebot commented Apr 3, 2026

Project dependencies changes

list
+ 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 (*)

@wpmobilebot
Copy link
Copy Markdown
Contributor

wpmobilebot commented Apr 3, 2026

App Icon📲 You can test the changes from this Pull Request in Jetpack Android by scanning the QR code below to install the corresponding build.

App NameJetpack Android
Build TypeDebug
Versionpr22764-7160570
Build Number1488
Application IDcom.jetpack.android.prealpha
Commit7160570
Installation URL4hds025mc7ch8
Automatticians: You can use our internal self-serve MC tool to give yourself access to those builds if needed.

@wpmobilebot
Copy link
Copy Markdown
Contributor

wpmobilebot commented Apr 3, 2026

App Icon📲 You can test the changes from this Pull Request in WordPress Android by scanning the QR code below to install the corresponding build.

App NameWordPress Android
Build TypeDebug
Versionpr22764-7160570
Build Number1488
Application IDorg.wordpress.android.prealpha
Commit7160570
Installation URL07qtshr5lr0r8
Automatticians: You can use our internal self-serve MC tool to give yourself access to those builds if needed.

@jkmassel jkmassel force-pushed the jkmassel/gutenbergkit-settings-refactor branch from d538543 to 865899d Compare April 3, 2026 21:25
@jkmassel jkmassel changed the title Refactor GutenbergKitSettingsBuilder and upgrade GutenbergKit to v0.15.0 Upgrade GutenbergKit from v0.11.1 to v0.15.0 Apr 3, 2026
@jkmassel jkmassel force-pushed the jkmassel/gutenbergkit-settings-refactor branch 3 times, most recently from e051e55 to f861ada Compare April 4, 2026 03:12
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.
@jkmassel jkmassel force-pushed the jkmassel/gutenbergkit-settings-refactor branch from f861ada to 6cfa2a2 Compare April 4, 2026 03:47
@jkmassel jkmassel added Gutenberg Editing and display of Gutenberg blocks. Posting/Editing [Type] Task labels Apr 4, 2026
@jkmassel jkmassel added this to the 26.8 milestone Apr 4, 2026
@codecov
Copy link
Copy Markdown

codecov bot commented Apr 4, 2026

Codecov Report

❌ Patch coverage is 12.50000% with 42 lines in your changes missing coverage. Please review.
✅ Project coverage is 37.40%. Comparing base (8c0b6d4) to head (7160570).
⚠️ Report is 13 commits behind head on trunk.

Files with missing lines Patch % Lines
...ess/android/ui/posts/EditorConfigurationBuilder.kt 0.00% 37 Missing ⚠️
...press/android/ui/posts/GutenbergKitWarmupHelper.kt 0.00% 3 Missing ⚠️
...ss/android/ui/posts/GutenbergKitSettingsBuilder.kt 75.00% 2 Missing ⚠️
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.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@jkmassel jkmassel marked this pull request as draft April 6, 2026 04:31
@jkmassel jkmassel removed the request for review from adalpari April 6, 2026 04:32
dcalhoun added 2 commits April 8, 2026 10:40
* 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.
@jkmassel jkmassel marked this pull request as ready for review April 8, 2026 20:47
@dcalhoun
Copy link
Copy Markdown
Member

dcalhoun commented Apr 9, 2026

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 rest_post_invalid_id: Invalid post ID. error. At this point, you cannot exit the editor and must quit the app.

Pages error screen recording

Screen_Recording_20260409_113005_Jetpack.Debug.mp4

Copy link
Copy Markdown
Member

@dcalhoun dcalhoun left a comment

Choose a reason for hiding this comment

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

Code changes look good overall.

I note two issues we should solve:

  1. Failure loading existing pages - this appears addressed in GBK trunk, I'll publish a release and integrate in to this PR
  2. @mentions lack prefix character and empty block contents - I'll open a fix in GBK and include it in the aforementioned release

* 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>
@dcalhoun dcalhoun changed the title Upgrade GutenbergKit from v0.11.1 to v0.15.0 Upgrade GutenbergKit from v0.11.1 to v0.15.2 Apr 9, 2026
jkmassel added 3 commits April 9, 2026 12:35
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.
Copy link
Copy Markdown
Member

@dcalhoun dcalhoun left a comment

Choose a reason for hiding this comment

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

Latest changes tested well for me. Previous reported issues no longer occur. 🚀

@jkmassel jkmassel enabled auto-merge (squash) April 9, 2026 19:05
@jkmassel jkmassel merged commit 7b391e8 into trunk Apr 9, 2026
19 of 20 checks passed
@jkmassel jkmassel deleted the jkmassel/gutenbergkit-settings-refactor branch April 9, 2026 19:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Gutenberg Editing and display of Gutenberg blocks. Posting/Editing [Type] Task

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants