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

Add v3 to v4 plugin migration page #123

Open
wants to merge 5 commits into
base: main
Choose a base branch
from
Open

Conversation

dotNetkow
Copy link
Contributor

No description provided.

@vercel
Copy link

vercel bot commented Dec 1, 2022

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

Name Status Preview Updated
capacitor-docs ✅ Ready (Inspect) Visit Preview Dec 16, 2022 at 7:34PM (UTC)

While you can follow the manual steps below, check out [this tool](https://github.com/rdlabo-team/capacitor-plugin-to-v4) from community member [@rdlabo](https://twitter.com/rdlabo) that automatically updates a Capacitor 3 plugin to v4.
:::

## Android
Copy link
Contributor Author

Choose a reason for hiding this comment

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

I followed this commit to figure out what changed. I may have missed something. if it's easier, maybe we just recommend the migration tool?

Copy link
Member

@jcesarmobile jcesarmobile left a comment

Choose a reason for hiding this comment

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

Why are you removing the updating to 3.x guide? I think it can still be helpful and we are keeping the older upgrade guides for capacitor, so I think we should keep the old upgrade guides for plugins too.

You have missed the podspec change, which is the most important one related to the iOS deployment target as the podspec is what's used when users install the plugin in their project
ionic-team/create-capacitor-plugin@03027bf#diff-dc8721a872ae0dcc9e412a0a0b13bc684f6b8de82abee362ce965cf6d216f2d4L14

@dotNetkow
Copy link
Contributor Author

Why are you removing the updating to 3.x guide? I think it can still be helpful and we are keeping the older upgrade guides for capacitor, so I think we should keep the old upgrade guides for plugins too.

That's true, definitely should keep those around. The PR makes it look like I deleted it entirely but I only removed from the current v4 Capacitor docs root level. Essentially it's replaced with the new v4 page (docs/updating/plugins/4-0). The 3.x guide still lives under /docs/v3/updating/plugins/3-0.

You have missed the podspec change, which is the most important one related to the iOS deployment target as the podspec is what's used when users install the plugin in their project ionic-team/create-capacitor-plugin@03027bf#diff-dc8721a872ae0dcc9e412a0a0b13bc684f6b8de82abee362ce965cf6d216f2d4L14

OK, updated the PR. see if it's correct now.

@jcesarmobile
Copy link
Member

That's true, definitely should keep those around. The PR makes it look like I deleted it entirely but I only removed from the current v4 Capacitor docs root level. Essentially it's replaced with the new v4 page (docs/updating/plugins/4-0). The 3.x guide still lives under /docs/v3/updating/plugins/3-0.

I know the docs are still on the v3 version of the docs, but I think we should keep the plugin update to version 3 file on the main docs too as we are doing with the updating app docs.
That, or delete the old Updating to 1.1, 2.0 and 3.0 from the main menu if we only want to have the latest information and make users search for the older updating guides.

@dotNetkow
Copy link
Contributor Author

OK, added v3 back in. Here's the root (v4) docs now:
image

Copy link
Member

@jcesarmobile jcesarmobile left a comment

Choose a reason for hiding this comment

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

added a few more comments

also it's missing this java 11 change (some java 11 changes are mentioned, but not this) ionic-team/create-capacitor-plugin@03027bf#diff-51795f26cbdfdde24931f6d0f9d6f047f4617fc6a6cb850029cd78c8e0e9b90dR39-R40


### Update to Gradle 7

Adjust your Gradle project settings in `File > Project Structure > Project`. The Android Gradle Plugin Version should be 7.2.1 or later and the Gradle Version should be 7.4.2 or later. Apply these changes and run a gradle sync by clicking on the Elephant Icon in the top right of Android Studio.
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
Adjust your Gradle project settings in `File > Project Structure > Project`. The Android Gradle Plugin Version should be 7.2.1 or later and the Gradle Version should be 7.4.2 or later. Apply these changes and run a gradle sync by clicking on the Elephant Icon in the top right of Android Studio.
Adjust your Gradle project settings in `File > Project Structure > Project`. The Android Gradle Plugin Version should be 7.2.1 and the Gradle Version should be 7.4.2. Apply these changes and run a gradle sync by clicking on the Elephant Icon in the top right of Android Studio.

Better not use "or later" as newer versions could cause issues, stick to the ones we used in all plugins and Capacitor itself.


Do the following to your Xcode project: select the **Project** within the project editor and open the **Build Settings** tab. Under the **Deployment** section, change **iOS Deployment Target** to **iOS 13.0**. Repeat the same steps for any app **Targets**.

Then, open `ios/App/Podfile` and update the iOS version to 13.0:
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
Then, open `ios/App/Podfile` and update the iOS version to 13.0:
Then, open `ios/Podfile` and update the iOS version to 13.0:

The guide is about plugins, there is no App folder in plugins, the Podfile is inside the ios folder


### Update Android Project Variables

In your `build.gradle` file, update your values to the following new minimums:
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
In your `build.gradle` file, update your values to the following new minimums:
In your `android/build.gradle` file, update your values to the following new minimums:


In your `build.gradle` file, update your values to the following new minimums:

```groovy
Copy link
Member

Choose a reason for hiding this comment

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

this block is confusing, looks like you copied the changes from the variables.gradle file, but in plugins there is no variables.gradle file and the values are in different places and with a different format (using : instead of = )
So maybe instead of a code block use a list saying
minSdkVersion to 22
compileSdkVersion to 32
etc.


### Remove `jcenter()` from the Gradle files

In previous Capacitor versions, `jcenter()` was required due to our Cordova compatibility layer being hosted on Jcenter. However, we are now using the latest Cordova Android version, hosted on Maven Central. With this, you may be able to remove `jcenter()` entirely from your `build.gradle` file. If you are using other native dependencies, make sure they aren't hosted on Jcenter before removing it!
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
In previous Capacitor versions, `jcenter()` was required due to our Cordova compatibility layer being hosted on Jcenter. However, we are now using the latest Cordova Android version, hosted on Maven Central. With this, you may be able to remove `jcenter()` entirely from your `build.gradle` file. If you are using other native dependencies, make sure they aren't hosted on Jcenter before removing it!
In previous Capacitor versions, `jcenter()` was required due to our Cordova compatibility layer being hosted on Jcenter. However, we are now using the latest Cordova Android version, hosted on Maven Central. With this, you may be able to remove `jcenter()` entirely from your `android/build.gradle` file. If you are using other native dependencies, make sure they aren't hosted on Jcenter before removing it!

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.

2 participants