Skip to content

refactor: finish package split cleanup — remove ios renderer shims and deduplicate createVoltraComponent#156

Merged
V3RON merged 2 commits into
callstackincubator:refactor/turbomodulefrom
burczu:refactor/package-split-cleanup
May 25, 2026
Merged

refactor: finish package split cleanup — remove ios renderer shims and deduplicate createVoltraComponent#156
V3RON merged 2 commits into
callstackincubator:refactor/turbomodulefrom
burczu:refactor/package-split-cleanup

Conversation

@burczu
Copy link
Copy Markdown
Contributor

@burczu burczu commented May 25, 2026

Summary

Follow-up to #149. The package split was done mostly automatically, leaving behind a few cases of code duplication. This PR finishes the cleanup.

  • Delete packages/ios/src/renderer/ shims — 7 one-liner re-export files (context-registry, dispatcher, element-registry, flatten-styles, render-cache, stylesheet-registry, types) were left over from the split, making @use-voltra/ios look like it had its own renderer. Removed them and cleaned up the barrel index.ts.
  • Re-export createVoltraComponent from core — the implementation was duplicated verbatim in @use-voltra/ios and @use-voltra/android. Core already owns and exports it — both platform packages now re-export from there. Internal consumers within each package continue to import from the local path, transparently resolving through the re-export.

What was considered but left alone

  • chart-types.ts (ChartDataPoint, SectorDataPoint) — identical 2-line type file in both platform packages. Moving to core would give a platform-agnostic renderer package chart-domain knowledge. Duplication is acceptable at this size.
  • useUpdateOnHMR.ts — identical 20-line RN hook in both client packages. Uses __DEV__ and Metro's global.__accept, so it can't go to core. No appropriate shared home without a new package for 20 lines.
  • widgets/server-credentials.ts — near-identical in @use-voltra/ios-client and @use-voltra/android-client, differing only in the native module import, error message platform label, and caller. The differences are genuine platform facts; there is no valid shared home (clients cannot depend on each other, and both are restricted from importing @use-voltra/core directly).
  • VoltraRNNativeComponent.ts — present in both client native/ dirs, differing only in the registered native view name ('VoltraView' vs 'AndroidVoltraView'). Intentional — different native components for each platform.
  • fonts.ts across expo-plugins — not actually duplicated. packages/expo-plugin/src/utils/fonts.ts is a shared utility; the platform-specific plugin files (ios-client/expo-plugin and android-client/expo-plugin) import resolveFontPaths from it. Structure is correct.
  • Lint rules for RN/expo in @use-voltra/ios and @use-voltra/android — already in place in refactor: migrate native module from Expo Modules API to React Native Turbo Modules #149.
  • Dependency audit — all packages clean; RN and expo only appear in peerDependencies.

Test plan

  • tsc --noEmit passes on @use-voltra/ios and @use-voltra/android
  • @use-voltra/ios test suite passes (5/5)
  • @use-voltra/android test suite passes (6/6)
  • oxlint passes on all changed packages

burczu added 2 commits May 21, 2026 14:07
The ios package had 7 one-liner re-export shims (context-registry,
dispatcher, element-registry, flatten-styles, render-cache,
stylesheet-registry, types) left over from the package split. These
made the package look like it had its own renderer implementation.

Delete the shims and clean up the barrel index — all three internal
consumers already import from renderer/index.js or renderer/renderer.js,
which remain unchanged.
The createVoltraComponent implementation was duplicated verbatim in
@use-voltra/ios and @use-voltra/android. Core already owns and exports
it — replace both copies with re-exports.

Internal consumers within each platform package continue to import from
the local path, transparently resolving through the re-export.
@burczu burczu marked this pull request as ready for review May 25, 2026 07:03
@V3RON V3RON merged commit 3d068fc into callstackincubator:refactor/turbomodule May 25, 2026
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