Skip to content

React Native example: Expo 57 / TS 7 / Babel 8 upgrade + Observability + funnel experiment + CI - #18

Open
professorice wants to merge 12 commits into
mainfrom
mzafir/react-native-example-upgrade
Open

professorice wants to merge 12 commits into
mainfrom
mzafir/react-native-example-upgrade

Conversation

@professorice

@professorice professorice commented Jul 17, 2026 •

Copy link
Copy Markdown
Contributor

Modernizes examples/React-Native and turns it into a full flags + observability + experimentation demo.

Upgrade

  • Expo SDK 52 → 57 (RN 0.76 → 0.86, React 18 → 19.2.3) via expo install --fix; app.json updated for the SDK 57 schema (splash → plugin, newArchEnabled dropped).
  • @launchdarkly/react-native-client-sdk → latest; @babel/core → 8; typescript → 7 (both in expo.install.exclude).
  • Added @launchdarkly/observability-react-native (latest) + @react-native-async-storage/async-storage 2.2.0 peer.

Observability

App.tsx initializes the Observability plugin with a documented set of common options (serviceName, serviceVersion, resourceAttributes, contextFriendlyName, plus commented endpoint overrides). See the config docs for the full option list.

Experimentation — funnel example

src/SignupFunnel.tsx: a 3-step sign-up funnel driven by the signup-flow-variation string flag (control/dropdown/radio), each step recording a custom event (signup-button-clicked, signup-info-entered, signup-completed) via ldClient.track(), flushed on completion — adapted from the funnel-optimization guide and RN experimentation docs.

README

Documents the LaunchDarkly UI setup (flag + variations, three custom metrics, funnel metric group, building/starting the experiment, viewing observability) needed to see results.

CI

Adds .github/workflows/react-native-bundle.yml bundling both platforms (iOS + Android) on PRs touching this example, plus a weekly latest-canary.

…bservability + CI

Brings examples/React-Native to parity with the hello-react-native-expo sample:

- Expo SDK 52 -> 57 (React Native 0.76 -> 0.86, React 18 -> 19.2.3), via
  `expo install --fix`; app.json updated for the SDK 57 schema (splash moved
  into the expo-splash-screen plugin, newArchEnabled dropped).
- @launchdarkly/react-native-client-sdk -> `latest` tag (always latest major).
- Add @launchdarkly/observability-react-native (`latest`) wired as an LD plugin
  in App.tsx, plus its required @react-native-async-storage/async-storage 2.2.0 peer.
- @babel/core -> ^8.0.1, typescript -> ^7.0.2 (both intentional deviations from
  the SDK 57 defaults, marked via expo.install.exclude). TS 7 is viable now that
  Expo 57's CLI is compatible with it.
- Add a GitHub Actions workflow that bundles both platforms (iOS + Android) on
  PRs/pushes touching this example, with a weekly canary that re-resolves the
  floating `latest` SDKs.

Verified: expo-doctor 20/20, tsc --noEmit clean, and `expo export` bundles on
iOS (638 modules) and Android (636 modules).

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Copilot AI review requested due to automatic review settings July 17, 2026 14:47

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Pull request overview

Updates the examples/React-Native sample to the latest Expo/React Native stack and brings it in line with current LaunchDarkly SDK usage, including Observability integration and CI bundling verification.

Changes:

  • Upgraded the example to Expo SDK 57 / React 19 / RN 0.86 and updated related Expo config.
  • Added LaunchDarkly Observability as an SDK plugin in the sample app.
  • Introduced a GitHub Actions workflow that bundles (exports) the app for both iOS and Android, plus a scheduled “latest” canary run.

Reviewed changes

Copilot reviewed 4 out of 5 changed files in this pull request and generated 1 comment.

File Description
examples/React-Native/package.json Updates Expo/RN/React + LD deps; adds Observability and pins AsyncStorage peer; excludes Babel/TS from expo install normalization.
examples/React-Native/App.tsx Wires @launchdarkly/observability-react-native as an LD plugin.
examples/React-Native/app.json Migrates splash config into expo-splash-screen plugin and removes newArchEnabled.
.github/workflows/react-native-bundle.yml Adds CI to bundle/export both platforms + scheduled canary for floating latest dependencies.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread .github/workflows/react-native-bundle.yml
professorice and others added 2 commits July 17, 2026 11:08
…xperiment

- App.tsx: initialize the Observability plugin with every supported React
  Native option shown and documented.
- src/SignupFunnel.tsx: a 3-step sign-up funnel driven by the
  `signup-flow-variation` string flag (control/dropdown/radio); each step
  records a custom event via ldClient.track() then flushes — adapted from the
  funnel-optimization guide.
- README: document the LaunchDarkly UI setup (flag, three metrics, funnel
  metric group, experiment, iteration, observability) needed to see results.

Verified: tsc --noEmit clean, expo-doctor 20/20, expo export bundles on
iOS (638) and Android (636).

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

flagExposureDedupeWindowMillis defaults to 0 (disabled = emit an exposure for
every evaluation). The sample had set it to 60s, which enables dedupe — the
opposite of the default and needlessly confusing in an experimentation sample.
Show the option as a commented example instead, with a note that it only tunes
Observability telemetry volume and does not affect experiment exposure
attribution (handled by the SDK).

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@professorice professorice changed the title chore(react-native example): Expo 57, TS 7, Babel 8, Observability + both-platform CI React Native example: Expo 57 / TS 7 / Babel 8 upgrade + Observability (all options) + funnel experiment + CI Jul 17, 2026
professorice and others added 3 commits July 17, 2026 11:20
…entials

Keep serviceName, serviceVersion, resourceAttributes, and contextFriendlyName
(plus the commented endpoint overrides). Remove tracingOrigins, urlBlocklist,
sessionTimeout, networkRecording, the disable* toggles, plugin-level debug,
customHeaders, and the commented exposure-dedupe options — these are advanced
tuning knobs that add noise to a sample. README updated to match.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
- App.tsx: set the client only after identify() resolves so flags evaluate
  against the intended context (not per-call defaults / wrong-context exposures)
  during startup; log failures with console.error.
- SignupFunnel.tsx: guard against a null plan in completeSignup so the
  conversion event payload stays consistent.
- README: add explicit dev-build commands (expo run:* / expo start --dev-client)
  so observability data can actually be collected.
- CI: the bundle job now runs only on pull_request/push, so a manual
  workflow_dispatch no longer triggers both bundle and latest-canary.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
…xample-upgrade

# Conflicts:
#	examples/React-Native/yarn.lock

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 7 out of 8 changed files in this pull request and generated 5 comments.

Comment thread examples/React-Native/App.tsx Outdated
Comment thread examples/React-Native/App.tsx
Comment thread .github/workflows/react-native-bundle.yml Outdated
Comment thread .github/workflows/react-native-bundle.yml
Comment thread examples/React-Native/package.json
- App.tsx: use the SERVICE_VERSION constant for applicationInfo.version so the
  two version values can't drift.
- App.tsx: guard the async identify()->setClient() with a `cancelled` flag in
  the effect cleanup, avoiding a state update after unmount.
- CI: manual workflow_dispatch now runs the bundle job (locked deps); the
  latest-canary runs on schedule only, so a manual run doesn't trigger both.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@professorice professorice changed the title React Native example: Expo 57 / TS 7 / Babel 8 upgrade + Observability (all options) + funnel experiment + CI React Native example: Expo 57 / TS 7 / Babel 8 upgrade + Observability + funnel experiment + CI Jul 17, 2026
Pin the bundle/canary workflow to Node 22 (was 24) and raise the README's
stated minimum from Node 20 to Node 22 LTS, keeping CI and docs consistent.

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

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 7 out of 8 changed files in this pull request and generated 1 comment.

Comment thread examples/React-Native/src/SignupFunnel.tsx
- App.tsx: render once identify() settles (success or failure) so a failed
  identify (LD unreachable / bad mobile key) no longer leaves a blank screen;
  still keeps the "don't render before identify" and unmount-guard behavior.
- SignupFunnel.tsx: use white text on the selected plan chip in the control
  variation for adequate contrast.
- README: document the `latest` dist-tag tradeoff (non-reproducible installs)
  and how the committed lockfile + weekly canary mitigate it.

Verified: tsc --noEmit clean, expo export bundles on iOS (638) and Android (636).

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

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 7 out of 8 changed files in this pull request and generated 2 comments.

Comment thread examples/React-Native/src/SignupFunnel.tsx
Comment thread examples/React-Native/App.tsx
- App.tsx: render a minimal loading state (ActivityIndicator + text) while the
  SDK initializes, instead of returning null (blank screen).
- SignupFunnel.tsx: narrow the flag value to a SignupVariation union
  (control/dropdown/radio) for compile-time safety; unexpected values fall back
  to control.
- README: note that `yarn clean-reset` deletes yarn.lock and opts out of the
  lockfile reproducibility described above.

Verified: tsc --noEmit clean, expo export bundles on iOS (638) and Android (636).

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

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 7 out of 8 changed files in this pull request and generated 1 comment.

Comment thread .github/workflows/react-native-bundle.yml
Make the canary job lay out dependencies explicitly with `yarn install` after
`yarn up`, rather than relying on the side effects of `yarn up`, before
`expo export`.

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

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 7 out of 8 changed files in this pull request and generated no new comments.

Keeps the latest-canary deterministic: after `yarn up` settles the lockfile,
`yarn install --immutable` verifies no further drift and fails on unexpected
lockfile changes.

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

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 7 out of 8 changed files in this pull request and generated no new comments.

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.

2 participants