react-native-vroom-chart 0.17.0 → 0.18.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "react-native-vroom-chart",
3
- "version": "0.17.0",
3
+ "version": "0.18.0",
4
4
  "description": "Mobile-first Skia candlestick chart for React Native",
5
5
  "license": "MIT",
6
6
  "author": "Darion Welch",
@@ -61,19 +61,19 @@
61
61
  "peerDependencies": {
62
62
  "@shopify/react-native-skia": ">=2.11.0",
63
63
  "react": "*",
64
- "react-native": "*",
64
+ "react-native": ">=0.78",
65
65
  "react-native-gesture-handler": ">=2.16.0",
66
66
  "react-native-reanimated": ">=4.0.0",
67
67
  "react-native-worklets": ">=0.7.0"
68
68
  },
69
69
  "devDependencies": {
70
- "@shopify/react-native-skia": "2.11.0",
71
- "@types/react": "~19.1.0",
72
- "react": "19.1.0",
73
- "react-native": "0.81.5",
74
- "react-native-gesture-handler": "~2.28.0",
75
- "react-native-reanimated": "~4.1.7",
76
- "react-native-worklets": "0.7.4",
70
+ "@shopify/react-native-skia": "2.12.0",
71
+ "@types/react": "~19.2.0",
72
+ "react": "19.2.3",
73
+ "react-native": "0.86.3",
74
+ "react-native-gesture-handler": "~2.32.0",
75
+ "react-native-reanimated": "~4.5.1",
76
+ "react-native-worklets": "0.10.1",
77
77
  "tsup": "^8.5.1",
78
78
  "typescript": "~5.9.2",
79
79
  "vitest": "^3.2.6",
@@ -37,7 +37,7 @@ Pod::Spec.new do |s|
37
37
  s.homepage = "https://github.com/keepitreal/vroom"
38
38
  s.license = { :type => "MIT" }
39
39
  s.authors = { "vroom" => "noreply@example.com" }
40
- s.platforms = { :ios => "14.0" }
40
+ s.platforms = { :ios => "15.1" }
41
41
  s.source = { :git => "" }
42
42
 
43
43
  s.requires_arc = true
@@ -1,10 +1,13 @@
1
1
  import type { TurboModule } from 'react-native';
2
2
  import { TurboModuleRegistry } from 'react-native';
3
3
 
4
- // TurboModule spec consumed by codegen. The only method is `install`, which
5
- // the native side uses to install the `global.VroomChartJSI` host object the
6
- // first time it's called from JS. All real chart operations go through that
7
- // host object, not through the TurboModule itself.
4
+ // TurboModule spec consumed by codegen. The native side installs the
5
+ // `global.VroomChartJSI` host object when React Native instantiates this
6
+ // module, not when `install` is called see the JSI-bindings hooks in
7
+ // ../ios/VroomChartModule.mm and ../android/src/main/cpp/VroomChartJsiBindings.cpp.
8
+ // `install` remains so the spec has a method to generate and so JS has a way
9
+ // to force instantiation; all real chart operations go through the host
10
+ // object, not through the TurboModule itself.
8
11
  export interface Spec extends TurboModule {
9
12
  install(): boolean;
10
13
  }
@@ -354,10 +354,17 @@ const EMPTY_FOOTPRINTS = footprintsToSpec({ prints: [] });
354
354
  let installed = false;
355
355
  function ensureInstalled(): void {
356
356
  if (installed) return;
357
- const ok = NativeVroomChart.install();
358
- if (!ok) throw new Error('VroomChartModule.install() returned false');
357
+ // The bindings are installed by the TurboModule itself, when the runtime
358
+ // hands it over (installJSIBindingsWithRuntime:callInvoker: on iOS,
359
+ // getBindingsInstaller() on Android). Touching the module is what forces
360
+ // that to have happened; the global is the thing worth checking.
361
+ NativeVroomChart.install();
359
362
  if (typeof globalThis.VroomChartJSI === 'undefined') {
360
- throw new Error('global.VroomChartJSI undefined after install()');
363
+ throw new Error(
364
+ 'global.VroomChartJSI is undefined — VroomChartModule did not install ' +
365
+ 'its JSI bindings. This requires react-native >= 0.78 with the New ' +
366
+ 'Architecture enabled.',
367
+ );
361
368
  }
362
369
  installed = true;
363
370
  }
@@ -1,24 +0,0 @@
1
- // JNI entry point for VroomChartModule.install() (see
2
- // ../java/com/vroom/chart/VroomChartModule.kt). This is the Android
3
- // equivalent of ../../ios/VroomChartModule.mm's `-install` method: it
4
- // reinterprets the JSI runtime pointer handed over from Java and calls the
5
- // same platform-agnostic vroom::installJsi() the iOS bridge uses.
6
-
7
- #include <jni.h>
8
-
9
- #include <jsi/jsi.h>
10
-
11
- #include "VroomJsiInstaller.h"
12
-
13
- extern "C" JNIEXPORT jboolean JNICALL
14
- Java_com_vroom_chart_VroomChartModule_nativeInstall(JNIEnv* /*env*/,
15
- jobject /*thiz*/,
16
- jlong runtimePointer) {
17
- auto* runtime =
18
- reinterpret_cast<facebook::jsi::Runtime*>(runtimePointer);
19
- if (runtime == nullptr) {
20
- return JNI_FALSE;
21
- }
22
- vroom::installJsi(*runtime);
23
- return JNI_TRUE;
24
- }