Repository navigation
chore(react-native-plugin)!: Major Release v3 - #5194
turnipdabeets wants to merge 5 commits into
Conversation
|
[High risk] Breaking changes to React Native plugin API and platform requirements. The PR appears safe to merge; no outstanding blocking finding was identified. Reviews (2) · Last reviewed commit: "chore(react-native-plugin)!: require mac..." |
Node SDK compliance v2Commit: 93428a3 Capture v0 — acceptance✅ 55 passed / ❌ 1 non-passing / Drill-down: run artifacts → ❌ migration/yaml-parity-v1/remote-flags-v1.feature::Omitted GeoIP settings default to enabled in flag requests — failed_assertionFlags field differs Code: Failed step: migration/yaml-parity-v1/remote-flags-v1.feature:134 the first flags request field "geoip_disable" should equal JSON false Operation: Field: Expected: false Actual value: true Harness exit: 1; report validation exit: 1. Capture v1 — acceptance✅ 120 passed / ❌ 1 non-passing / Drill-down: run artifacts → ❌ migration/yaml-parity-v1/remote-flags-v1.feature::Omitted GeoIP settings default to enabled in flag requests — failed_assertionFlags field differs Code: Failed step: migration/yaml-parity-v1/remote-flags-v1.feature:134 the first flags request field "geoip_disable" should equal JSON false Operation: Field: Expected: false Actual value: true Harness exit: 1; report validation exit: 1. Capture v0 — migration✅ 55 passed / ❌ 1 non-passing / Drill-down: run artifacts → ❌ migration/yaml-parity-v1/remote-flags-v1.feature::Omitted GeoIP settings default to enabled in flag requests — failed_assertionFlags field differs Code: Failed step: migration/yaml-parity-v1/remote-flags-v1.feature:134 the first flags request field "geoip_disable" should equal JSON false Operation: Field: Expected: false Actual value: true Harness exit: 1; report validation exit: 1. Capture v1 — migration✅ 120 passed / ❌ 1 non-passing / Drill-down: run artifacts → ❌ migration/yaml-parity-v1/remote-flags-v1.feature::Omitted GeoIP settings default to enabled in flag requests — failed_assertionFlags field differs Code: Failed step: migration/yaml-parity-v1/remote-flags-v1.feature:134 the first flags request field "geoip_disable" should equal JSON false Operation: Field: Expected: false Actual value: true Harness exit: 1; report validation exit: 1. |
19723ba to
e089203
Compare
|
…move start() - podspec: state the iOS 15.0 floor once in s.platforms (was overridden to 13.0 by s.ios.deployment_target); drop the pre-0.71 old-architecture branch and folly flags; call install_modules_dependencies unconditionally - Swift: drop #available(iOS 14/15) checks that are always true on iOS 15 - iOS/Android: read only throttleDelayMs; drop the iOSdebouncerDelayMs and androidDebouncerDelayMs fallbacks (posthog-react-native always sends throttleDelayMs since #2328) - Android: unconditional namespace (AGP >= 7.3 ships with RN 0.71), delete the package= manifest, depend on react-android, drop unused reactNativeArchitectures() and ndkversion property - package.json: peer react-native >=0.71; drop missing cpp/ from files - remove the legacy start() method on iOS, Android and JS; posthog-react-native calls setup() since it first loaded this plugin (4.47.0), and only types start as optional for the legacy session-replay package BREAKING CHANGE: requires iOS 15 and React Native 0.71 or later; start() is removed.
e089203 to
4c11edf
Compare
posthog-ios 4.0 raises its macOS minimum to 11 (PostHog/posthog-ios#906). Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
dustinbyrne
left a comment
There was a problem hiding this comment.
any default configs worth changing? additional features we can turn on by default that are currently opt-in?
or perhaps this is not relevant to this package?
|
@dustinbyrne Good question! I went through it and there's nothing to change in this package. The plugin is a bridge: posthog-react-native sends explicit values for replay, error tracking and push, so the plugin's own fallbacks only matter for old posthog-react-native versions or direct Turning opt-in features like native crash autocapture on by default would be a |
…m, accept projectToken on Android (#5214) * refactor(react-native-plugin): drop unused setupNativeSdk method param and projectToken key Both were left over from removing start(); the JS layer only calls setup and only sends apiKey. * refactor(react-native-plugin): accept projectToken on both platforms Keeps the iOS fallback and adds it on Android, so a future RN SDK can send projectToken.
* 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>
Problem
posthog-ios 4.0 will require iOS 15 (PostHog/posthog-ios#876) and macOS 11 (PostHog/posthog-ios#906). The plugin's podspec still declares iOS 13 and macOS 10.15, so we need a major version to raise the floor. This PR prepares
@posthog/react-native-plugin3.0.0 and bundles a few low-risk cleanups that are only safe in a major, including removing the legacystart()method.posthog-ios 4.0 (PostHog/posthog-ios#873) is not released yet, so this PR keeps the posthog-ios pin at
3.88.2. The 4.0 bump is prepared in stacked PRs (below). 3.0 is released only after posthog-ios 4.0 and #5237 are in.What breaks for users, and what to do
min_ios_version_supported); on Android RN 0.70 worked until now.start()is removedstart()directly. posthog-react-native callssetup()since 4.47.0, the first release that loads this plugin.setup().iOSdebouncerDelayMs/androidDebouncerDelayMsare no longer read nativelysetup()directly with these keys. posthog-react-native always sendsthrottleDelayMs(since #2328), and it still maps the deprecated options in JS.throttleDelayMs.posthog-react-native only gets a type-only change (see below) and does not need a release: every version that loads this plugin already calls
setup(). Its optional peer is>= 2.9.3, which includes 3.0.0.Changes
:ios => '15.0'once ins.platforms. Before,s.platformsusedmin_ios_version_supported, and a laters.ios.deployment_target = '13.0'overrode it.ios/Package.swiftalready uses.iOS(.v15).:osx => '11.0', matching posthog-ios 4.0.ios/Package.swiftis iOS-only, so it doesn't change.#available(iOS 14.0, *)and#available(iOS 15.0, *)checks, which are always true on iOS 15.throttleDelayMs.start(): removed from iOS, Android and JS. Inpackages/react-native,PostHogReactNativePluginExtendednow typesstartas optional and the legacy session-replay branch callsstart?.(...).posthog-react-native-session-replaystill hasstart(), so runtime behaviour is unchanged.elsebranch andfolly_compiler_flags.install_modules_dependenciesnow runs unconditionally (available since RN 0.71).namespaceis now unconditional (RN 0.71 ships AGP 7.3+). Deleted the legacyAndroidManifest.xmlwithpackage=, and renamedAndroidManifestNew.xmltoAndroidManifest.xml.com.facebook.react:react-android. The RN Gradle plugin provides the version. Before, it wasreact-native:+, which relied on substitution.reactNativeArchitectures()function and the unusedndkversionproperty.package.json: thereact-nativepeer is now>=0.71, and the missingcppentry is removed fromfiles.Why React Native 0.71
exports, so@posthog/core/surveyscan't be resolved. Only apps on an older posthog-react-native that upgrade this plugin are affected.min_ios_version_supportedin the podspec, so the iOS floor only moves from 0.69 to 0.71.elsebranch,react-native:+, AGP < 7.3 namespace switch), which no current SDK user can reach.Verified: an RN 0.70.15 Android app builds and runs with plugin 2.12.4 (events and replay received). The same app fails to build with this branch (
Could not find com.facebook.react:react-android). RN 0.71.19 builds with this branch. On iOS, a fresh RN 0.71.19 app with this plugin (CocoaPods, deployment target 15) builds and launches on Xcode 26.4.1, after three React Native patches the app needs anyway on current tooling:gem 'json', '< 3'in the Gemfile,ERB.new(..., trim_mode:)for Ruby 4, andoperator""_ptin Yoga'sYGValue.h. None come from the plugin.Considered and left out
setup()without push config, and native defaults must apply then.s.swift_versions = "5.3".v5language mode inPackage.swift. Changing it gains nothing.kotlinOptions→compilerOptionscompilerOptionsneeds KGP 1.8+ and aJvmTargetvalue, and RN 0.71/0.72 apps use Kotlin 1.7.apply plugin: "com.facebook.react"Stacked PRs (merge into this one)
screenshotModeSurveystrait (stacked on #5237)Docs: PostHog/posthog.com#20922 (draft) documents the 3.0 requirements and upgrade notes. Merge it when 3.0.0 is released.
Release blocker: posthog-ios 4.0 must reach CocoaPods trunk before it goes read-only on 2 Dec 2026, or the default CocoaPods path can't resolve it.
Follow-ups (not in this PR)
posthog.useSpmminSdkchangesRelease info Sub-libraries affected
Libraries affected
Checklist
If releasing new changes
pnpm changesetto generate a changeset file.npx changeset statusshows only@posthog/react-native-plugin3.0.0 (major).🤖 Agent context
Autonomy: Human-driven (agent-assisted)
Prepared with Claude Code from a maintainer-defined scope. Before each removal, the agent checked the git history. Core started loading this plugin in #3677 and checks
setupbeforestart, andthrottleDelayMs(#2328) predates that. Items it could not prove safe were left out, as listed above. Removingstart()needed a type-only edit inpackages/react-native, included here.Checks run locally:
pnpm lint,pnpm typecheck,pnpm test:unit(vitest 11/11 andcheck-spm-manifest.mjs)pnpm turbo run check-types --filter=posthog-react-native, and the posthog-react-native unit tests (1224/1224)examples/example-rn-native-plugin(RN 0.79.6):./gradlew assembleDebug :posthog_react-native-plugin:testDebugUnitTest(17/17; re-run after removingstart())pod install+xcodebuildsimulator Debug buildpod install+xcodebuildNot tested: the SPM paths and an iOS build after removing
start().Package.swiftdid not change. No manual device testing.🤖 Generated with Claude Code