apple-ios.tsx 6.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181
  1. import ExternalLink from 'sentry/components/links/externalLink';
  2. import List from 'sentry/components/list/';
  3. import ListItem from 'sentry/components/list/listItem';
  4. import {StepType} from 'sentry/components/onboarding/gettingStartedDoc/step';
  5. import {
  6. Docs,
  7. OnboardingConfig,
  8. } from 'sentry/components/onboarding/gettingStartedDoc/types';
  9. import {t, tct} from 'sentry/locale';
  10. const getExperimentalFeaturesSnippet = () => `
  11. import Sentry
  12. SentrySDK.start { options in
  13. // ...
  14. // Enable all experimental features
  15. options.attachViewHierarchy = true
  16. options.enablePreWarmedAppStartTracing = true
  17. options.enableMetricKit = true
  18. options.enableTimeToFullDisplayTracing = true
  19. options.swiftAsyncStacktraces = true
  20. }`;
  21. const onboarding: OnboardingConfig = {
  22. install: () => [
  23. {
  24. type: StepType.INSTALL,
  25. description: (
  26. <p>
  27. {tct(
  28. 'Add Sentry automatically to your app with the [wizardLink:Sentry wizard] (call this inside your project directory).',
  29. {
  30. wizardLink: (
  31. <ExternalLink href="https://docs.sentry.io/platforms/apple/guides/ios/#install" />
  32. ),
  33. }
  34. )}
  35. </p>
  36. ),
  37. configurations: [
  38. {
  39. language: 'bash',
  40. code: `brew install getsentry/tools/sentry-wizard && sentry-wizard -i ios`,
  41. },
  42. ],
  43. },
  44. ],
  45. configure: () => [
  46. {
  47. type: StepType.CONFIGURE,
  48. description: t('The Sentry wizard will automatically patch your application:'),
  49. configurations: [
  50. {
  51. description: (
  52. <List symbol="bullet">
  53. <ListItem>
  54. {t('Install the Sentry SDK via Swift Package Manager or Cocoapods')}
  55. </ListItem>
  56. <ListItem>
  57. {tct(
  58. 'Update your [appDelegate: AppDelegate] or SwiftUI App Initializer with the default Sentry configuration and an example error',
  59. {
  60. appDelegate: <code />,
  61. }
  62. )}
  63. </ListItem>
  64. <ListItem>
  65. {tct(
  66. 'Add a new [phase: Upload Debug Symbols] phase to your [xcodebuild: xcodebuild] build script',
  67. {
  68. phase: <code />,
  69. xcodebuild: <code />,
  70. }
  71. )}
  72. </ListItem>
  73. <ListItem>
  74. {tct(
  75. 'Create [sentryclirc: .sentryclirc] with an auth token to upload debug symbols (this file is automatically added to [gitignore: .gitignore])',
  76. {
  77. sentryclirc: <code />,
  78. gitignore: <code />,
  79. }
  80. )}
  81. </ListItem>
  82. <ListItem>
  83. {t(
  84. "When you're using Fastlane, it will add a Sentry lane for uploading debug symbols"
  85. )}
  86. </ListItem>
  87. </List>
  88. ),
  89. additionalInfo: tct(
  90. 'Alternatively, you can also [manualSetupLink:set up the SDK manually].',
  91. {
  92. manualSetupLink: (
  93. <ExternalLink href="https://docs.sentry.io/platforms/apple/guides/ios/manual-setup/" />
  94. ),
  95. stepsBelow: <strong />,
  96. }
  97. ),
  98. },
  99. ],
  100. },
  101. ],
  102. verify: () => [
  103. {
  104. type: StepType.VERIFY,
  105. description: t(
  106. 'The Sentry wizard automatically adds a code snippet that captures a message to your project. Simply run your app and you should see this message in your Sentry project.'
  107. ),
  108. },
  109. {
  110. title: t('Experimental Features'),
  111. description: tct(
  112. 'Want to play with some new features? Try out our experimental features for [vh: View Hierarchy], [ttfd: Time to Full Display (TTFD)], [metricKit: MetricKit], [prewarmedAppStart: Prewarmed App Start Tracing], and [asyncStacktraces: Swift Async Stacktraces]. Experimental features are still a work-in-progress and may have bugs. We recognize the irony. [break] Let us know if you have feedback through [gh: GitHub issues].',
  113. {
  114. vh: (
  115. <ExternalLink href="https://docs.sentry.io/platforms/apple/guides/ios/enriching-events/viewhierarchy/" />
  116. ),
  117. ttfd: (
  118. <ExternalLink href="https://docs.sentry.io/platforms/apple/guides/ios/performance/instrumentation/automatic-instrumentation/#time-to-full-display" />
  119. ),
  120. metricKit: (
  121. <ExternalLink href="https://docs.sentry.io/platforms/apple/guides/watchos/configuration/metric-kit/" />
  122. ),
  123. prewarmedAppStart: (
  124. <ExternalLink href="https://docs.sentry.io/platforms/apple/performance/instrumentation/automatic-instrumentation/#prewarmed-app-start-tracing" />
  125. ),
  126. asyncStacktraces: (
  127. <ExternalLink href="https://docs.sentry.io/platforms/apple/guides/ios/#stitch-together-swift-concurrency-stack-traces" />
  128. ),
  129. gh: <ExternalLink href="https://github.com/getsentry/sentry-cocoa/issues" />,
  130. break: <br />,
  131. }
  132. ),
  133. configurations: [
  134. {
  135. language: 'swift',
  136. code: getExperimentalFeaturesSnippet(),
  137. },
  138. ],
  139. },
  140. ],
  141. nextSteps: () => [
  142. {
  143. id: 'cocoapods-carthage',
  144. name: t('CocoaPods/Carthage'),
  145. description: t(
  146. 'Learn about integrating Sentry into your project using CocoaPods or Carthage.'
  147. ),
  148. link: 'https://docs.sentry.io/platforms/apple/install/',
  149. },
  150. {
  151. id: 'debug-symbols',
  152. name: t('Debug Symbols'),
  153. description: t('Symbolicate and get readable stacktraces in your Sentry errors.'),
  154. link: 'https://docs.sentry.io/platforms/apple/dsym/',
  155. },
  156. {
  157. id: 'swiftui',
  158. name: t('SwiftUI'),
  159. description: t('Learn about our first class integration with SwiftUI.'),
  160. link: 'https://docs.sentry.io/platforms/apple/performance/instrumentation/swiftui-instrumentation/',
  161. },
  162. {
  163. id: 'profiling',
  164. name: t('Profiling'),
  165. description: t(
  166. 'Collect and analyze performance profiles from real user devices in production.'
  167. ),
  168. link: 'https://docs.sentry.io/platforms/apple/profiling/',
  169. },
  170. ],
  171. };
  172. const docs: Docs = {
  173. onboarding,
  174. };
  175. export default docs;