Skip to content

feat: Align CocoaPods ObjC module name and kit imports#728

Closed
denischilik wants to merge 14 commits intomainfrom
feat/support_cocopods
Closed

feat: Align CocoaPods ObjC module name and kit imports#728
denischilik wants to merge 14 commits intomainfrom
feat/support_cocopods

Conversation

@denischilik
Copy link
Copy Markdown
Contributor

Summary

  • Set mParticle-Apple-SDK pod module_name to mParticle_Apple_SDK_ObjC and mParticle-Apple-SDK-Umbrella to mParticle_Apple_SDK for consistency with SPM product naming.
  • Replace __has_include / bracket imports of mParticle_Apple_SDK/mParticle.h with @import mParticle_Apple_SDK_ObjC; across kit public headers, implementation files, tests, and Obj-C SPM examples.

Testing

  • trunk check (pre-push hook) passed on pushed commit.

Made with Cursor

- Set mParticle-Apple-SDK pod module_name to mParticle_Apple_SDK_ObjC and
  mParticle-Apple-SDK-Umbrella to mParticle_Apple_SDK.
- Replace __has_include mParticle_Apple_SDK/mParticle.h blocks with
  @import mParticle_Apple_SDK_ObjC in kit headers, sources, tests, and
  Obj-C SPM examples.

Made-with: Cursor
@denischilik denischilik requested a review from a team as a code owner April 8, 2026 18:48
@cursor
Copy link
Copy Markdown

cursor bot commented Apr 8, 2026

PR Summary

Medium Risk
Renames the CocoaPods module for the core ObjC SDK and updates many kit headers/examples to match, which can break downstream imports or kit builds if any module names or include paths are missed. Also changes release/publish automation and pod linting to publish an additional pod, so CI/release workflows could fail if ordering or dependency constraints are wrong.

Overview
Aligns CocoaPods module naming with SPM products by changing the mParticle-Apple-SDK pod module_name to mParticle_Apple_SDK_ObjC and updating kits/tests/SPM ObjC examples to import the SDK via @import mParticle_Apple_SDK_ObjC; / #import <mParticle_Apple_SDK.h> instead of __has_include-based header paths.

Introduces a new CocoaPods spec mParticle-Apple-SDK-Umbrella.podspec (Swift-only umbrella sources, module mParticle_Apple_SDK) and updates CI/release workflows to lint/include it, bump its version during kit lint, and publish pods in dependency order (Swift → ObjC → umbrella).

Reviewed by Cursor Bugbot for commit b1c007e. Bugbot is set up for automated code reviews on this repo. Configure here.

@denischilik denischilik changed the title Align CocoaPods ObjC module name and kit imports feat: Align CocoaPods ObjC module name and kit imports Apr 8, 2026
@github-actions
Copy link
Copy Markdown

github-actions bot commented Apr 8, 2026

📦 SDK Size Impact Report

Measures how much the SDK adds to an app's size (with-SDK minus without-SDK).

Metric Target Branch This PR Change
App Bundle Impact 1.75 MB 1.75 MB +N/A
Executable Impact 848 bytes 848 bytes +N/A
XCFramework Size 6.38 MB 6.38 MB +N/A

➡️ SDK size impact change is minimal.

Raw measurements

Target branch (main):

{"baseline_app_size_kb":84,"baseline_executable_size_bytes":75464,"with_sdk_app_size_kb":1880,"with_sdk_executable_size_bytes":76312,"sdk_impact_kb":1796,"sdk_executable_impact_bytes":848,"xcframework_size_kb":6532}

This PR:

{"baseline_app_size_kb":84,"baseline_executable_size_bytes":75464,"with_sdk_app_size_kb":1880,"with_sdk_executable_size_bytes":76312,"sdk_impact_kb":1796,"sdk_executable_impact_bytes":848,"xcframework_size_kb":6532}

@nickolas-dimitrakas
Copy link
Copy Markdown
Contributor

nickolas-dimitrakas commented Apr 8, 2026

I would also add the umbrella podspec to the build-kits.yml workflow as well. And it needs to be added to the release-draft.yml array

Set CLANG_ENABLE_MODULES on mParticle-Apptimize and mParticle-Adobe project
configs. Replace @import mParticle_Apple_SDK_ObjC in kit public headers with
explicit umbrella imports so builds succeed when modules are disabled or for
Firebase/GA4 kits that need mParticle_Apple_SDK.h.

Made-with: Cursor
Revert bracket imports; keep using the ObjC module import with Clang modules
enabled where configured (e.g. Apptimize, Adobe Xcode projects).

Made-with: Cursor
@@ -1,5 +1,5 @@
#import "AppDelegate.h"
@import mParticle_Apple_SDK;
#import <mParticle_Apple_SDK.h>
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

SPM examples use unreliable bare header import

Medium Severity

All SPM ObjC example apps changed from @import mParticle_Apple_SDK; (a proper Clang module import) to #import <mParticle_Apple_SDK.h> (a bare header import). In SPM, public headers from ObjC targets are namespaced under the module name (mParticle_Apple_SDK_ObjC), so a bare #import <mParticle_Apple_SDK.h> without the module prefix may not resolve in the header search paths. These examples are built in CI via build-kits.yml. The previous @import mParticle_Apple_SDK; or @import mParticle_Apple_SDK_ObjC; are the reliable approaches for SPM consumers.

Additional Locations (2)
Fix in Cursor Fix in Web

Reviewed by Cursor Bugbot for commit 41a1722. Configure here.

Copy link
Copy Markdown

@cursor cursor bot left a comment

Choose a reason for hiding this comment

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

Cursor Bugbot has reviewed your changes and found 1 potential issue.

There are 3 total unresolved issues (including 2 from previous reviews).

Fix All in Cursor

❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, have a team admin enable autofix in the Cursor dashboard.

Reviewed by Cursor Bugbot for commit 1a27d2e. Configure here.

#import "mParticle.h"
#import "mParticle_Apple_SDK.h"
#endif
#import "mParticle.h"
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Firebase kit headers inconsistently skip module import

Medium Severity

These four Firebase kit public headers use #import "mParticle.h" while every other kit in this PR was updated to use @import mParticle_Apple_SDK_ObjC;. The quote-style import in a public header is fragile — it depends on the consumer's header search path configuration rather than the module system. All four Firebase/Firebase GA4 kit headers (versions 11 and 12) have this same inconsistency.

Additional Locations (2)
Fix in Cursor Fix in Web

Reviewed by Cursor Bugbot for commit 1a27d2e. Configure here.

@BrandonStalnaker
Copy link
Copy Markdown
Collaborator

this is part 1, part 2 here #733

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants