diachedelic / capacitor-blob-writer

Capacitor plugin to write binary data to the filesystem
MIT License
132 stars 17 forks source link

'registerWebPlugin' is deprecated #23

Closed leo6104 closed 3 years ago

leo6104 commented 3 years ago

image

I saw that this plugin have console.warn about deprecated functions.

diachedelic commented 3 years ago

Thanks for pointing this out. Does it work with Capacitor v3 for you?

leo6104 commented 3 years ago

Yes. it works with Capacitor 3 ! (iOS / Android)
Thanks for awesome plugin. :)

diachedelic commented 3 years ago

Good to know! I will aim to fix this sometime before Capacitor v4 is released.

jfbloom22 commented 3 years ago

@leo6104 did you do anything special to get this working in Capacitor 3? I am running into these build errors:

node_modules/@capacitor/core/types/definitions-internal.d.ts:16:18 - error TS2430: Interface 'CapacitorInstance' incorrectly extends interface 'CapacitorGlobal'.
  Types of property 'Plugins' are incompatible.
    Property 'BlobWriter' is missing in type '{ [pluginName: string]: { [prop: string]: any; }; }' but required in type 'PluginRegistry'.

16 export interface CapacitorInstance extends CapacitorGlobal {
                    ~~~~~~~~~~~~~~~~~

  node_modules/capacitor-blob-writer/dist/index.d.ts:4:9
    4         BlobWriter: BlobWriterPlugin;
              ~~~~~~~~~~
    'BlobWriter' is declared here.
node_modules/capacitor-blob-writer/dist/index.d.ts:1:10 - error TS2305: Module '"@capacitor/core"' has no exported member 'FilesystemDirectory'.

1 import { FilesystemDirectory } from '@capacitor/core';
diachedelic commented 3 years ago

Based on my experience upgrading another plugin of mine (which was quite involved), I would be very surprised if this plugin is compatible with Capacitor v3 in its current form. It needs upgrading.

leo6104 commented 3 years ago

@diachedelic interface PluginRegistry logic should be removed on capacitor v3.

https://github.com/diachedelic/capacitor-blob-writer/blob/master/src/index.ts#L9

jfbloom22 commented 3 years ago

@leo6104 I just submitted my PR for the same. Haha I wish I had noticed your PR two days ago it would have given me more of a head start. It looks like I made it a little further since I updated the pods and have tested it in my Capacitor 3 iOS app. Please check it out and let me know if there is anything I can improve on it. https://github.com/diachedelic/capacitor-blob-writer/pull/30

diachedelic commented 3 years ago

Please try version 1 of the plugin, it should support Capacitor v3. Thanks for your pull requests, they helped a lot.