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(capacitor): use proper types for capacitor v7 support #30228

Merged
merged 1 commit into from
Mar 6, 2025
Merged

Conversation

ShaneK
Copy link
Member

@ShaneK ShaneK commented Mar 3, 2025

Issue number: resolves internal


What is the current behavior?

Currently, Capacitor types are outdated in Ionic Framework and we're accessing a type property that no longer exists in Capacitor 7.0.0+

What is the new behavior?

This PR updates the capacitor version and addresses removal of .Plugins from @capacitor/core's CapacitorGlobal, which we rely on to dynamically access plugins that the user may or may not have installed.

The fix for this was creating a custom type definition to support accessing Plugins. While Plugins was removed from Capacitor if we were accessing it directly from core, we're pulling it from the window in the browser, where it's still exposed, so we just needed to make our type reflect that.

Does this introduce a breaking change?

  • Yes
  • No

Other information

Technically, this issue does not prevent Framework from working with Capacitor 7 because it's only a typing issue, but it's still a minor issue that should be addressed in our effort to support Capacitor 7. This PR, along with #30195, should make it ready for that.

@ShaneK ShaneK requested a review from a team as a code owner March 3, 2025 19:44
@ShaneK ShaneK requested a review from rugoncalves March 3, 2025 19:44
Copy link

vercel bot commented Mar 3, 2025

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
ionic-framework ✅ Ready (Inspect) Visit Preview 💬 Add feedback Mar 3, 2025 7:44pm

@github-actions github-actions bot added the package: core @ionic/core package label Mar 3, 2025
@ShaneK ShaneK changed the title feat(capacitor): updating capacitor types to 7.0.0 fix(capacitor): use proper types for capacitor v7 support Mar 3, 2025
Copy link
Contributor

@thetaPC thetaPC left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@ShaneK ShaneK added this pull request to the merge queue Mar 6, 2025
Merged via the queue into main with commit 2149ba2 Mar 6, 2025
50 checks passed
@ShaneK ShaneK deleted the ROU-11656 branch March 6, 2025 01:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
package: core @ionic/core package
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants