refactor(android)!: drop legacy @NativePlugin annotation support - #8558
Draft
OS-ruimoreiramendes wants to merge 2 commits into
Draft
refactor(android)!: drop legacy @NativePlugin annotation support#8558OS-ruimoreiramendes wants to merge 2 commits into
OS-ruimoreiramendes wants to merge 2 commits into
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Removes the legacy
@NativePluginannotation and its associated permission/activity result machinery, as part of the Capacitor 9 cleanup.@NativePluginhas been@Deprecatedsince Capacitor 3.0.0 (May 2021) in favor of@CapacitorPlugin.This PR closes RMET-5305 (decision spike + implementation) and also covers the conditional cluster from RMET-5304 that was deferred pending this decision (see #8553 "Intentionally kept" section).
Intentionally kept (still overridden by
CordovaPluginfor Cordova compatibility):Plugin.handleRequestPermissionsResult,Plugin.handleOnActivityResult,Plugin.hasDefinedRequiredPermissions,Plugin.hasRequiredPermissions,Plugin.hasPermission,Bridge.getPluginWithRequestCode.A follow-up ticket will refactor
CordovaPluginto enable full removal in Cap 10.Change Type
Rationale / Problems Fixed
Capacitor 9 is a major release, the natural moment to drop APIs that have been deprecated for several majors.
@NativePluginhas been deprecated for 5+ years, and every published plugin still using it is frozen at Capacitor 3–4 (2020–2022) with many other breaking API dependencies that already prevent it from running on modern Capacitor.Tests or Reproductions
./gradlew :capacitor-android:compileDebugJavaWithJavacand:capacitor-cordova-android:compileDebugJavaWithJavacpass with no warnings../gradlew :capacitor-android:testDebugUnitTestpasses../gradlew buildpasses.npx cap sync androidoncapacitor-testapp(20 plugins discovered correctly).@capacitor/androidlinked locally against this branch:@capacitor/camera: permission dialog + camera activity + photo delivered back.@capacitor/share: 4 scenarios (success, cancel, empty payload validation, share of photo path).@capacitor/geolocation(via capacitor-geolocation example-app): permission dialog, native execution, JS callback with error propagation.cordova-plugin-inappbrowser:__CordovaPluginregisters, Cordova bridge interceptor routes JS to Native, InAppBrowser lifecycle completes cleanly. Confirms Cordova compatibility is not broken.Platforms Affected
Notes / Comments