From 58ff6df57882b8ac3e86019e22b971ac6d0293bf Mon Sep 17 00:00:00 2001 From: LucasZF Date: Mon, 26 Aug 2024 08:38:50 -0300 Subject: [PATCH] (Capacitor): Add migration guide for new version (#10987) --- .../guides/capacitor/migration/index.mdx | 10 ++++ .../capacitor/migration/v0-to-v1/index.mdx | 19 +++++++ .../migration/v0-to-v1/v7-to-v8/index.mdx | 9 ++++ .../v0-to-v1/v7-to-v8/v7-deprecations.mdx | 7 +++ .../v7-to-v8/v8-new-performance-api.mdx | 7 +++ .../javascript-v8/browser-other-changes.mdx | 2 +- .../javascript.capacitor.mdx | 51 ++++--------------- 7 files changed, 64 insertions(+), 41 deletions(-) create mode 100644 docs/platforms/javascript/guides/capacitor/migration/index.mdx create mode 100644 docs/platforms/javascript/guides/capacitor/migration/v0-to-v1/index.mdx create mode 100644 docs/platforms/javascript/guides/capacitor/migration/v0-to-v1/v7-to-v8/index.mdx create mode 100644 docs/platforms/javascript/guides/capacitor/migration/v0-to-v1/v7-to-v8/v7-deprecations.mdx create mode 100644 docs/platforms/javascript/guides/capacitor/migration/v0-to-v1/v7-to-v8/v8-new-performance-api.mdx diff --git a/docs/platforms/javascript/guides/capacitor/migration/index.mdx b/docs/platforms/javascript/guides/capacitor/migration/index.mdx new file mode 100644 index 0000000000000..eca0bfd782f34 --- /dev/null +++ b/docs/platforms/javascript/guides/capacitor/migration/index.mdx @@ -0,0 +1,10 @@ +--- +title: Migration Guide +description: "Migrate from an older version of our Sentry Capacitor SDK." +sidebar_order: 8000 +--- + +Here's a list of guides on migrating to a newer version of the Sentry Capacitor SDK. + + + \ No newline at end of file diff --git a/docs/platforms/javascript/guides/capacitor/migration/v0-to-v1/index.mdx b/docs/platforms/javascript/guides/capacitor/migration/v0-to-v1/index.mdx new file mode 100644 index 0000000000000..c2822f5c51a01 --- /dev/null +++ b/docs/platforms/javascript/guides/capacitor/migration/v0-to-v1/index.mdx @@ -0,0 +1,19 @@ +--- +title: Migrate from 0.x to 1.x +sidebar_order: 8920 +description: "Learn about migrating from Sentry Capacitor SDK 0.x to 1.x" +--- + +## How to upgrade to SDK version 1: + +When upgrading to SDK version 1, please note the main breaking changes with Sentry Capacitor. More detailed information about breaking changes in the sibling SDKs can be found in the sibling migration guide. + +- Angular minimum supported version changed to version 14, upgrade to Angular 14 or higher for using the latest SDK. + +- When using the package `@sentry/angular-ivy`, you will need to replace it by `@sentry/angular`. + +- `enableOutOfMemoryTracking` was removed and replaced by `enableWatchdogTerminationTracking`. + +- Capacitor V1 requires Sentry JavaScript SDK on version 8.x. We recommend reading below migration guide docs to find out how to address any breaking changes when upgrading the sibling dependencies to version 8. + + \ No newline at end of file diff --git a/docs/platforms/javascript/guides/capacitor/migration/v0-to-v1/v7-to-v8/index.mdx b/docs/platforms/javascript/guides/capacitor/migration/v0-to-v1/v7-to-v8/index.mdx new file mode 100644 index 0000000000000..ef250e639255b --- /dev/null +++ b/docs/platforms/javascript/guides/capacitor/migration/v0-to-v1/v7-to-v8/index.mdx @@ -0,0 +1,9 @@ +--- +title: Migrate from Sibling SDK 7.x to 8.x +sidebar_order: 8910 +description: "Learn about migrating from Sentry JavaScript SDK 7.x to 8.x" +--- + + + + diff --git a/docs/platforms/javascript/guides/capacitor/migration/v0-to-v1/v7-to-v8/v7-deprecations.mdx b/docs/platforms/javascript/guides/capacitor/migration/v0-to-v1/v7-to-v8/v7-deprecations.mdx new file mode 100644 index 0000000000000..b2a1a65fae3c5 --- /dev/null +++ b/docs/platforms/javascript/guides/capacitor/migration/v0-to-v1/v7-to-v8/v7-deprecations.mdx @@ -0,0 +1,7 @@ +--- +title: Deprecations in 7.x +sidebar_order: 8940 +description: "Learn about deprecations in Sentry JavaScript SDK 7.x and how to address them" +--- + + diff --git a/docs/platforms/javascript/guides/capacitor/migration/v0-to-v1/v7-to-v8/v8-new-performance-api.mdx b/docs/platforms/javascript/guides/capacitor/migration/v0-to-v1/v7-to-v8/v8-new-performance-api.mdx new file mode 100644 index 0000000000000..9d8a7121079b6 --- /dev/null +++ b/docs/platforms/javascript/guides/capacitor/migration/v0-to-v1/v7-to-v8/v8-new-performance-api.mdx @@ -0,0 +1,7 @@ +--- +title: New Tracing APIs +sidebar_order: 8920 +description: "Learn about new Tracing APIs in Sentry JavaScript SDK 8.x" +--- + + diff --git a/includes/migration/javascript-v8/browser-other-changes.mdx b/includes/migration/javascript-v8/browser-other-changes.mdx index 3fbeabfbe2501..d81756673ce76 100644 --- a/includes/migration/javascript-v8/browser-other-changes.mdx +++ b/includes/migration/javascript-v8/browser-other-changes.mdx @@ -34,7 +34,7 @@ Sentry.init({ The xhr transport via `makeXHRTransport` transport has been removed. Only `makeFetchTransport` is available now. This means that the Sentry SDK requires the `fetch` API to be available in the environment. - + ### Removal of the `Offline` integration The `Offline` integration has been removed in favor of the offline transport wrapper diff --git a/platform-includes/getting-started-install/javascript.capacitor.mdx b/platform-includes/getting-started-install/javascript.capacitor.mdx index 0a9bd0ef5f11f..2d5a92aa3c6c1 100644 --- a/platform-includes/getting-started-install/javascript.capacitor.mdx +++ b/platform-includes/getting-started-install/javascript.capacitor.mdx @@ -44,49 +44,20 @@ yarn add @sentry/capacitor @sentry/browser pnpm add @sentry/capacitor @sentry/browser ``` -### Capacitor 2 - Android Specifics +### Angular Version Compatibility - +In its current beta version, the Sentry Capacitor SDK only supports Angular 14 and newer. -This step is not needed if you are using Capacitor 3 +If you're using an older version of Angular, you also need to use an older version of the SDK. See the table below for compatibility guidance: - +| Angular version | Recommended Sentry SDK | +| --------------- | ------------------------------------------------------------------------------------------------------ | +| 14 and newer | `@sentry/capacitor` `@sentry/angular` | +| 12 or 13 | `@sentry/capacitor^0` `@sentry/angular-ivy@^7` * | +| 10 or 11 | `@sentry/capacitor^0` `@sentry/angular@^7` * | -Add the plugin declaration to your `MainActivity.java` file +\* These versions of the SDK are no longer maintained or tested. Version 0 might still receive bug fixes but we don't guarantee support. -```java {filename:MainActivity.java} -import android.os.Bundle; -import com.getcapacitor.BridgeActivity; -import com.getcapacitor.Plugin; -import io.sentry.capacitor.SentryCapacitor; -import java.util.ArrayList; +### React and Vue Version Compatibility -public class MainActivity extends BridgeActivity { - @Override - public void onCreate(Bundle savedInstanceState) { - super.onCreate(savedInstanceState); - // Initializes the Bridge - this.init(savedInstanceState, new ArrayList>() {{ - add(SentryCapacitor.class); - }}); - } -} -``` - -```kotlin -import android.os.Bundle -import com.getcapacitor.BridgeActivity -import com.getcapacitor.Plugin -import io.sentry.capacitor.SentryCapacitor - -class MainActivity : BridgeActivity() { - fun onCreate(savedInstanceState: Bundle?) { - super.onCreate(savedInstanceState) - // Initializes the Bridge - this.init( - savedInstanceState, - listOf>(SentryCapacitor::class.java) - ) - } -} -``` +Both Frameworks are fully compatible with the current and beta versions of Sentry Capacitor.