Repository navigation
chore(react-native-plugin): leave out posthog-ios's Surveys trait - #5238
Closed
turnipdabeets wants to merge 1 commit into
Closed
turnipdabeets wants to merge 1 commit into
turnipdabeets wants to merge 1 commit into
Conversation
Surveys are rendered in JS; traits need swift-tools 6.1+, and posthog-ios 4.0 already requires Xcode 26.
This was referenced Oct 7, 2026
turnipdabeets
marked this pull request as ready for review
October 7, 2026 20:10
dustinbyrne
approved these changes
Oct 7, 2026
Contributor
Author
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
posthog-ios 4.0 adds Swift package traits so apps can leave out features they don't use (PostHog/posthog-ios#916 for
SessionReplayandCrashReporting, PostHog/posthog-ios#918 forSurveys). All three are on by default.The plugin never uses posthog-ios's native surveys: it sets
config.surveys = false, and React Native surveys are rendered in JS. Today every React Native app still compiles and ships them.Optional, and only if the traits land in posthog-ios 4.0. Stacked on #5237 (the 4.0 pin). If #916/#918 don't ship, close this: naming traits that don't exist makes package resolution fail.
Changes
ios/Package.swiftdepends on posthog-ios withtraits: ["SessionReplay", "CrashReporting"], leaving outSurveys. The plugin needs the other two: React Native replay is the native replay engine, and native crash autocapture comes fromCrashReporting.ios/Package.swiftmoves from tools 6.0 to 6.2. Traits need 6.1+, and posthog-ios 4.0 already requires Xcode 26 (Swift 6.2), so this adds no new requirement.ios/Package.swift)posthog.useSpm(React Native'sspm_dependencyhelper)SwiftPM turns a trait on if any package in the app asks for it. If another package or the app depends on posthog-ios with the defaults,
Surveyscomes back on. Nothing breaks either way; the code just isn't dropped.Release info Sub-libraries affected
Libraries affected
Checklist
If releasing new changes
pnpm changesetto generate a changeset file🤖 Agent context
Autonomy: Human-driven (agent-assisted)
Made with Claude Code; split out of #5237 so the optional traits change can't block the 4.0 pin. The original change (then in #5226) was checked with
examples/example-rn-spm(React Native 0.87.1 full SwiftPM), Debug simulator build on Xcode 26.4.1 against a local 4.0 stack (#873 + #916 + #918): the app contains the replay engine and PLCrashReporter and none of the survey engine or UI types. Not tested: Release builds, running the app.🤖 Generated with Claude Code