Skip to content
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

fix: fix isPluginAvailable() for web and native #4114

Merged
merged 8 commits into from
Jan 28, 2021
Merged

Conversation

imhoffd
Copy link
Contributor

@imhoffd imhoffd commented Jan 25, 2021

This PR introduces the idea of "plugin headers" that are written to JS alongside the plugin skeleton implementations.

This is required because the core refactor changed how the Capacitor.Plugins object is populated and broke isPluginAvailable(). The new headers are necessary to know if a plugin has an implementation on native. isPluginAvailable() has been updated to check JS and native implementations.

I want to do a refactor later to remove the plugin skeleton implementations because they're unnecessary with our proxy and with bundling the core together.

@imhoffd imhoffd linked an issue Jan 25, 2021 that may be closed by this pull request
@imhoffd imhoffd marked this pull request as draft January 25, 2021 18:42
@mburger81
Copy link

Looks good, can you please release it in beta as soon as possibile, thx.

@imhoffd
Copy link
Contributor Author

imhoffd commented Jan 26, 2021

@mburger81 Unfortunately this PR does not yet address all the issues with isPluginAvailable().

@imhoffd imhoffd changed the title fix(core): fix isPluginAvailable() for web fix(core): fix isPluginAvailable() for web and native Jan 26, 2021
@imhoffd imhoffd marked this pull request as ready for review January 26, 2021 21:14
@imhoffd imhoffd changed the title fix(core): fix isPluginAvailable() for web and native fix: fix isPluginAvailable() for web and native Jan 26, 2021
@imhoffd imhoffd merged commit 2fbd954 into main Jan 28, 2021
@imhoffd imhoffd deleted the plugin-available-fix branch January 28, 2021 01:41
@imhoffd imhoffd added this to the 3.0.0-beta.2 milestone Jan 29, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

bug: Capacitor.isPluginAvailable not working as intended
2 participants