cpp.js 1.0.0 → 1.0.2

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/CHANGELOG.md CHANGED
@@ -1,5 +1,17 @@
1
1
  # cpp.js
2
2
 
3
+ ## 1.0.2
4
+
5
+ ### Patch Changes
6
+
7
+ - fix: workaround for race condition with turbomodule in android. In the future, it will be completely resolved by removing support for the old architecture.
8
+
9
+ ## 1.0.1
10
+
11
+ ### Patch Changes
12
+
13
+ - fix: include prebuilt/_/{config.general.name}/_.h in dependency header search paths
14
+
3
15
  ## 1.0.0
4
16
 
5
17
  ### Major Changes
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "cpp.js",
3
- "version": "1.0.0",
3
+ "version": "1.0.2",
4
4
  "license": "MIT",
5
5
  "homepage": "https://cpp.js.org",
6
6
  "repository": "https://github.com/bugra9/cpp.js.git",
@@ -36,7 +36,7 @@ export default function getCppJsScript(platform, bridgePath = null) {
36
36
 
37
37
  function getReactNativeScript(env, modulePrefix) {
38
38
  return `
39
- import { NativeModules } from 'react-native';
39
+ import { NativeModules, Platform } from 'react-native';
40
40
  import Module from '@cpp.js/core-embind-jsi';
41
41
 
42
42
  const { RNJsiLib } = NativeModules;
@@ -54,10 +54,12 @@ function getReactNativeScript(env, modulePrefix) {
54
54
  return new Promise((resolve, reject) => {
55
55
  if (RNJsiLib && RNJsiLib.start) {
56
56
  RNJsiLib.start();
57
- setEnv();
58
- const m = Module;
59
- ${modulePrefix}
60
- resolve(Module);
57
+ setTimeout(() => {
58
+ setEnv();
59
+ const m = Module;
60
+ ${modulePrefix}
61
+ resolve(Module);
62
+ }, Platform.OS === 'android' ? 2000 : 0);
61
63
  } else {
62
64
  reject('Module failed to initialise.');
63
65
  }
@@ -8,6 +8,7 @@ export default function getDependFilePath(source, platform) {
8
8
  const dependPackage = state.config.allDependencies.find((d) => source.startsWith(d.package.name));
9
9
  if (dependPackage) {
10
10
  const depName = dependPackage.package.name;
11
+ const configName = dependPackage.general.name;
11
12
  const filePath = source.substring(depName.length + 1);
12
13
 
13
14
  let path;
@@ -19,7 +20,9 @@ export default function getDependFilePath(source, platform) {
19
20
  path = `${dependPackage.paths.output}/prebuilt/${platform}`;
20
21
  }
21
22
 
22
- if (fs.existsSync(`${path}/${depName}/${filePath}`)) {
23
+ if (fs.existsSync(`${path}/${configName}/${filePath}`)) {
24
+ path = `${path}/${configName}/${filePath}`;
25
+ } else if (fs.existsSync(`${path}/${depName}/${filePath}`)) {
23
26
  path = `${path}/${depName}/${filePath}`;
24
27
  } else if (fs.existsSync(`${path}/${filePath}`)) {
25
28
  path = `${path}/${filePath}`;