From 39894021bb001cf1fba38166eec517f647fc5d3f Mon Sep 17 00:00:00 2001 From: Jan Michael Auer Date: Tue, 13 Mar 2018 19:50:32 +0100 Subject: [PATCH 1/3] feat: Add Electron docs --- design/less/main.less | 7 ++ docs/clients/electron/index.rst | 73 ++++++++++++++++++++ docs/clients/electron/sentry-doc-config.json | 3 + docs/clients/index.rst | 1 + docs/clients/table.rst.inc | 8 ++- 5 files changed, 90 insertions(+), 2 deletions(-) create mode 100644 docs/clients/electron/index.rst create mode 100644 docs/clients/electron/sentry-doc-config.json diff --git a/design/less/main.less b/design/less/main.less index e0718cabb64a2..0b110cda3cc74 100644 --- a/design/less/main.less +++ b/design/less/main.less @@ -881,6 +881,13 @@ div.platform-node h1:before { color: #2d292f; } +li p.platformlink-electron a:first-child:before, +div.platform-electron h1:before { + content: "\e801"; + background: #2b2e3b; + color: #9feaf9; +} + li p.platformlink-react-native a:first-child:before, div.platform-react-native h1:before { content: "\e801"; diff --git a/docs/clients/electron/index.rst b/docs/clients/electron/index.rst new file mode 100644 index 0000000000000..cfc798e049845 --- /dev/null +++ b/docs/clients/electron/index.rst @@ -0,0 +1,73 @@ +.. sentry:edition:: hosted, on-premise + + .. class:: platform-electron + + Electron + ======== + +This is the documentation for the Electron SDK. +`Sentry Wizard `_ helps you with the correct +setup. Under the hood we use `raven-node `_ +and `raven-js `_. + +We also do support native crashes via Minidumps. + +Installation +------------ + +All packages are available via npm. + +.. code-block:: sh + + $ npm install @sentry/electron --save + +This will also install `@sentry/wizard`. Run the wizard the help you finish your setup: +With ``yarn`` you can just call: + +.. code-block:: sh + + $ yarn sentry-wizard --integration=electron + +If you only have ``npm`` call: + +.. code-block:: sh + + $ node node_modules/.bin/sentry-wizard --integration=electron + +``sentry-wizard`` will display recommended packages like `electron-download` which we need +to symbolicate native crashes. +The wizard will also create a file called ``sentry.properties`` (which does contain +you account information) and ``sentry-symbols.js`` which helps you with the symbols +upload. + + +Configuring the Client +---------------------- + +The following code should reside in the ``main process`` and all ``renderer processes``: + +.. code-block:: javascript + + const { SentryClient } = require('@sentry/electron'); + + SentryClient.create({ + dsn: '___PRIVATE_DSN___', + // ... + }); + +This configuration will also take care of unhandled Promise rejections, which can be +handled in various ways. By default, Electron uses the standard JS API. +To learn more about handling promises, refer to :ref:`raven-js-promises` documentation. + +Uploading symbols +~~~~~~~~~~~~~~~~~ + +The wizard should create a file called ``sentry-symbols.js`` which takes care of uploading +debug symbols to Sentry. Note that this is only necessary whenever you update your +version of electron. It usually takes quiet a while because it downloads debug symbols +of electron and uploads them to Sentry so we can symbolicate your native crashes. +You can always execute the script by calling: + +.. code-block:: sh + + $ node sentry-symbols.js diff --git a/docs/clients/electron/sentry-doc-config.json b/docs/clients/electron/sentry-doc-config.json new file mode 100644 index 0000000000000..cefa7c3803217 --- /dev/null +++ b/docs/clients/electron/sentry-doc-config.json @@ -0,0 +1,3 @@ +{ + "support_level": "production" +} diff --git a/docs/clients/index.rst b/docs/clients/index.rst index a89121f0b2599..69ff78f7e5850 100644 --- a/docs/clients/index.rst +++ b/docs/clients/index.rst @@ -16,6 +16,7 @@ discussion about supporting it on our `community forum java/index javascript/index node/index + electron/index react-native/index perl/index php/index diff --git a/docs/clients/table.rst.inc b/docs/clients/table.rst.inc index 01c3dba0c80b8..acd00f05c89b5 100644 --- a/docs/clients/table.rst.inc +++ b/docs/clients/table.rst.inc @@ -6,12 +6,16 @@ * .. class:: platformlink-js - :doc:`/clients/javascript/index` Including React, Angular, Electron, Ember, Vue, and Backbone. + :doc:`/clients/javascript/index` Including React, Angular, Ember, Vue, and Backbone. * .. class:: platformlink-node :doc:`/clients/node/index` Including Express, Koa, Loopback, Sails and Connect. +* .. class:: platformlink-electron + + :doc:`/clients/electron/index` For Electron apps. + * .. class:: platformlink-react-native :doc:`/clients/react-native/index` For iOS and Android. @@ -50,4 +54,4 @@ * .. class:: platformlink-cordova - :doc:`/clients/cordova/index` Including Ionic. \ No newline at end of file + :doc:`/clients/cordova/index` Including Ionic. From 8f965430b03df74a6b53946a8d885c9b1667d3a3 Mon Sep 17 00:00:00 2001 From: Jan Michael Auer Date: Tue, 13 Mar 2018 20:07:54 +0100 Subject: [PATCH 2/3] feat(electron): Add a link to the side menu --- design/templates/layout.html | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/design/templates/layout.html b/design/templates/layout.html index 0965ea0407640..bda22c0ed8be8 100644 --- a/design/templates/layout.html +++ b/design/templates/layout.html @@ -216,7 +216,6 @@

{{ page_link('clients/index', 'Platforms') }}

  • {{ page_link('clients/javascript/integrations/angularjs', 'AngularJS') }}
  • {{ page_link('clients/javascript/integrations/angular', 'Angular') }}
  • {{ page_link('clients/javascript/integrations/backbone', 'Backbone') }}
  • -
  • {{ page_link('clients/javascript/integrations/electron', 'Electron') }}
  • {{ page_link('clients/javascript/integrations/ember', 'Ember') }}
  • {{ page_link('clients/javascript/integrations/react', 'React') }}
  • {{ page_link('clients/react-native/index', 'React Native') }}
  • @@ -239,6 +238,9 @@

    {{ page_link('clients/index', 'Platforms') }}

  • {{ page_link('clients/node/integrations/sails', 'Sails') }}
  • + + {{ page_link('clients/electron/index', 'Electron') }} +
  • {{ page_link('clients/perl/index', 'Perl') }}
  • {{ page_link('clients/php/index', 'PHP') }} From ed004ff622f231e82ea30b48b29354f93ee2369f Mon Sep 17 00:00:00 2001 From: Richard Huffaker Date: Tue, 13 Mar 2018 12:34:58 -0700 Subject: [PATCH 3/3] Fix typo --- docs/clients/electron/index.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/clients/electron/index.rst b/docs/clients/electron/index.rst index cfc798e049845..7d592f1bbe9fd 100644 --- a/docs/clients/electron/index.rst +++ b/docs/clients/electron/index.rst @@ -10,7 +10,7 @@ This is the documentation for the Electron SDK. setup. Under the hood we use `raven-node `_ and `raven-js `_. -We also do support native crashes via Minidumps. +We also support native crashes via Minidumps. Installation ------------