Skip to content

Remove WordPressKitObjCUtils#25400

Merged
kean merged 10 commits intotrunkfrom
task/remove-wpkit-objc-utils
Mar 18, 2026
Merged

Remove WordPressKitObjCUtils#25400
kean merged 10 commits intotrunkfrom
task/remove-wpkit-objc-utils

Conversation

@kean
Copy link
Contributor

@kean kean commented Mar 18, 2026

This change is a prerequisite for #25392. I need to use GutenbergExcerptGenerator from WordPressShared in WordPressKitModels. Unfortunately, it results in multiple ObjC-related compiler errors like these:

Both WordPressSharedObjC and WordPressKitObjC have a public header named WPMapFilterReduce.h. Now that WordPressKitObjC transitively depends on WordPressSharedObjC (via WordPressKitModels → WordPressShared → WordPressSharedObjC), the compiler resolves #import "WPMapFilterReduce.h" to WordPressSharedObjC's version — which defines WPMapBlock/WPFilterBlock but not WPKitMapBlock/WPKitFilterBlock.

Changes

  • Add WordPressShared dependency to WordPressKitModels and WordPressKitObjC
  • Remove WordPressKitObjCUtils
  • Update WordPressKit to use APIs from WordPressShared instead of the ones that were removed
  • Add explicit WordPressKit target to Package.swift so it would auto-create a scheme

@dangermattic
Copy link
Collaborator

dangermattic commented Mar 18, 2026

3 Warnings
⚠️ Modules/Package.swift was changed without updating its corresponding Package.resolved.

If the change includes adding, removing, or editing a dependency please resolve the Swift packages as appropriate to your project setup (e.g. in Xcode or by running swift package resolve).

If the change to the Package.swift did not modify dependencies, ignoring this warning should be safe, but we recommend double checking and running the package resolution just in case.
.

⚠️ This PR is larger than 500 lines of changes. Please consider splitting it into smaller PRs for easier and faster reviews.
⚠️ This PR is assigned to the milestone 26.8. This milestone is due in less than 4 days.
Please make sure to get it merged by then or assign it to a milestone with a later deadline.

Generated by 🚫 Danger

@sonarqubecloud
Copy link

@wpmobilebot
Copy link
Contributor

App Icon📲 You can test the changes from this Pull Request in WordPress by scanning the QR code below to install the corresponding build.
App NameWordPress
ConfigurationRelease-Alpha
Build Number31561
VersionPR #25400
Bundle IDorg.wordpress.alpha
Commite7babf9
Installation URL57v9f9kc85ilg
Automatticians: You can use our internal self-serve MC tool to give yourself access to those builds if needed.

@wpmobilebot
Copy link
Contributor

App Icon📲 You can test the changes from this Pull Request in Jetpack by scanning the QR code below to install the corresponding build.
App NameJetpack
ConfigurationRelease-Alpha
Build Number31561
VersionPR #25400
Bundle IDcom.jetpack.alpha
Commite7babf9
Installation URL67bnl1638lr8o
Automatticians: You can use our internal self-serve MC tool to give yourself access to those builds if needed.

@wpmobilebot
Copy link
Contributor

🤖 Build Failure Analysis

This build has failures. Claude has analyzed them - check the build annotations for details.

// See https://forums.swift.org/t/swift-cant-see-objc-methods-that-include-package-symbols/65732/9
// Without this flag, Objective-C APIs that contains Swift types in WordPressKit will not be available
// to Swift code in the app target.
OTHER_SWIFT_FLAGS = $(inherited) -Xcc "-fmodule-map-file=${OBJROOT}/GeneratedModuleMaps-${PLATFORM_NAME}/WordPressKit.modulemap" -Xcc "-fmodule-map-file=${OBJROOT}/GeneratedModuleMaps-${PLATFORM_NAME}/WordPressKitModels.modulemap" -Xcc "-fmodule-map-file=${OBJROOT}/GeneratedModuleMaps-${PLATFORM_NAME}/WordPressKitObjC.modulemap" -Xcc "-fmodule-map-file=${OBJROOT}/GeneratedModuleMaps-${PLATFORM_NAME}/WordPressKitObjCUtils.modulemap"
Copy link
Contributor Author

Choose a reason for hiding this comment

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

These may no longer be needed. Will look into removing it in separate PRs.

@kean kean added the General label Mar 18, 2026
@kean kean added this to the 26.8 milestone Mar 18, 2026
@kean kean enabled auto-merge March 18, 2026 14:31
@kean kean requested review from crazytonyli and jkmassel March 18, 2026 14:31
@crazytonyli
Copy link
Contributor

What do you think about moving or duplicating GutenbergExcerptGenerator in WPKit? I'm not sure we should reverse the dependency between WPShared and WPKit.

@kean
Copy link
Contributor Author

kean commented Mar 18, 2026

What do you think about moving or duplicating GutenbergExcerptGenerator in WPKit? I'm not sure we should reverse the dependency between WPShared and WPKit.

To add some context, WordPressKit originally had a dependency on WordPressShared. When WordPressShared was moved into wpios, we duplicated its code within WordPressKit as a practical workaround. Now that both modules live in the same repo again, it seems like a good opportunity to remove that duplication and restore the original dependency.

To address the concern - WordPressShared doesn't depend on WordPressKit. It's a small, low-level module that many other modules already rely on, so this would align with the existing dependency direction. Hope that clarifies things. Please, let me know if you have other concerns.

@kean kean added this pull request to the merge queue Mar 18, 2026
Merged via the queue into trunk with commit 6d9daff Mar 18, 2026
30 checks passed
@kean kean deleted the task/remove-wpkit-objc-utils branch March 18, 2026 23:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants