Skip to content

refactor: share JavaScript across demo apps - #509

Open
ArekChr wants to merge 1 commit into
callstack:mainfrom
ArekChr:refactor/shared-demo-runtime
Open

ArekChr wants to merge 1 commit into
callstack:mainfrom
ArekChr:refactor/shared-demo-runtime

Conversation

@ArekChr

@ArekChr ArekChr commented Oct 21, 2026 •

Copy link
Copy Markdown

Summary

The vanilla RN demo and the Expo demos duplicate runtime code, and some runtime helpers are currently bundled from a test package. Move the shared code into the private @callstack/shared-runtime workspace and rename the test-only workspace to @callstack/shared-tests.

  • Share the Expo screens, components, styles and JS assets, plus the counter, alert helpers, test IDs and fully-displayed hook used by the demos.
  • Keep app entry registration, Router route files, stores and native configuration local. Preserve the SDK 57/58 labels, native navigation flags and SDK 57-only "Pop To Native" action.
  • Update Jest, Detox, local scripts and CI paths, including the Android logcat wrapper path after changing into apps/AndroidApp.
  • Run the shared integration suites against Expo 57 as well as Expo 58 and vanilla RN. Keep dependency types resolved from each consuming app.

Most file changes are moves and removal of duplicate files. Published packages and generated native bindings are unchanged; no package release is needed.

Validation

  • yarn test:apps: 36 tests passed across vanilla RN, Expo 57, Expo 58 and shared Node tests.
  • yarn test:scripts: 18 tests passed.
  • yarn lint, yarn typecheck, yarn build: passed.
  • iOS JS bundles: vanilla RN, Expo 57 and Expo 58 passed. Web exports: both Expo demos passed.
  • Expo 57/58 tsc --noEmit: passed after navigation codegen/build; generated bindings were restored afterwards.
  • Android logcat wrapper: verified from the Android app directory that it preserves the wrapped command's failure status.

Native iOS host E2E

All 11 Detox tests passed with the JavaScript bundle embedded in the native AppleApp host (no Metro):

  • Vanilla RN: 5/5 — open RN from the native shell, increment the shared-store counter, send a native toast, navigate to native settings and referrals.
  • Expo 57: 3/3 — open Expo from the native shell, send a native toast, and render the RN postMessage bubble.
  • Expo 58: 3/3 — the same Expo host scenarios.

Local environment: Xcode 26.3 / Swift 6.2.4, iOS 26.1 simulator. The Expo simulator apps and their embedded frameworks were signed ad hoc after the build (CODE_SIGNING_ALLOWED=NO otherwise left ExpoFont unsigned). Expo 58 also required a temporary local compatibility workaround in expo-modules-jsi@58.0.4 for the upstream Swift 6.2 constructor-annotation and pointer-capture errors (Expo issue #50067, upstream fix #51040). Dependency originals were restored afterwards; no workaround or generated native files are included in the PR. The unmodified Expo 58 iOS build remains unverified on a compatible Xcode toolchain.

The earlier standalone RNApp attempt reported a missing BrownfieldStore (also reproduced with the original counter). The actual native host initializes that store, and its counter E2E passes. Native Android E2E was not run.

This branch has not been deployed

No deployments
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.

1 participant