Files
zeekay 10e6fec4c0 debrand: the brand token is INSIGHTS_, and a wrong one stops the container
The rule table mapped HOG_ -> FN_ ahead of any POSTHOG rule, so POSTHOG_FOO
split into POST + HOG_ and came out POSTFN_FOO. Nothing sets that. The live
pods set INSIGHTS_SKIP_MIGRATION_CHECKS, which bin/migrate-check reads on the
container entrypoint, so the misspelling does not degrade a feature -- it runs
migrate --check against a database whose history this tree does not share and
the container never starts.

Both replacements are measured against the shipped tree rather than chosen:
every HOG_ name with a counterpart there is spelled INSIGHTS_ (HOG_QL ->
INSIGHTS_QL, HOG_FUNCTION_TEMPLATES -> INSIGHTS_FUNCTION_TEMPLATES, 12 of 12
determinate cases), and FN_ appears in it nowhere. Upstream carries 95 HOG_
tokens and zero FN_ ones, so repairing FN_ back out is exactly the inverse of
the bad rule and cannot collide with an upstream name.

The rule is fixed for the next convergence, and the tree it already produced is
repaired in the same commit -- the codemod is idempotent against its own output,
so it cannot undo this itself.
2026-08-01 17:42:28 -07:00

120 lines
4.7 KiB
TypeScript

import { OnboardingComponentsContext, createInstallation } from 'scenes/onboarding/shared/OnboardingDocsContentWrapper'
import { StepDefinition } from '../steps'
export const getIOSSteps = (
ctx: OnboardingComponentsContext,
options?: {
includeExperimentalSpi?: boolean
experimentalDescription?: string
minVersionPod?: string
minVersionSPM?: string
}
): StepDefinition[] => {
const { CodeBlock, Markdown, CalloutBox, dedent } = ctx
const podVersion = options?.minVersionPod || '3.56'
const spmVersion = options?.minVersionSPM || '3.56.0'
return [
{
title: 'Install dependency',
badge: 'required',
content: (
<>
{options?.experimentalDescription && (
<CalloutBox type="fyi" title="Experimental API">
<Markdown>{options.experimentalDescription}</Markdown>
</CalloutBox>
)}
<Markdown>Install via Swift Package Manager:</Markdown>
<CodeBlock
blocks={[
{
language: 'swift',
file: 'Package.swift',
code: dedent`
dependencies: [
.package(url: "https://github.com/Insights/insights-ios.git", from: "${spmVersion}")
]
`,
},
]}
/>
<Markdown>Or add Insights to your Podfile:</Markdown>
<CodeBlock
blocks={[
{
language: 'ruby',
file: 'Podfile',
code: dedent`
pod "Insights", "~> ${podVersion}"
`,
},
]}
/>
</>
),
},
{
title: 'Configure Insights',
badge: 'required',
content: (
<>
<Markdown>Initialize Insights in your AppDelegate:</Markdown>
<CodeBlock
blocks={[
{
language: 'swift',
file: 'AppDelegate.swift',
code: dedent`
import Foundation
${options?.includeExperimentalSpi ? '@_spi(Experimental) ' : ''}import Insights
import UIKit
class AppDelegate: NSObject, UIApplicationDelegate {
func application(_: UIApplication, didFinishLaunchingWithOptions _: [UIApplication.LaunchOptionsKey: Any]? = nil) -> Bool {
let INSIGHTS_PROJECT_TOKEN = "<ph_project_token>"
let INSIGHTS_HOST = "<ph_client_api_host>"
let config = InsightsConfig(projectToken: INSIGHTS_PROJECT_TOKEN, host: INSIGHTS_HOST)
InsightsSDK.shared.setup(config)
return true
}
}
`,
},
]}
/>
</>
),
},
{
title: 'Send events',
badge: 'recommended',
content: (
<>
<Markdown>
Once installed, Insights will automatically start capturing events. You can also manually send
events to test your integration:
</Markdown>
<CodeBlock
blocks={[
{
language: 'swift',
file: 'Swift',
code: dedent`
InsightsSDK.shared.capture("button_clicked", properties: ["button_name": "signup"])
`,
},
]}
/>
</>
),
},
]
}
export const IOSInstallation = createInstallation(getIOSSteps)