Repository navigation
React Native example: Expo 57 / TS 7 / Babel 8 upgrade + Observability + funnel experiment + CI - #18
Open
professorice wants to merge 12 commits into
Open
professorice wants to merge 12 commits into
professorice wants to merge 12 commits into
Conversation
…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>
There was a problem hiding this comment.
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.
…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>
…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
- 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>
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>
- 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>
- 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>
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>
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>
professorice
enabled auto-merge (squash)
July 31, 2026 15:42
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Modernizes
examples/React-Nativeand turns it into a full flags + observability + experimentation demo.Upgrade
expo install --fix; app.json updated for the SDK 57 schema (splash → plugin,newArchEnableddropped).@launchdarkly/react-native-client-sdk→latest;@babel/core→ 8;typescript→ 7 (both inexpo.install.exclude).@launchdarkly/observability-react-native(latest) +@react-native-async-storage/async-storage2.2.0 peer.Observability
App.tsxinitializes 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 thesignup-flow-variationstring flag (control/dropdown/radio), each step recording a custom event (signup-button-clicked,signup-info-entered,signup-completed) vialdClient.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.ymlbundling both platforms (iOS + Android) on PRs touching this example, plus a weeklylatest-canary.