Skip to content

refactor: Use GutenbergKit configuration builder #24662

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

Draft
wants to merge 1 commit into
base: trunk
Choose a base branch
from

Conversation

dcalhoun
Copy link
Member

@dcalhoun dcalhoun commented Jul 9, 2025

Description

Adopt the latest patterns for embracing immutable configuration introduced in wordpress-mobile/GutenbergKit#146.

Testing instructions

Smoke test editor functionality dependent upon configuration—theme styles, media uploads, remote editor (plugins), etc.

Adopt the latest patterns to embrace immutable configuration.
@dcalhoun dcalhoun added [Type] Task Gutenberg Editing and display of Gutenberg blocks. labels Jul 9, 2025
@dangermattic
Copy link
Collaborator

1 Message
📖 This PR is still a Draft: some checks will be skipped.

Generated by 🚫 Danger

Copy link

sonarqubecloud bot commented Jul 9, 2025

Comment on lines +335 to +340
// TODO: `setEditorSettings` throws due to incompatibility between `[String: Any]`
// and `[String: Encodable]`. The latter is now expected by
// `GutenbergKitConfiguration.EditorSettings`. How should we reconcile this?
let updatedConfig = self.editorViewController.configuration.toBuilder()
.setEditorSettings(settings)
.build()
Copy link
Member Author

@dcalhoun dcalhoun Jul 9, 2025

Choose a reason for hiding this comment

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

@crazytonyli would you please help me determine a reasonable approach for managing type safety of fetching editor settings from the API endpoint and passing it to GutenbergKit?

GutenbergKit was updated in wordpress-mobile/GutenbergKit#146 to now expect [String: Encodable] rather than [String: Any]. This seems like a sound change, but my lack of Swift experience inhibits me from determining an appropriate solution for the logic here in WP-iOS.

Please feel free to push directly to this branch if that is easiest. Thank you!

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. [Type] Task
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants