-
Notifications
You must be signed in to change notification settings - Fork 1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Plugin Import Proposal #3306
Comments
Shouldn't export class EchoPluginWeb extends WebPlugin implements EchoPlugin {
constructor() {
super({ name: 'Echo' });
}
} have an |
Yeah, but not super important to the proposal, I'll add |
Just didn't want people trying it with your code and going "why isn't this working?!?!" I know most people will see the issue but I've been there before where its a small little thing I screw up that takes me far too long to figure out... 😅 |
If you want, you can try the PR: #3305 It's meant to be a working example. 😄 |
Thanks for the issue! This issue is being locked to prevent comments that are not relevant to the original issue. If this is still an issue with the latest version of Capacitor, please create a new issue and ensure the template is fully filled out. |
Please feel free to comment on this proposal. Thanks!
@capacitor/core
should provide aregisterPlugin
function that takes an object of implementations for each platform. For Android and iOS, the plugins proxy can be used. For web, the web implementation will need to be provided.registerPlugin
will return aRegisteredPlugin
object with agetImplementation
method that returns the instance of the plugin for the current platform.The "echo" example will be used for this proposal.
echo-plugin/index.ts
echo-plugin/web.ts
my-app/some-page.tsx
This shouldn't be a breaking change because plugins will need to opt-in to using
registerPlugin
in order for the new plugin import to work. (Previously, users of the plugin would have toimport { Plugins } from '@capacitor/core';
).The text was updated successfully, but these errors were encountered: