Commit 3d068fc
authored
refactor: finish package split cleanup (#156)
## 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 #149.
- Dependency audit — all packages clean; RN and expo only appear in
`peerDependencies`.
## Test plan
- [x] `tsc --noEmit` passes on `@use-voltra/ios` and
`@use-voltra/android`
- [x] `@use-voltra/ios` test suite passes (5/5)
- [x] `@use-voltra/android` test suite passes (6/6)
- [x] `oxlint` passes on all changed packages1 parent 7b6b387 commit 3d068fc
10 files changed
Lines changed: 12 additions & 80 deletions
File tree
- packages
- android/src/jsx
- ios/src
- jsx
- renderer
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | | - | |
2 | | - | |
3 | | - | |
4 | | - | |
5 | | - | |
6 | | - | |
7 | | - | |
8 | | - | |
9 | | - | |
10 | | - | |
11 | | - | |
12 | | - | |
13 | | - | |
14 | | - | |
15 | | - | |
16 | | - | |
17 | | - | |
18 | | - | |
19 | | - | |
20 | | - | |
21 | | - | |
22 | | - | |
23 | | - | |
24 | | - | |
25 | | - | |
26 | | - | |
27 | | - | |
28 | | - | |
29 | | - | |
30 | | - | |
31 | | - | |
32 | | - | |
33 | | - | |
34 | | - | |
35 | | - | |
36 | | - | |
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | | - | |
2 | | - | |
3 | | - | |
4 | | - | |
5 | | - | |
6 | | - | |
7 | | - | |
8 | | - | |
9 | | - | |
10 | | - | |
11 | | - | |
12 | | - | |
13 | | - | |
14 | | - | |
15 | | - | |
16 | | - | |
17 | | - | |
18 | | - | |
19 | | - | |
20 | | - | |
21 | | - | |
22 | | - | |
23 | | - | |
24 | | - | |
25 | | - | |
26 | | - | |
27 | | - | |
28 | | - | |
29 | | - | |
30 | | - | |
31 | | - | |
32 | | - | |
33 | | - | |
34 | | - | |
35 | | - | |
36 | | - | |
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
This file was deleted.
This file was deleted.
This file was deleted.
This file was deleted.
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | | - | |
2 | 1 | | |
3 | 2 | | |
4 | 3 | | |
| |||
This file was deleted.
This file was deleted.
This file was deleted.
0 commit comments