Skip to content

chore(react-native-plugin)!: require posthog-ios 4.0 - #5237

Draft
turnipdabeets wants to merge 6 commits into
chore/rn-plugin-v3from
chore/rn-plugin-posthog-ios-4-pin
Draft

turnipdabeets wants to merge 6 commits into
chore/rn-plugin-v3from
chore/rn-plugin-posthog-ios-4-pin

Conversation

@turnipdabeets

@turnipdabeets turnipdabeets commented Oct 7, 2026 •

Copy link
Copy Markdown
Contributor

Warning

Prep PR: CI is expected to fail until posthog-ios 4.0 is released. The iOS and macOS example builds can't resolve 4.0.0 from CocoaPods or SwiftPM yet. Merge into #5194 last, once 4.0 is published and CI is green. Plugin 3.0 is released only after this PR.

Problem

#5194 (plugin 3.0) keeps posthog-ios at 3.88.2. This is the follow-up that moves to posthog-ios 4.0, which needs Xcode 26 and raises the floors to iOS 15 and macOS 11 (the plugin already matches those in #5194).

Changes

  • posthog_ios_version in the podspec and the floor in ios/Package.swift move to 4.0.0. check-spm-manifest.mjs keeps checking that they match.
  • Changeset entries in .changeset/rn-plugin-v3.md: Breaking posthog-ios 4.0 / Xcode 26, plus an entry for 4.0's behavior change: native uploads (replay, crash reports) pause while cellular data is turned off for the app, instead of sending requests that fail (PostHog/posthog-ios#909).
  • ios/Package.swift depends on posthog-ios with traits: ["SessionReplay", "CrashReporting"], leaving out Surveys (PostHog/posthog-ios#916, #918). The plugin sets config.surveys = false and renders surveys in JS, so native surveys were dead weight. Replay and crash autocapture need the other two traits. Folded in from chore(react-native-plugin): leave out posthog-ios's Surveys trait #5238.
  • ios/Package.swift moves from tools 6.0 to 6.2. Traits need 6.1+, and posthog-ios 4.0 already requires Xcode 26 (Swift 6.2).
  • Only the full-SwiftPM path drops Surveys. CocoaPods has no traits and posthog.useSpm passes none, so both still get the full SDK. SwiftPM turns a trait back on if any other package depends on posthog-ios with the defaults; nothing breaks, the code just isn't dropped.
  • The plugin's Swift needs no changes for 4.0. Built locally against a merge of the 4.0 stack: examples/example-rn-native-plugin simulator Debug build succeeded with no plugin warnings once chore(react-native-plugin): drop screenshotMode for posthog-ios 4.0 #5236 is applied.

Before merging

Release info Sub-libraries affected

Libraries affected

  • All of them
  • posthog-js (web)
  • posthog-js-lite (web lite)
  • posthog-node
  • posthog-react-native
  • @posthog/react-native-plugin
  • @posthog/react
  • @posthog/ai
  • @posthog/convex
  • @posthog/next
  • @posthog/nextjs-config
  • @posthog/nuxt
  • @posthog/openfeature-node-provider
  • @posthog/openfeature-web-provider
  • @posthog/rollup-plugin
  • @posthog/webpack-plugin
  • @posthog/types
  • @posthog/browser-common

Checklist

  • Tests for new code (no new behavior; plugin tests and manifest check pass)
  • Accounted for the impact of any changes across different platforms
  • Accounted for backwards compatibility of any changes (no breaking changes!) (intentional: posthog-ios 4.0 needs Xcode 26; rides the plugin's 3.0 major)
  • Took care not to unnecessarily increase the bundle size

If releasing new changes

  • Ran pnpm changeset to generate a changeset file

🤖 Agent context

Autonomy: Human-driven (agent-assisted)

Made with Claude Code. Split out of #5226 so that PR (Xcode 26 CI lanes) can merge now, then split again for the traits change (#5238), which is now folded back in. The 4.0 build check merged #873 with the open 4.0 PRs locally, since 4.0 isn't tagged; #907 and #916 conflict on two color-util files there, so the iOS stack needs a rebase. Not tested: the posthog.useSpm path against 4.0, Release builds, running the app.

🤖 Generated with Claude Code

@turnipdabeets turnipdabeets self-assigned this Oct 7, 2026
turnipdabeets added a commit that referenced this pull request Oct 7, 2026
posthog-ios 4.0 isn't released yet; this PR keeps only the Xcode 26 CI lanes.
@turnipdabeets
turnipdabeets force-pushed the chore/rn-plugin-posthog-ios-4-pin branch from 1e813ac to 0422ed4 Compare October 7, 2026 19:35
@turnipdabeets turnipdabeets changed the title chore(react-native-plugin)!: require posthog-ios 4.0 and leave out its Surveys trait chore(react-native-plugin)!: require posthog-ios 4.0 Oct 7, 2026
@turnipdabeets
turnipdabeets marked this pull request as ready for review October 7, 2026 19:41
@turnipdabeets
turnipdabeets requested a review from a team as a code owner October 7, 2026 19:41
turnipdabeets added a commit that referenced this pull request Oct 7, 2026
* chore(react-native-plugin)!: require posthog-ios 4.0 and leave out its Surveys trait

The plugin disables native surveys (React Native surveys are rendered in JS),
so its Swift package depends on posthog-ios with only the SessionReplay and
CrashReporting traits. The manifest moves to tools 6.2, which posthog-ios 4.0
requires anyway and which package traits need.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>

* ci(react-native-plugin): build CocoaPods lanes on Xcode 26

* chore(react-native-plugin): move the posthog-ios 4.0 pin to #5237

posthog-ios 4.0 isn't released yet; this PR keeps only the Xcode 26 CI lanes.

---------

Co-authored-by: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
@github-actions

Copy link
Copy Markdown
Contributor

This PR hasn't seen activity in a week! Should it be merged, closed, or further worked on? If you want to keep it open, post a comment or remove the stale label – otherwise this will be closed in another week.

@github-actions github-actions Bot added the stale label Oct 19, 2026
turnipdabeets added a commit that referenced this pull request Oct 20, 2026
* chore(react-native-plugin)!: require posthog-ios 4.0 and leave out its Surveys trait

The plugin disables native surveys (React Native surveys are rendered in JS),
so its Swift package depends on posthog-ios with only the SessionReplay and
CrashReporting traits. The manifest moves to tools 6.2, which posthog-ios 4.0
requires anyway and which package traits need.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>

* ci(react-native-plugin): build CocoaPods lanes on Xcode 26

* chore(react-native-plugin): move the posthog-ios 4.0 pin to #5237

posthog-ios 4.0 isn't released yet; this PR keeps only the Xcode 26 CI lanes.

---------

Co-authored-by: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
@turnipdabeets
turnipdabeets force-pushed the chore/rn-plugin-posthog-ios-4-pin branch from 690bd16 to ebbddb7 Compare October 20, 2026 15:09

@posthog posthog Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

PostHog Review · Standard · reviewed ebbddb7: 1 Must fix.

@github-actions

github-actions Bot commented Oct 20, 2026 •

Copy link
Copy Markdown
Contributor

Coherence

📄 0 spec file errors · ⛔ 0 broken rules · 🚪 2 unchecked inputs · 🐛 0 bugs that came back

What is Coherence?

Coherence compares the code with its spec files (*.spec.md). A spec file lists the rules for one part of the code.

This check read 44 parts of the code and 7 rules.

Note

These findings do not make this check fail.

None of these findings are in files that this pull request changes. You do not need to fix them in this pull request.

🚪 Unchecked inputs (2)

  • public api in packages/web/Web.spec.md. The input comes from: host-app.
  • webpack plugin in packages/webpack-plugin/Webpack-plugin.spec.md. The input comes from: build.
What this means and how to fix it

Input from outside this code comes in at these places. The spec does not say what checks that input. 10 more places were already like this when Coherence was added. This list does not show them.

To close one of these, find the place by its name in the ## entrances section of its spec file. Add one line under it:

  • If all of the input goes through one function that a rule in the spec protects, add guard: <function>.
  • If a rule in the spec already checks input from the same source, add the place's name to the entrances: line of that rule.
  • If the input needs no check, add control: none - <reason>.

To get the line to add, run npx --no -- coherence scaffold control "<name>".

@github-actions github-actions Bot removed the stale label Oct 21, 2026
turnipdabeets added a commit that referenced this pull request Oct 26, 2026
* chore(react-native-plugin)!: require posthog-ios 4.0 and leave out its Surveys trait

The plugin disables native surveys (React Native surveys are rendered in JS),
so its Swift package depends on posthog-ios with only the SessionReplay and
CrashReporting traits. The manifest moves to tools 6.2, which posthog-ios 4.0
requires anyway and which package traits need.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>

* ci(react-native-plugin): build CocoaPods lanes on Xcode 26

* chore(react-native-plugin): move the posthog-ios 4.0 pin to #5237

posthog-ios 4.0 isn't released yet; this PR keeps only the Xcode 26 CI lanes.

---------

Co-authored-by: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
@turnipdabeets
turnipdabeets force-pushed the chore/rn-plugin-posthog-ios-4-pin branch from ebbddb7 to 45488c4 Compare October 26, 2026 16:29
@marandaneto

Copy link
Copy Markdown
Member

keep PRs like this in draft until its ready to go so its out of our review list

turnipdabeets added a commit that referenced this pull request Oct 31, 2026
* chore(react-native-plugin)!: require posthog-ios 4.0 and leave out its Surveys trait

The plugin disables native surveys (React Native surveys are rendered in JS),
so its Swift package depends on posthog-ios with only the SessionReplay and
CrashReporting traits. The manifest moves to tools 6.2, which posthog-ios 4.0
requires anyway and which package traits need.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>

* ci(react-native-plugin): build CocoaPods lanes on Xcode 26

* chore(react-native-plugin): move the posthog-ios 4.0 pin to #5237

posthog-ios 4.0 isn't released yet; this PR keeps only the Xcode 26 CI lanes.

---------

Co-authored-by: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
@turnipdabeets
turnipdabeets force-pushed the chore/rn-plugin-posthog-ios-4-pin branch from 45488c4 to c3397e8 Compare October 31, 2026 02:07
@github-actions

Copy link
Copy Markdown
Contributor

📝 No Changeset Found

This PR doesn't include a changeset. A changeset is required to release a new version.

How to add a changeset

Run this command and follow the prompts:

pnpm changeset

Remember: Never use major version bumps for posthog-js as it's autoloaded by clients.

This branch has not been deployed

No deployments
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