remix.tsx 4.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129
  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. DocsParams,
  8. OnboardingConfig,
  9. } from 'sentry/components/onboarding/gettingStartedDoc/types';
  10. import {t, tct} from 'sentry/locale';
  11. type Params = DocsParams;
  12. const onboarding: OnboardingConfig = {
  13. introduction: () =>
  14. tct("Sentry's integration with [remixLink:Remix] supports Remix 1.0.0 and above.", {
  15. remixLink: <ExternalLink href="https://remix.run/" />,
  16. }),
  17. install: (_params: Params) => [
  18. {
  19. type: StepType.INSTALL,
  20. configurations: [
  21. {
  22. description: t(
  23. 'Install and configure the Sentry Remix SDK automatically with our wizard:'
  24. ),
  25. language: 'bash',
  26. code: [
  27. {
  28. label: 'bash',
  29. value: 'bash',
  30. language: 'bash',
  31. code: `npx @sentry/wizard@latest -i remix`,
  32. },
  33. ],
  34. },
  35. ],
  36. },
  37. ],
  38. configure: () => [
  39. {
  40. type: StepType.CONFIGURE,
  41. description: t(
  42. 'The Sentry wizard will automatically add code to your project to inialize and configure the Sentry SDK:'
  43. ),
  44. configurations: [
  45. {
  46. description: (
  47. <List symbol="bullet">
  48. <ListItem>
  49. {tct(
  50. "Create two files in the root directory of your project, [clientEntry:entry.client.tsx] and [serverEntry:entry.server.tsx] (if they don't already exist).",
  51. {
  52. clientEntry: <code />,
  53. serverEntry: <code />,
  54. }
  55. )}
  56. </ListItem>
  57. <ListItem>
  58. {tct(
  59. 'Add the default [sentryInitCode:Sentry.init] call to both, client and server entry files.',
  60. {
  61. sentryInitCode: <code />,
  62. }
  63. )}
  64. </ListItem>
  65. <ListItem>
  66. {tct(
  67. 'Create a [cliRc:.sentryclirc] with an auth token to upload source maps (this file is automatically added to your [gitignore:.gitignore]).',
  68. {
  69. cliRc: <code />,
  70. gitignore: <code />,
  71. }
  72. )}
  73. </ListItem>
  74. <ListItem>
  75. {tct(
  76. 'Adjust your [buildscript:build] script in your [pkgJson:package.json] to automatically upload source maps to Sentry when you build your application.',
  77. {
  78. buildscript: <code />,
  79. pkgJson: <code />,
  80. }
  81. )}
  82. </ListItem>
  83. </List>
  84. ),
  85. },
  86. {
  87. description: tct(
  88. 'You can also further [manualConfigure:configure your SDK] or [manualSetupLink:set it up manually], without the wizard.',
  89. {
  90. manualConfigure: (
  91. <ExternalLink href="https://docs.sentry.io/platforms/javascript/guides/remix/manual-setup/#configuration" />
  92. ),
  93. manualSetupLink: (
  94. <ExternalLink href="https://docs.sentry.io/platforms/javascript/guides/remix/manual-setup/" />
  95. ),
  96. }
  97. ),
  98. },
  99. ],
  100. },
  101. ],
  102. verify: () => [],
  103. nextSteps: () => [
  104. {
  105. id: 'performance-monitoring',
  106. name: t('Performance Monitoring'),
  107. description: t(
  108. 'Track down transactions to connect the dots between 10-second page loads and poor-performing API calls or slow database queries.'
  109. ),
  110. link: 'https://docs.sentry.io/platforms/javascript/guides/remix/performance/',
  111. },
  112. {
  113. id: 'session-replay',
  114. name: t('Session Replay'),
  115. description: t(
  116. 'Get to the root cause of an error or latency issue faster by seeing all the technical details related to that issue in one visual replay on your web application.'
  117. ),
  118. link: 'https://docs.sentry.io/platforms/javascript/guides/remix/session-replay/',
  119. },
  120. ],
  121. };
  122. const docs: Docs = {
  123. onboarding,
  124. };
  125. export default docs;