Skip to content

Move WordPressData to the Modules package#25631

Open
crazytonyli wants to merge 13 commits into
trunkfrom
task/move-wordpress-data-as-module
Open

Move WordPressData to the Modules package#25631
crazytonyli wants to merge 13 commits into
trunkfrom
task/move-wordpress-data-as-module

Conversation

@crazytonyli

@crazytonyli crazytonyli commented Jun 9, 2026

Copy link
Copy Markdown
Contributor

Note

I recommend reviewing this PR commit by commit. The changes are mostly moving code. The real code changes are pretty small.

Description

Mixing an Xcode framework target with SwiftPM modules duplicates symbols across binaries: WordPressData's package dependencies (WordPressKit, WordPressShared, etc.) were statically linked into both WordPressData.framework and the app binary, which can cause the "Class is implemented in both" runtime issues. This PR moves WordPressData into the Modules package so it's statically linked once, like every other module.

Main changes:

  1. WordPressData and WordPressDataTests are now package targets in Modules/Package.swift. The Xcode targets and the XcodeTarget_WordPressData* shims are deleted, and the WordPressData scheme points at the package, so the CI setup is unchanged.
  2. WordPress.xcdatamodeld is now a package resource, and Bundle.wordPressData resolves to Bundle.module.
  3. The bridging header needs the generated module map to resolve @import WordPressData;, added to OTHER_SWIFT_FLAGS in Common.xcconfig using the same mechanism as the existing WordPressKit entries.

Testing instructions

The biggest regression risk is Core Data store loading and migration at startup, since the compiled model moved into the package resource bundle. I verified both upgrade paths in the simulator: installing the trunk build over this branch's build keeps the existing store (same file, data intact), and upgrading from 26.7 (data model 157) runs the migration to 158 successfully with drafts preserved.

@dangermattic

Copy link
Copy Markdown
Collaborator
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.
.

⚠️ View files have been modified, but no screenshot or video is included in the pull request. Consider adding some for clarity.
⚠️ This PR is larger than 500 lines of changes. Please consider splitting it into smaller PRs for easier and faster reviews.
1 Message
📖 This PR is still a Draft: some checks will be skipped.

Generated by 🚫 Danger

@wpmobilebot

wpmobilebot commented Jun 9, 2026

Copy link
Copy Markdown
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 Number32574
VersionPR #25631
Bundle IDorg.wordpress.alpha
Commitcd78310
Installation URL5cvb6c1gr841g
Automatticians: You can use our internal self-serve MC tool to give yourself access to those builds if needed.

@wpmobilebot

wpmobilebot commented Jun 9, 2026

Copy link
Copy Markdown
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 Number32574
VersionPR #25631
Bundle IDcom.jetpack.alpha
Commitcd78310
Installation URL1mug6g7sfdfp8
Automatticians: You can use our internal self-serve MC tool to give yourself access to those builds if needed.

When WordPressData was a dynamic framework, importing it implicitly
exposed WordPressKit types to targets without a bridging header (the
Keystone framework compile path). The Swift package module does not
re-export its dependencies, so files using WordPressKit types need the
explicit import.
Same implicit-visibility issue as the previous commit: these files use
WordPressKit types but relied on the WordPressData framework exposing
them transitively in the Keystone build. Found by sweeping app sources
for WordPressKit type usage without an import, since the local Keystone
build halts on a pre-existing Xcode 26.5 issue before reaching them.
…iftLint

swift-format moves the opening brace to its own line when a long
signature stays on one line, which violates SwiftLint's opening_brace
rule. Multi-line parameter lists keep both tools happy.
@crazytonyli crazytonyli force-pushed the task/move-wordpress-data-as-module branch from 1f2c04f to cd78310 Compare June 12, 2026 02:17
@crazytonyli crazytonyli requested a review from jkmassel June 12, 2026 02:53
@crazytonyli crazytonyli added this to the 27.0 milestone Jun 12, 2026
@crazytonyli crazytonyli marked this pull request as ready for review June 12, 2026 02:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants