Skip to content

feat: added example app to support rn0.83 - #10

Open
sunitaprajapati89 wants to merge 3 commits into
mainfrom
update-to-vega0.24-rn0.83
Open

feat: added example app to support rn0.83#10
sunitaprajapati89 wants to merge 3 commits into
mainfrom
update-to-vega0.24-rn0.83

Conversation

@sunitaprajapati89

Copy link
Copy Markdown
Contributor

Add example-83 app for React Native 0.83 / Vega SDK 0.24 support

Summary

  • Adds a new example-83/ example application targeting React Native 0.83 and Vega SDK 0.24, alongside the existing example/ app which remains on RN 0.72
  • Updates the plugin package (@segment/analytics-react-native-plugin-kepler) from v1.0.0 to v2.0.0 with RN 0.83 peer dependencies

Plugin changes (v1.0.0 → v2.0.0)

  • Bumped @amazon-devices/react-native-kepler peer: ~2.0.0 → 4.0.0
  • Bumped @amazon-devices/react-native-device-info peer: ^2.0.0 → 2.1.9000000000-rn-83
  • Bumped @amazon-devices/react-native-localize peer: ~2.0.0 → 2.1.9000000000-rn-83
  • Bumped @amazon-devices/react-native-async-storage__async-storage override: ~2.0.0 → 2.1.9000000000-rn-83
  • Promoted @segment/analytics-react-native from pre-release 2.20.0-beta.2 to ^2.21.4
  • Swapped metro-react-native-babel-preset → @react-native/babel-preset in devDependencies
  • Bumped react-native devDependency to ^0.83.0, dropped @types/react-native (removed in RN 0.83)

example-83 app
Mirrors the existing example/ app with the following RN 0.83 toolchain changes:

  • react-native 0.83.0, react 19.2.0, @react-native-community/cli ^15.0.0
  • babel.config.js: uses @react-native/babel-preset
  • metro.config.js: registers kepler as a custom resolver platform (required for platform=kepler bundle URL)
  • tsconfig.json: "jsx": "react-jsx" for React 19 automatic transform
  • jest.config.json: updated transformIgnorePatterns to include @Amazon-Devices packages
  • All source files, assets, and Vega manifest copied from example/; app ID updated to com.segment.keplersample83

Notes
The existing example/ app and v1.0.0 of the plugin are untouched — RN 0.72 apps continue to work as before
The -rn-83 version suffixes on Amazon packages are early-access build identifiers; confirm final published versions before a GA release
Requires Vega SDK 0.24 device image (keplerscript_4) on the virtual device; older OS images will reject the install

Sunita Prajapati added 3 commits July 21, 2026 16:05
- Bump plugin version to 2.0.0
- Update Amazon peer deps to rn-83 versions (kepler 4.0.0, device-info/localize/async-storage 2.1.9000000000-rn-83)
- Update devDeps toolchain to RN 0.83 / React 19 / react-native-builder-bob 0.43
- Pin @segment/analytics-react-native to 2.20.0-beta.2 (2.21.4 has hard native crashes on Kepler 4 New Architecture)
- Add native-module-polyfill.js shim to prevent __fbBatchedBridgeConfig crash on Kepler 4
- Chain metro.config.js resolveRequest to Kepler's own resolver to avoid bundling standard RN instead of Kepler runtime
- Add @amzn/react-native-kepler extraNodeModules alias to fix Metro asset resolution
- Update manifest.toml to kepler_4 runtime module
- Fix UI layout in App.tsx and Link.tsx (reduce oversized margins and font sizes for virtual device)
- Fix deprecated moduleResolution: node → bundler in both tsconfig files
- Remove deprecated baseUrl from root tsconfig
- Update README with Vega SDK 0.24 install steps and metro.config.js setup instructions
….21.4 on Kepler 4

Kepler 4 (Vega SDK 0.24) is New Architecture only — NativeModules throws
__fbBatchedBridgeConfig at module-load time and cannot be caught in user code.
Three Metro resolveRequest intercepts replace the offending modules with
pure-JS shims before they are loaded:

- get-random-values-polyfill.js: replaces react-native-get-random-values
  with a Math.random fallback (RNGetRandomValues TurboModule absent on Kepler)
- sovran-polyfill.js: replaces @segment/sovran-react-native entry point with
  pure-JS store/bridge/persistor exports, bypassing the NativeModules getter
- context-polyfill.js: replaces analytics-react-native context.ts which calls
  getNativeModule('AnalyticsReactNative') — safe because the Kepler plugin
  provides its own deviceInfoProvider

Also:
- Remove native-module-polyfill.js (superseded by the above three shims)
- Update example-83/package.json to use published 2.21.4 from npm registry
- Update metro.config.js: chain keplerResolveRequest, add transformIgnorePatterns
  for @segment scope, remove stale commented-out block
- Fix deprecated moduleResolution: node → bundler in root tsconfig.json
- Update README with complete setup guide including all three shims,
  full metro.config.js, and root cause explanation
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