fable-compiler / fable-react-native

Fable bindings and helpers for React Native projects
Apache License 2.0
50 stars 11 forks source link

ImageStore, ImageEditor not in React Native anymore #65

Open playfulThinking opened 2 years ago

playfulThinking commented 2 years ago

These packages have been moved out of the base distribution.

ImageStore: Deprecated. Use expo-file-system or react-native-fs instead.

ImageEditor: Deprecated. Use one of the community packages instead

alfonsogarciacaro commented 2 years ago

Could you please have a look @forki?

forki commented 2 years ago

@fremontmj could you please send a PR?

playfulThinking commented 2 years ago

The only reason I know about this is because I have a nascent Expo project and was testing the web version (which uses react-native-web to make a compatibility layer to React in the browser), and got these errors:

/src/fable_modules/Fable.React.Native.3.0.0-alpha001/Fable.ReactNative.fs.js:1874:14
"export 'ImageEditor' was not found in 'react-native-web/dist/index'
  1872 | export function ImageEditor_cropImage(uri, cropData) {
  1873 |     return new Promise(((onSuccess, onError) => {
> 1874 |         void (ImageEditor.cropImage(uri, cropData.data, onSuccess, onError));
       |              ^
  1875 |     }));
  1876 | }
  1877 |
./src/fable_modules/Fable.React.Native.3.0.0-alpha001/Fable.ReactNative.fs.js:1801:14
"export 'ImageStore' was not found in 'react-native-web/dist/index'
  1799 | export function ImageStore_getBase64ForTag(uri) {
  1800 |     return new Promise(((onSuccess, onError) => {
> 1801 |         void (ImageStore.getBase64ForTag(uri, onSuccess, onError));
       |              ^
  1802 |     }));
  1803 | }
  1804 |
./src/fable_modules/Fable.React.Native.3.0.0-alpha001/Fable.ReactNative.fs.js:1807:14
"export 'ImageStore' was not found in 'react-native-web/dist/index'
  1805 | export function ImageStore_addImageFromBase64(imageData) {
  1806 |     return new Promise(((onSuccess, onError) => {
> 1807 |         void (ImageStore.addImageFromBase64(imageData, onSuccess, onError));
       |              ^
  1808 |     }));
  1809 | }

I then looked up those packages and saw they are no longer in the later React Native distributions (they're also not supported by react-native-web).

I would try to make a PR (though I'm a complete noob at these things), but I don't use either of these libraries, so I'd have no way to test it.

I'm sorry I don't think I can be of help.