Repository navigation
chore(react-native-plugin)!: Major Release v3 - #5194
turnipdabeets wants to merge 10 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 acceptance v2Commit: c81d985 Capture v0✅ 83 passed / ❌ 4 non-passing / Drill-down: run artifacts → ❌ server_snapshot_payload_false — failed_assertionExpected native data result Code: Failed step: acceptance/public/evaluate-flags.feature:868 the public snapshot outcomes should have these semantics: ❌ server_snapshot_payload_zero — failed_assertionExpected native data result Code: Failed step: acceptance/public/evaluate-flags.feature:868 the public snapshot outcomes should have these semantics: ❌ server_snapshot_payload_null — failed_assertionExpected native data result Code: Failed step: acceptance/public/evaluate-flags.feature:868 the public snapshot outcomes should have these semantics: ❌ 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✅ 148 passed / ❌ 4 non-passing / Drill-down: run artifacts → ❌ server_snapshot_payload_false — failed_assertionExpected native data result Code: Failed step: acceptance/public/evaluate-flags.feature:868 the public snapshot outcomes should have these semantics: ❌ server_snapshot_payload_zero — failed_assertionExpected native data result Code: Failed step: acceptance/public/evaluate-flags.feature:868 the public snapshot outcomes should have these semantics: ❌ server_snapshot_payload_null — failed_assertionExpected native data result Code: Failed step: acceptance/public/evaluate-flags.feature:868 the public snapshot outcomes should have these semantics: ❌ 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
e089203 to
4c11edf
Compare
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 |
|
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 |
93428a3 to
6fed091
Compare
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 ( 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)
What this means and how to fix itInput 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
To get the line to add, run |
6fed091 to
50eb417
Compare
|
keep PRs like this in draft until its ready to go so its out of our review list |
…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.
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>
…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>
…5236) * chore(react-native-plugin): drop screenshotMode for posthog-ios 4.0 posthog-ios 4.0 always records screenshots, so the setting is a deprecated no-op. * chore(react-native-plugin): add changeset for dropping screenshotMode * chore(react-native-plugin): shorten screenshotMode changeset
…e Manager (#5449) * chore(react-native-plugin)!: resolve posthog-ios through Swift Package Manager posthog-ios 4.0 ships on Swift Package Manager only, so the podspec always adds posthog-ios with React Native's spm_dependency helper instead of depending on the PostHog pod from CocoaPods trunk. That helper needs react-native / react-native-macos 0.75, so the peer floor moves from 0.71. Also stop setting screenshotModeBackgroundCapture, which posthog-ios 4.0 removes, and turn the posthog.useSpm CI lane into a dynamic-frameworks lane. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * fix(react-native-plugin): explain that generate_multiple_pod_projects isn't supported React Native's spm_dependency only searches the main Pods project for the plugin's target, so pod install crashed with that option on. * fix(react-native-plugin): explain that deduplicate_targets => false isn't supported With target deduplication off, CocoaPods names the plugin's target posthog-react-native-plugin-Pods-<App>, and React Native's spm_dependency looks it up by its exact pod name, so pod install crashed on a nil target. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * fix(react-native-plugin): don't reload the app's Podfile from the podspec Autolinking evaluates the podspec while the Podfile is still loading, so Pod::Config#podfile loaded the Podfile again from the plugin directory, re-running use_native_modules! and its CLI config command. Read the already-loaded Podfile instead; pod install re-evaluates the :path podspec afterwards, so the install! option checks still run. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * fix(react-native-plugin): explain that app targets with different platforms or linkage aren't supported CocoaPods then splits the plugin into scoped targets (posthog-react-native-plugin-iOS15.1, -framework/-library), and React Native's spm_dependency crashed on a nil target looking up the exact pod name. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * fix(react-native-plugin): count abstract targets when checking for scoped pods An abstract parent with a platform gets its own plugin variant, so a different linkage there splits the target too. --------- Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
c15386c to
c81d985
Compare
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