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): replace deprecated platform check method #30195

Merged
merged 4 commits into from
Mar 6, 2025

Conversation

r-yanyo
Copy link
Contributor

@r-yanyo r-yanyo commented Feb 17, 2025

Issue number: resolves internal

ref: ionic-team/capacitor#7884


What is the current behavior?

this.platform.is('capacitor') returns false in Capacitor App.

What is the new behavior?

this.platform.is('capacitor') returns as expected.

Does this introduce a breaking change?

  • Yes
  • No

Other information

It might also need to be fixed.

@r-yanyo r-yanyo requested a review from a team as a code owner February 17, 2025 06:25
Copy link

vercel bot commented Feb 17, 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 Feb 28, 2025 7:40pm

@ShaneK ShaneK changed the title replace deprecated method fix(capacitory): replace deprecated platform check method Feb 28, 2025
@ShaneK ShaneK changed the title fix(capacitory): replace deprecated platform check method fix(capacitor): replace deprecated platform check method Feb 28, 2025
@brandyscarney
Copy link
Member

Thank you for the PR! We will merge this in soon. 🙂

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

@thetaPC
Copy link
Contributor

thetaPC commented Mar 6, 2025

Thank you for the PR! Also congrats on your first PR on this repo!!!

@ShaneK ShaneK added this pull request to the merge queue Mar 6, 2025
@ShaneK
Copy link
Member

ShaneK commented Mar 6, 2025

This has been merged into main and will be out in the next release, thank you!

Merged via the queue into ionic-team:main with commit b6b43ae Mar 6, 2025
62 checks passed
github-merge-queue bot pushed a commit that referenced this pull request Mar 6, 2025
Issue number: resolves internal

---------

<!-- Please do not submit updates to dependencies unless it fixes an
issue. -->

<!-- Please try to limit your pull request to one type (bugfix, feature,
etc). Submit multiple pull requests if needed. -->

## What is the current behavior?
<!-- Please describe the current behavior that you are modifying. -->
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?
<!-- Please describe the behavior or changes that are being added by
this PR. -->
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
- [X] No

<!--
  If this introduces a breaking change:
1. Describe the impact and migration path for existing applications
below.
  2. Update the BREAKING.md file with the breaking change.
3. Add "BREAKING CHANGE: [...]" to the commit description when merging.
See
https://github.com/ionic-team/ionic-framework/blob/main/docs/CONTRIBUTING.md#footer
for more information.
-->


## Other information

<!-- Any other information that is important to this PR such as
screenshots of how the component looks before and after the change. -->
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.
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.

4 participants