daily-co / react-native-daily-js

https://docs.daily.co/reference/rn-daily-js
BSD 2-Clause "Simplified" License
36 stars 13 forks source link

[FEATURE-REQUEST] Support for react native 0.64 #16

Closed raymondpebble closed 3 years ago

raymondpebble commented 3 years ago

Feature request

Hi! Could this library be updated to support react native 0.64?

This library has a peer dep on @react-native-community/async-storage whose latest version has a peer dep on React 16. RN 0.64 has a peer dependency on React 17, so unfortunately can't use this with newer RN projects currently :( .

Async storage moved organizations and the newer package location has support for RN 0.64, so hopefully it would be an easy change.

E.g.

Found: react@17.0.1
npm ERR! node_modules/react
npm ERR!   react@"17.0.1" from the root project
npm ERR!   peer react@"17.0.1" from react-native@0.64.1
npm ERR!   node_modules/react-native
npm ERR!     react-native@"0.64.1" from the root project
npm ERR!     peer react-native@">=0.60.0" from @daily-co/react-native-webrtc@1.89.2-daily.3
npm ERR!     node_modules/@daily-co/react-native-webrtc
npm ERR!       @daily-co/react-native-webrtc@"*" from the root project
npm ERR!       1 more (@daily-co/react-native-daily-js)
npm ERR!     1 more (@react-native-community/async-storage)
npm ERR!
npm ERR! Could not resolve dependency:
npm ERR! peer react@"^16.8" from @react-native-community/async-storage@1.12.1
npm ERR! node_modules/@react-native-community/async-storage
npm ERR!   peer @react-native-community/async-storage@"^1.11.0" from @daily-co/react-native-daily-js@0.13.0
npm ERR!   node_modules/@daily-co/react-native-daily-js
npm ERR!     @daily-co/react-native-daily-js@"*" from the root project

Why you need this

To use daily in newer RN projects.

dburdan commented 3 years ago

@raymondpebble You can try applying a patch via patch-package to swap out the import, assuming you have the correct one in your project dependencies.

patches/@daily-co+react-native-daily-js+0.13.0.patch

diff --git a/node_modules/@daily-co/react-native-daily-js/dist/iOSCallObjectBundleCache.js b/node_modules/@daily-co/react-native-daily-js/dist/iOSCallObjectBundleCache.js
index d9825b0..9417e70 100644
--- a/node_modules/@daily-co/react-native-daily-js/dist/iOSCallObjectBundleCache.js
+++ b/node_modules/@daily-co/react-native-daily-js/dist/iOSCallObjectBundleCache.js
@@ -39,7 +39,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
     return (mod && mod.__esModule) ? mod : { "default": mod };
 };
 Object.defineProperty(exports, "__esModule", { value: true });
-var async_storage_1 = __importDefault(require("@react-native-community/async-storage"));
+var async_storage_1 = __importDefault(require("@react-native-async-storage/async-storage"));
 var FIELD_CACHE_EXPIRY = 'expiry';
 var FIELD_BUNDLE_CODE = 'code';
 var FIELD_BUNDLE_LAST_MODIFIED = 'last-modified';
kimberleehowley commented 3 years ago

Hi, @raymondpebble! Thanks for the feature request, and I'm sorry it took me so long to see this. I've tagged @kompfner who is the lead on this and can follow up.

raymondpebble commented 3 years ago

Thank you Kimberlee!

And thank you for the suggestion dburdan

raymondpebble commented 3 years ago

Hi there @kompfner, are you able to share any updates on this? I've tested with 0.64.2 and 0.64.0 and both have the same issue.

kompfner commented 3 years ago

Hi! Thanks for flagging the issue, and pardon the delay. We're currently validating the fix and hope to have it in our next release. Appreciate your patience!

kompfner commented 3 years ago

A new version has been published with the fix. Note the peer dependency change (as you noted above). Thanks again for reporting this, and do let us know if you run into any other issues!

raymondpebble commented 3 years ago

Perfect, thanks kompfner!